Skip to content

Commit

Permalink
Simplify disabling plugins for integration test modules
Browse files Browse the repository at this point in the history
Defines properties in the parent POM which determine whether the plugins
should be skipped, and then sets the properties in the Maven modules.
  • Loading branch information
Marcono1234 committed May 25, 2024
1 parent 6fcde5f commit 1ef331c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 201 deletions.
18 changes: 3 additions & 15 deletions extras/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<!-- Make the build reproducible, see root `pom.xml` -->
<!-- This is duplicated here because that is recommended by `artifact:check-buildplan` -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>

<!-- Overwrite property from parent; this module is currently not deployed -->
<gson.isInternalModule>true</gson.isInternalModule>
</properties>

<licenses>
Expand Down Expand Up @@ -64,21 +67,6 @@
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Currently not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<developers>
<developer>
<name>Inderjeet Singh</name>
Expand Down
49 changes: 3 additions & 46 deletions graal-native-image-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -26,14 +25,13 @@
<name>Test: GraalVM Native Image</name>

<properties>
<!-- Make the build reproducible, see root `pom.xml` -->
<!-- This is duplicated here because that is recommended by `artifact:check-buildplan` -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>

<!-- GraalVM is JDK >= 17, however for build with regular JDK these tests
are also executed with JDK 11, so for them exclude JDK 17 specific tests -->
<maven.compiler.testRelease>11</maven.compiler.testRelease>
<excludeTestCompilation>**/Java17*</excludeTestCompilation>

<!-- Overwrite property from parent -->
<gson.isTestModule>true</gson.isTestModule>
</properties>

<dependencies>
Expand Down Expand Up @@ -64,22 +62,6 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check API -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check used classes -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -88,31 +70,6 @@
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<!-- This module has no 'main' source code, so no JAR is created which could be installed;
see maven-jar-plugin configuration above -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down
61 changes: 2 additions & 59 deletions jpms-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.testRelease>${maven.compiler.release}</maven.compiler.testRelease>

<!-- Make the build reproducible, see root `pom.xml` -->
<!-- This is duplicated here because that is recommended by `artifact:check-buildplan` -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>
<!-- Overwrite property from parent -->
<gson.isTestModule>true</gson.isTestModule>
</properties>

<dependencies>
Expand All @@ -51,60 +50,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check API -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check used classes -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<!-- This module has no 'main' source code; skip creating JAR and avoid warning on console -->
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<!-- This module has no 'main' source code, so no JAR is created which could be installed;
see maven-jar-plugin configuration above -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
36 changes: 2 additions & 34 deletions metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
<description>Performance Metrics for Google Gson library</description>

<properties>
<!-- Make the build reproducible, see root `pom.xml` -->
<!-- This is duplicated here because that is recommended by `artifact:check-buildplan` -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>
<!-- Overwrite property from parent -->
<gson.isTestModule>true</gson.isTestModule>
</properties>

<licenses>
Expand Down Expand Up @@ -63,37 +62,6 @@
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check API -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check used classes -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<developers>
<developer>
<name>Inderjeet Singh</name>
Expand Down
29 changes: 29 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
<!-- Make the build reproducible, see https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
<!-- Automatically updated by Maven Release Plugin -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>

<!-- These properties are to be overwritten by the Maven modules -->
<!-- Whether this module is an integration test module -->
<gson.isTestModule>false</gson.isTestModule>
<!-- Whether this module is internal and currently not deployed -->
<gson.isInternalModule>${gson.isTestModule}</gson.isInternalModule>
</properties>

<!-- These attributes specify that the URLs should be inherited by the modules as is, to avoid constructing
Expand Down Expand Up @@ -304,6 +310,8 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<skip>${gson.isTestModule}</skip>

<!-- Specify newer JDK as target to allow linking to newer Java API, and to generate
module overview in Javadoc for Gson's module descriptor -->
<release>11</release>
Expand Down Expand Up @@ -341,16 +349,33 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>${gson.isTestModule}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<skipSource>${gson.isTestModule}</skipSource>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<configuration>
<skip>${gson.isTestModule}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>${gson.isInternalModule}</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -445,6 +470,8 @@
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.21.1</version>
<configuration>
<skip>${gson.isTestModule}</skip>

<oldVersion>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -486,6 +513,8 @@
<goal>check</goal>
</goals>
<configuration>
<skip>${gson.isTestModule}</skip>

<signature>
<!-- Note: In case Android compatibility impedes Gson development too much in the
future, could consider switching to https://github.com/open-toast/gummy-bears
Expand Down
17 changes: 3 additions & 14 deletions proto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.google.code.gson</groupId>
Expand All @@ -33,6 +32,9 @@
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>

<protobufVersion>4.26.1</protobufVersion>

<!-- Overwrite property from parent; this module is currently not deployed -->
<gson.isInternalModule>true</gson.isInternalModule>
</properties>

<licenses>
Expand Down Expand Up @@ -102,19 +104,6 @@
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<developers>
Expand Down
36 changes: 3 additions & 33 deletions shrinker-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
<name>Test: Code shrinking (ProGuard / R8)</name>

<properties>
<!-- Make the build reproducible, see root `pom.xml` -->
<!-- This is duplicated here because that is recommended by `artifact:check-buildplan` -->
<project.build.outputTimestamp>2024-05-19T18:54:10Z</project.build.outputTimestamp>

<maven.compiler.release>8</maven.compiler.release>

<!-- Overwrite property from parent -->
<gson.isTestModule>true</gson.isTestModule>
</properties>

<pluginRepositories>
Expand Down Expand Up @@ -61,35 +60,6 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check API -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<!-- This module is not supposed to be consumed as library, so no need to check used classes -->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<!-- Not deployed -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<!-- Process JAR with ProGuard -->
<plugin>
Expand Down

0 comments on commit 1ef331c

Please sign in to comment.