Skip to content

Commit

Permalink
Update Maven plugins and add some quick environment checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed May 27, 2021
1 parent 82019cc commit 67fb1ba
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
53 changes: 49 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<docker.image.prefix>openmrs</docker.image.prefix>
<elasticsearch.version>7.13.0</elasticsearch.version>
<xmlunit.version>2.8.2</xmlunit.version>
<maven.frontend.version>1.11.0</maven.frontend.version>
<maven.frontend.version>1.11.3</maven.frontend.version>
</properties>

<build>
Expand All @@ -114,6 +114,53 @@
</image>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.9</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-dev-or-prod</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireActiveProfile>
<profiles>development,production</profiles>
<all>false</all>
</requireActiveProfile>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-java-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
Expand Down Expand Up @@ -146,7 +193,7 @@
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.3.2</version>
<version>1.6.2</version>
<configuration>
<groups>javax, java, *</groups>
<removeUnused>true</removeUnused>
Expand Down Expand Up @@ -210,7 +257,6 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${maven.frontend.version}</version>
<executions>
<execution>
<id>npm build</id>
Expand Down Expand Up @@ -239,7 +285,6 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${maven.frontend.version}</version>
<executions>
<execution>
<id>npm build</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void fetchExtraDetailsForEachVersion(AddOnToIndex toIndex, AddOnInfoAndVersions
try {
if (toIndex.getType() == AddOnType.OMOD) {
log.info("Fetching OMOD for {} {}", toIndex.getUid(), version.getVersion());
String configXml = fetchConfigXml(toIndex, version);
String configXml = fetchConfigXml(version);
if (configXml == null) {
throw new IllegalArgumentException("No config.xml file in " + version.getDownloadUri());
} else {
Expand All @@ -157,7 +157,7 @@ void fetchExtraDetailsForEachVersion(AddOnToIndex toIndex, AddOnInfoAndVersions
}
}

String fetchConfigXml(AddOnToIndex addOnToIndex, AddOnVersion addOnVersion) throws IOException {
String fetchConfigXml(AddOnVersion addOnVersion) throws IOException {
log.info("fetching config.xml from {}", addOnVersion.getDownloadUri());
Resource resource = restTemplateBuilder.build().getForObject(addOnVersion.getDownloadUri(), Resource.class);
if (resource != null) {
Expand Down

0 comments on commit 67fb1ba

Please sign in to comment.