Skip to content

Commit 9bd9eff

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Migrate to central-publishing-maven-plugin and off oss-parent.
I missed these files in cl/782079419 because I was looking for... maybe `maven-deploy-plugin`? I forget, but apparently I was looking for _something_ that these projects don't declare as a plugin. (They haven't need to declare the plugin because they were inheriting it from `oss-parent`.) Then this seemed like a good time to finally migrate the rest of our projects off `oss-parent`. See previous changes like cl/350197931. I've made the same changes here. I've marginally improved upon both the CLs I mentioned before: - I omit `<groupId>org.apache.maven.plugins</groupId>`, since that is the default. - I omit `<publishingServerId>central</publishingServerId>`, since that is the default. Also, I was careful not to copy `<failOnError>false</failOnError>` from `auto/value` and `auto/factory`. We don't seem to use it in our other projects, and it wasn't part of `oss-parent`. Also, I omitted a `maven-javadoc-plugin` entry in `guava_beta_checker`, which already configured that plugin. I could totally believe that some part of this CL will break a release somewhere. I'm not sure we'll notice until we try to publish a release. But that would be only a lateral move from where we likely are now, since we already can't publish a release until we perform the OSSRH->Central migration. I could also totally believe that we could do things better here. Possible examples include: - Move at least `maven-source-plugin` and `maven-javadoc-plugin` out of the release profile and into the main configuration (similar to `maven-javadoc-plugin` in `guava_beta_checker`). Or, alternatively, remove them entirely. (But removing them might cause Maven to select whatever the latest release is, and that's not great. It might also use slightly different settings that we've chosen; I'm not sure.) - Omit the `sonatype-nexus-snapshots` configuration from projects that we don't publish snapshots for. - Write our own common parent POM, as we've contemplated before. RELNOTES=n/a PiperOrigin-RevId: 788538710
1 parent e3d7127 commit 9bd9eff

File tree

3 files changed

+118
-19
lines changed

3 files changed

+118
-19
lines changed

common/pom.xml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1919
<modelVersion>4.0.0</modelVersion>
2020

21-
<parent>
22-
<groupId>org.sonatype.oss</groupId>
23-
<artifactId>oss-parent</artifactId>
24-
<version>7</version>
25-
</parent>
26-
2721
<groupId>com.google.auto</groupId>
2822
<artifactId>auto-common</artifactId>
2923
<version>HEAD-SNAPSHOT</version>
@@ -64,6 +58,13 @@
6458
<url>http://www.google.com</url>
6559
</organization>
6660

61+
<distributionManagement>
62+
<snapshotRepository>
63+
<id>sonatype-nexus-snapshots</id>
64+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
65+
</snapshotRepository>
66+
</distributionManagement>
67+
6768
<dependencies>
6869
<dependency>
6970
<groupId>com.google.guava</groupId>
@@ -168,5 +169,56 @@
168169
</plugins>
169170
</build>
170171
</profile>
172+
173+
<profile>
174+
<id>sonatype-oss-release</id>
175+
<build>
176+
<plugins>
177+
<plugin>
178+
<artifactId>maven-source-plugin</artifactId>
179+
<version>3.3.1</version>
180+
<executions>
181+
<execution>
182+
<id>attach-sources</id>
183+
<goals>
184+
<goal>jar-no-fork</goal>
185+
</goals>
186+
</execution>
187+
</executions>
188+
</plugin>
189+
<plugin>
190+
<artifactId>maven-javadoc-plugin</artifactId>
191+
<version>3.11.2</version>
192+
<executions>
193+
<execution>
194+
<id>attach-javadocs</id>
195+
<goals>
196+
<goal>jar</goal>
197+
</goals>
198+
</execution>
199+
</executions>
200+
</plugin>
201+
<plugin>
202+
<artifactId>maven-gpg-plugin</artifactId>
203+
<version>3.2.8</version>
204+
<executions>
205+
<execution>
206+
<id>sign-artifacts</id>
207+
<phase>verify</phase>
208+
<goals>
209+
<goal>sign</goal>
210+
</goals>
211+
</execution>
212+
</executions>
213+
</plugin>
214+
<plugin>
215+
<groupId>org.sonatype.central</groupId>
216+
<artifactId>central-publishing-maven-plugin</artifactId>
217+
<version>0.8.0</version>
218+
<extensions>true</extensions>
219+
</plugin>
220+
</plugins>
221+
</build>
222+
</profile>
171223
</profiles>
172224
</project>

factory/src/it/functional/pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1919
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2020

21-
<!-- TODO(cpovirk): Remove parent entirely? -->
22-
<parent>
23-
<groupId>org.sonatype.oss</groupId>
24-
<artifactId>oss-parent</artifactId>
25-
<version>7</version>
26-
</parent>
27-
2821
<modelVersion>4.0.0</modelVersion>
2922
<groupId>com.google.auto.value.it.functional</groupId>
3023
<artifactId>functional</artifactId>

service/pom.xml

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1919
<modelVersion>4.0.0</modelVersion>
2020

21-
<parent>
22-
<groupId>org.sonatype.oss</groupId>
23-
<artifactId>oss-parent</artifactId>
24-
<version>7</version>
25-
</parent>
26-
2721
<groupId>com.google.auto.service</groupId>
2822
<artifactId>auto-service-aggregator</artifactId>
2923
<version>HEAD-SNAPSHOT</version>
@@ -70,6 +64,13 @@
7064
<module>processor</module>
7165
</modules>
7266

67+
<distributionManagement>
68+
<snapshotRepository>
69+
<id>sonatype-nexus-snapshots</id>
70+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
71+
</snapshotRepository>
72+
</distributionManagement>
73+
7374
<dependencyManagement>
7475
<dependencies>
7576
<!-- main dependencies -->
@@ -128,4 +129,57 @@
128129
</plugins>
129130
</pluginManagement>
130131
</build>
132+
133+
<profiles>
134+
<profile>
135+
<id>sonatype-oss-release</id>
136+
<build>
137+
<plugins>
138+
<plugin>
139+
<artifactId>maven-source-plugin</artifactId>
140+
<version>3.3.1</version>
141+
<executions>
142+
<execution>
143+
<id>attach-sources</id>
144+
<goals>
145+
<goal>jar-no-fork</goal>
146+
</goals>
147+
</execution>
148+
</executions>
149+
</plugin>
150+
<plugin>
151+
<artifactId>maven-javadoc-plugin</artifactId>
152+
<version>3.11.2</version>
153+
<executions>
154+
<execution>
155+
<id>attach-javadocs</id>
156+
<goals>
157+
<goal>jar</goal>
158+
</goals>
159+
</execution>
160+
</executions>
161+
</plugin>
162+
<plugin>
163+
<artifactId>maven-gpg-plugin</artifactId>
164+
<version>3.2.8</version>
165+
<executions>
166+
<execution>
167+
<id>sign-artifacts</id>
168+
<phase>verify</phase>
169+
<goals>
170+
<goal>sign</goal>
171+
</goals>
172+
</execution>
173+
</executions>
174+
</plugin>
175+
<plugin>
176+
<groupId>org.sonatype.central</groupId>
177+
<artifactId>central-publishing-maven-plugin</artifactId>
178+
<version>0.8.0</version>
179+
<extensions>true</extensions>
180+
</plugin>
181+
</plugins>
182+
</build>
183+
</profile>
184+
</profiles>
131185
</project>

0 commit comments

Comments
 (0)