Skip to content

Commit

Permalink
Stop setting up and trying to inherit Javadoc from the JDK.
Browse files Browse the repository at this point in the history
Drops the JDK source steps involved with Javadoc builds, as suggested in #7089. There will be some build warnings related to Javadoc until subsequent PRs are merged.

Signed-off-by: Sam Gammon <[email protected]>

Gives up on the "inherting" half of #6790.

Fixes #7092

RELNOTES=n/a
PiperOrigin-RevId: 614693592
  • Loading branch information
sgammon authored and Google Java Core Libraries committed Mar 11, 2024
1 parent 8b9387e commit d70366d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 148 deletions.
74 changes: 0 additions & 74 deletions android/guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</dependency>
<!-- TODO(cpovirk): does this comment belong on the <dependency> in <profiles>? -->
<!-- TODO(cpovirk): want this only for dependency plugin but seems not to work there? Maven runs without failure, but the resulting Javadoc is missing the hoped-for inherited text -->
</dependencies>
<build>
<resources>
Expand Down Expand Up @@ -106,36 +104,13 @@
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- TODO(cpovirk): include JDK sources when building testlib doc, too -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-jdk-sources</id>
<phase>generate-sources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>srczip</includeArtifactIds>
<outputDirectory>${project.build.directory}/jdk-sources</outputDirectory>
<silent>false</silent>
<!-- Exclude module-info files (since we're using -source 8 to avoid other modules problems) and FileDescriptor (which uses a language feature not available in Java 8). -->
<excludes>**/module-info.java,**/java/io/FileDescriptor.java</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- TODO(cpovirk): Move this to the parent after making jdk-sources available there. -->
<!-- TODO(cpovirk): can we use includeDependencySources and a local com.oracle.java:jdk-lib:noversion:sources instead of all this unzipping and manual sourcepath modification? -->
<!-- (We need JDK *sources*, not just -link, so that {@inheritDoc} works.) -->
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/jdk-sources</sourcepath>

<!-- Passing `-subpackages com.google.common` breaks things, so we explicitly exclude everything else instead. -->
<!-- excludePackageNames requires specification of packages separately from "all subpackages".
https://issues.apache.org/jira/browse/MJAVADOC-584 -->
Expand Down Expand Up @@ -247,53 +222,4 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>srczip-parent</id>
<activation>
<file>
<exists>${java.home}/../src.zip</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>jdk</groupId>
<artifactId>srczip</artifactId>
<version>999</version>
<scope>system</scope>
<systemPath>${java.home}/../src.zip</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>srczip-lib</id>
<activation>
<file>
<exists>${java.home}/lib/src.zip</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>jdk</groupId>
<artifactId>srczip</artifactId>
<version>999</version>
<scope>system</scope>
<systemPath>${java.home}/lib/src.zip</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- We need to point at the java.base subdirectory because Maven appears to assume that package foo.bar is located in foo/bar and not java.base/foo/bar when translating excludePackageNames into filenames to pass to javadoc. (Note that manually passing -exclude to javadoc appears to possibly not work at all for java.* types??) Also, referring only to java.base avoids a lot of other sources. -->
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/jdk-sources/java.base</sourcepath>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
74 changes: 0 additions & 74 deletions guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</dependency>
<!-- TODO(cpovirk): does this comment belong on the <dependency> in <profiles>? -->
<!-- TODO(cpovirk): want this only for dependency plugin but seems not to work there? Maven runs without failure, but the resulting Javadoc is missing the hoped-for inherited text -->
</dependencies>
<build>
<resources>
Expand Down Expand Up @@ -106,36 +104,13 @@
<plugin>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- TODO(cpovirk): include JDK sources when building testlib doc, too -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-jdk-sources</id>
<phase>generate-sources</phase>
<goals><goal>unpack-dependencies</goal></goals>
<configuration>
<includeArtifactIds>srczip</includeArtifactIds>
<outputDirectory>${project.build.directory}/jdk-sources</outputDirectory>
<silent>false</silent>
<!-- Exclude module-info files (since we're using -source 8 to avoid other modules problems) and FileDescriptor (which uses a language feature not available in Java 8). -->
<excludes>**/module-info.java,**/java/io/FileDescriptor.java</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- TODO(cpovirk): Move this to the parent after making jdk-sources available there. -->
<!-- TODO(cpovirk): can we use includeDependencySources and a local com.oracle.java:jdk-lib:noversion:sources instead of all this unzipping and manual sourcepath modification? -->
<!-- (We need JDK *sources*, not just -link, so that {@inheritDoc} works.) -->
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/jdk-sources</sourcepath>

<!-- Passing `-subpackages com.google.common` breaks things, so we explicitly exclude everything else instead. -->
<!-- excludePackageNames requires specification of packages separately from "all subpackages".
https://issues.apache.org/jira/browse/MJAVADOC-584 -->
Expand Down Expand Up @@ -247,53 +222,4 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>srczip-parent</id>
<activation>
<file>
<exists>${java.home}/../src.zip</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>jdk</groupId>
<artifactId>srczip</artifactId>
<version>999</version>
<scope>system</scope>
<systemPath>${java.home}/../src.zip</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>srczip-lib</id>
<activation>
<file>
<exists>${java.home}/lib/src.zip</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>jdk</groupId>
<artifactId>srczip</artifactId>
<version>999</version>
<scope>system</scope>
<systemPath>${java.home}/lib/src.zip</systemPath>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- We need to point at the java.base subdirectory because Maven appears to assume that package foo.bar is located in foo/bar and not java.base/foo/bar when translating excludePackageNames into filenames to pass to javadoc. (Note that manually passing -exclude to javadoc appears to possibly not work at all for java.* types??) Also, referring only to java.base avoids a lot of other sources. -->
<sourcepath>${project.build.sourceDirectory}:${project.build.directory}/jdk-sources/java.base</sourcepath>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit d70366d

Please sign in to comment.