Skip to content

Commit

Permalink
Improve configuration validation setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruhanga committed Jan 15, 2024
1 parent bbbdaca commit 9ec6b74
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 41 deletions.
17 changes: 17 additions & 0 deletions base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
Expand Down
84 changes: 43 additions & 41 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,49 @@
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>copy-config</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/validator/configuration">
<fileset dir="${project.build.directory}/${project.build.directory}/${project.artifactId}-${project.version}/distro/**/initializer_config/**"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- hooking the OpenMRS config validation to the integration-test phase -->
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>validate-configurations</id>
<phase>integration-test</phase>
<goals>
<goal>validate-configurations</goal>
</goals>
<configuration>
<sourceDir>
${project.build.directory}/configuration</sourceDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>copy-config</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<copy todir="${project.build.directory}/validator/configuration">
<fileset dir="${project.build.directory}/${project.artifactId}-${project.version}/distro/configs/openmrs/initializer_config"/>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- hooking the OpenMRS config validation to the integration-test phase -->
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>validate-configurations</id>
<phase>integration-test</phase>
<goals>
<goal>validate-configurations</goal>
</goals>
<configuration>
<sourceDir>
${project.build.directory}/validator/configuration</sourceDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
Expand Down
17 changes: 17 additions & 0 deletions prod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
</dependency>
</dependencies>

<profiles>
<profile>
<id>validator</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.openmrs.maven.plugins</groupId>
<artifactId>openmrs-packager-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
Expand Down

0 comments on commit 9ec6b74

Please sign in to comment.