Skip to content

Commit 119bd9b

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Work around a bug in central-publishing-maven-plugin that causes us to skip publishing entirely for guava-android.
See google/auto#1965 (comment) and google/gson#2892 (comment). RELNOTES=n/a PiperOrigin-RevId: 808232109
1 parent 4c4f855 commit 119bd9b

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

android/guava-tests/pom.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,20 @@
9797
<plugin>
9898
<groupId>org.sonatype.central</groupId>
9999
<artifactId>central-publishing-maven-plugin</artifactId>
100-
<configuration>
101-
<skipPublishing>true</skipPublishing>
102-
</configuration>
100+
<!--
101+
We set `phase` to `none` instead of setting `skipPublishing` to `true`.
102+
We do so because the plugin does all its work in the final subproject for which it will have an execution.
103+
And, if the final subproject says to skip publishing, it skips *all* publishing.
104+
(`guava-tests` is the final subproject for `guava-android` but not for `guava-jre`, which has `guava-gwt` after it.
105+
So we could use `skipPublishing` in `guava-jre` if we wanted.)
106+
See https://github.com/google/gson/issues/2892#issuecomment-3272499409
107+
-->
108+
<executions>
109+
<execution>
110+
<id>injected-central-publishing</id>
111+
<phase>none</phase>
112+
</execution>
113+
</executions>
103114
</plugin>
104115
<plugin>
105116
<groupId>org.codehaus.mojo</groupId>

guava-tests/pom.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,20 @@
9797
<plugin>
9898
<groupId>org.sonatype.central</groupId>
9999
<artifactId>central-publishing-maven-plugin</artifactId>
100-
<configuration>
101-
<skipPublishing>true</skipPublishing>
102-
</configuration>
100+
<!--
101+
We set `phase` to `none` instead of setting `skipPublishing` to `true`.
102+
We do so because the plugin does all its work in the final subproject for which it will have an execution.
103+
And, if the final subproject says to skip publishing, it skips *all* publishing.
104+
(`guava-tests` is the final subproject for `guava-android` but not for `guava-jre`, which has `guava-gwt` after it.
105+
So we could use `skipPublishing` in `guava-jre` if we wanted.)
106+
See https://github.com/google/gson/issues/2892#issuecomment-3272499409
107+
-->
108+
<executions>
109+
<execution>
110+
<id>injected-central-publishing</id>
111+
<phase>none</phase>
112+
</execution>
113+
</executions>
103114
</plugin>
104115
<plugin>
105116
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)