Skip to content

Commit ae22f8a

Browse files
cpovirkJimfs Team
authored andcommitted
Improve pom.xml files:
- Specify versions for plugins that we use so that we get a deterministic version, not the latest(?) at the time of the run. Compare cl/711438220. - I'm confused that I still see a warning for `maven-deploy-plugin`, which should be getting automatically disabled by `central-publishing-maven-plugin`, as apparently worked during the jimfs 1.3.1 release: ``` [WARNING] Ignoring incompatible plugin version 4.0.0-beta-2: The plugin org.apache.maven.plugins:maven-deploy-plugin:4.0.0-beta-2 requires Maven version 4.0.0-rc-2 [INFO] Latest version of plugin org.apache.maven.plugins:maven-deploy-plugin failed compatibility check [INFO] Looking for compatible RELEASE version of plugin org.apache.maven.plugins:maven-deploy-plugin [WARNING] Ignoring incompatible plugin version 4.0.0-beta-1: The plugin org.apache.maven.plugins:maven-deploy-plugin:4.0.0-beta-1 requires Maven version 4.0.0-beta-3 [INFO] Selected plugin org.apache.maven.plugins:maven-deploy-plugin:3.1.4 ``` Oddly, I do _not_ see such a warning when running the same command (`mvn clean install`) in Guava. - Add a warning that `maven-jar-plugin` configuration is not used because it's disabled by `maven-bundle-plugin`. - Compare a similar comment I added to the top-level `pom.xml` in cl/740019355 for Guava. - This warning becomes more important now that a section exists for `maven-jar-plugin` (to address the warnings mentioned above), but it would probably be safest to include, anyway, for anyone who might try to _add_ a `maven-jar-plugin` section. - While in the area, sort our plugins by name. - For Guava, chaorenl's cl/715960471 not only set up sorting but also automated enforcement. That would be trickier for cases in which we import PRs (b/411381570), so I haven't set it up here yet. - Always use the ID "`attach-javadocs`" for `maven-javadoc-plugin`. Until now, we were mising [`attach-javadocs`](https://github.com/google/jimfs/blob/bc03e931a923a633dbb3c6c37f951706c7f20c2e/pom.xml#L236) and [`attach-docs`](https://github.com/google/jimfs/blob/bc03e931a923a633dbb3c6c37f951706c7f20c2e/jimfs/pom.xml#L93). That eliminates this warning: ``` [INFO] --- javadoc:3.12.0:jar (attach-javadocs) @ jimfs --- [WARNING] Javadoc Warnings [WARNING] warning: The code being documented uses packages in the unnamed module, but the packages defined in https://docs.oracle.com/en/java/javase/11/docs/api/ are in named modules. [WARNING] 1 warning [INFO] Building jar: /usr/local/google/home/cpovirk/clients/jimfs-orange/jimfs/jimfs/target/jimfs-HEAD-SNAPSHOT-javadoc.jar [INFO] [INFO] --- source:3.3.1:jar-no-fork (attach-sources) @ jimfs --- [INFO] Building jar: /usr/local/google/home/cpovirk/clients/jimfs-orange/jimfs/jimfs/target/jimfs-HEAD-SNAPSHOT-sources.jar [INFO] [INFO] --- javadoc:3.12.0:jar (attach-docs) @ jimfs --- [INFO] Building jar: /usr/local/google/home/cpovirk/clients/jimfs-orange/jimfs/jimfs/target/jimfs-HEAD-SNAPSHOT-javadoc.jar [WARNING] artifact com.google.jimfs:jimfs:javadoc:javadoc:HEAD-SNAPSHOT already attached, replace previous instance ``` - The ID `attach-javadocs` seems to be more common (though not universal!) across our projects, and it's [mentioned by the documentation](https://maven.apache.org/plugins/maven-javadoc-plugin/faq.html#:~:text=attach%2Djavadocs). - As best I can tell, there was no reason to specify the ID at all in the child POM, so I removed it there and fixed it in the parent. - Remove `post-integration-test` `phase` configuration for `maven-javadoc-plugin`. I don't think we have that set in any of our other projects. I think I recently removed a weird choice of `phase` in another project. - Promote some Java 8+ `-doclint` configuration from a profile to the default. We always build on Java 8+ nowadays, especially since we [dropped support for Java 7](https://github.com/google/jimfs/releases/tag/v1.3.0) a couple years back. RELNOTES=n/a PiperOrigin-RevId: 814204365
1 parent bc03e93 commit ae22f8a

File tree

2 files changed

+20
-45
lines changed

2 files changed

+20
-45
lines changed

jimfs/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@
8888
<configuration>
8989
<excludePackageNames>com.google.jimfs.internal</excludePackageNames>
9090
</configuration>
91-
<executions>
92-
<execution>
93-
<id>attach-docs</id>
94-
<phase>post-integration-test</phase>
95-
<goals>
96-
<goal>jar</goal>
97-
</goals>
98-
</execution>
99-
</executions>
10091
</plugin>
10192

10293
<plugin>

pom.xml

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,12 @@
151151
<version>3.14.1</version>
152152
</plugin>
153153
<plugin>
154-
<artifactId>maven-source-plugin</artifactId>
155-
<version>3.3.1</version>
154+
<artifactId>maven-gpg-plugin</artifactId>
155+
<version>3.2.8</version>
156+
</plugin>
157+
<plugin>
158+
<artifactId>maven-install-plugin</artifactId>
159+
<version>3.1.4</version>
156160
</plugin>
157161
<plugin>
158162
<artifactId>maven-javadoc-plugin</artifactId>
@@ -169,11 +173,23 @@
169173
<link>https://unicode-org.github.io/icu-docs/apidoc/released/icu4j</link>
170174
<link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>
171175
</links>
176+
<additionalOptions>
177+
<additionalOption>-Xdoclint:none</additionalOption>
178+
</additionalOptions>
172179
</configuration>
173180
</plugin>
174181
<plugin>
175-
<artifactId>maven-gpg-plugin</artifactId>
176-
<version>3.2.8</version>
182+
<!-- Warning: jimfs uses maven-bundle-plugin, so any configuration for maven-jar-plugin is likely to have no effect. We include this here only to silence warnings that appear when Maven still tries to look up a version number for maven-jar-plugin at then picks an incompatible version (like a beta release of maven-jar-plugin 4.0.0 under Maven 3). -->
183+
<artifactId>maven-jar-plugin</artifactId>
184+
<version>3.4.2</version>
185+
</plugin>
186+
<plugin>
187+
<artifactId>maven-resources-plugin</artifactId>
188+
<version>3.3.1</version>
189+
</plugin>
190+
<plugin>
191+
<artifactId>maven-source-plugin</artifactId>
192+
<version>3.3.1</version>
177193
</plugin>
178194
<plugin>
179195
<artifactId>maven-surefire-plugin</artifactId>
@@ -263,38 +279,6 @@
263279
</build>
264280

265281
<profiles>
266-
<profile>
267-
<id>jdk8-plus</id>
268-
<activation>
269-
<jdk>[1.8,)</jdk>
270-
</activation>
271-
<!-- Disable HTML checking in doclint under JDK 8 and higher -->
272-
<reporting>
273-
<plugins>
274-
<plugin>
275-
<artifactId>maven-javadoc-plugin</artifactId>
276-
<configuration>
277-
<additionalOptions>
278-
<additionalOption>-Xdoclint:none</additionalOption>
279-
</additionalOptions>
280-
</configuration>
281-
</plugin>
282-
</plugins>
283-
</reporting>
284-
<build>
285-
<plugins>
286-
<plugin>
287-
<artifactId>maven-javadoc-plugin</artifactId>
288-
<configuration>
289-
<additionalOptions>
290-
<additionalOption>-Xdoclint:none</additionalOption>
291-
</additionalOptions>
292-
</configuration>
293-
</plugin>
294-
</plugins>
295-
</build>
296-
</profile>
297-
298282
<profile>
299283
<id>before-jdk17</id>
300284
<activation>

0 commit comments

Comments
 (0)