Skip to content

Commit

Permalink
Choose our own versions of plugins instead of inheriting from [deprec…
Browse files Browse the repository at this point in the history
…ated](https://github.com/sonatype/oss-parents) `oss-parent`.

Results:

- no more puzzling need to doubly specify the version of a few of our plugins: I now see that the `oss-parent` values were overriding our `pluginManagement` values.
- no more GPG problems when using our standard release script

RELNOTES=n/a
PiperOrigin-RevId: 492304151
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Dec 1, 2022
1 parent 321aba7 commit 8201580
Showing 1 changed file with 55 additions and 32 deletions.
87 changes: 55 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>com.google.truth</groupId>
<artifactId>truth-parent</artifactId>
<version>HEAD-SNAPSHOT</version>
Expand All @@ -18,10 +13,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Properties for plugins for which pluginManagement hasn't been working for us. -->
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>

<!-- Properties for multiple-artifact deps. -->
<auto-value.version>1.10</auto-value.version>
<!--
Expand Down Expand Up @@ -217,6 +208,18 @@
<connection>scm:git:[email protected]:google/truth.git</connection>
<url>scm:git:[email protected]:google/truth.git</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
Expand All @@ -233,7 +236,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<version>3.4.1</version>
<configuration>
<additionalOptions>
<additionalOption>--frames</additionalOption>
Expand Down Expand Up @@ -300,13 +303,17 @@
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<version>3.1.0</version>
<executions>
<execution>
<id>enforce</id>
Expand Down Expand Up @@ -343,26 +350,42 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!--
Force a version >2.7 for this parent project. If we use the current
default of 2.7, Maven ignores this parent project's configuration when
running maven-javadoc-plugin in children during releases.
-->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<!--
Similar. Without this, Maven tries to run maven-enforcer-plugin 1.0,
and it fails to construct an instance of the rule class, apparently
because of a mismatch between the new Maven APIs and the old Enforcer
APIs.
-->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals><goal>sign</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals><goal>jar</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-docs</id>
<goals><goal>jar</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 8201580

Please sign in to comment.