Browse Source

Use Antrun plugin to eliminate javadoc version number in HTML

This is the one issue that cannot be solved regarding reproducible
builds by setting javadoc options, because that header comment is
hard-coded into the JDK with no option to avoid it. I just created an
OpenJDK issue (internal review ID 9076583, not published yet) for it,
but that does not help us today.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_21_2
Alexander Kriegisch 2 months ago
parent
commit
09aa15b528
5 changed files with 91 additions and 0 deletions
  1. 13
    0
      aspectjmatcher/pom.xml
  2. 13
    0
      aspectjrt/pom.xml
  3. 13
    0
      aspectjtools/pom.xml
  4. 13
    0
      aspectjweaver/pom.xml
  5. 39
    0
      pom.xml

+ 13
- 0
aspectjmatcher/pom.xml View File

@@ -199,6 +199,19 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Remove javadoc version number from HTML comment to keep website diffs small -->
<execution>
<id>filter-javadocs</id>
<!-- Override default phase 'none' from parent -->
<phase>package</phase>
</execution>
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>

+ 13
- 0
aspectjrt/pom.xml View File

@@ -197,6 +197,19 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Remove javadoc version number from HTML comment to keep website diffs small -->
<execution>
<id>filter-javadocs</id>
<!-- Override default phase 'none' from parent -->
<phase>package</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>

+ 13
- 0
aspectjtools/pom.xml View File

@@ -271,6 +271,19 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Remove javadoc version number from HTML comment to keep website diffs small -->
<execution>
<id>filter-javadocs</id>
<!-- Override default phase 'none' from parent -->
<phase>package</phase>
</execution>
</executions>
</plugin>

<!-- Caveat: Attaching the flattened POM needs packaging=jar, so do not use packaging=pom for this module -->
<plugin>
<groupId>org.codehaus.mojo</groupId>

+ 13
- 0
aspectjweaver/pom.xml View File

@@ -272,6 +272,19 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Remove javadoc version number from HTML comment to keep website diffs small -->
<execution>
<id>filter-javadocs</id>
<!-- Override default phase 'none' from parent -->
<phase>package</phase>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>

+ 39
- 0
pom.xml View File

@@ -465,6 +465,45 @@
<windowtitle>${project.name} API</windowtitle>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<!--
Remove javadoc version number from HTML comment to keep website diffs small.

Attention: This has no effect on javadocs generated by the 'jar' goal, because they are archived while
Maven Javadoc runs, i.e. before this plugin execution kicks in. However, it cleans the javadocs before
Maven Resources copies them to aj-build/dist/docs/doc. I.e., they will be clean on the website, if copied
from that folder, and also in the installer.

TODO: In the future, maybe this execution or the whole Antrun plugin can go away, after a JDK feature
request I just created (internal review ID 9076583) has been implemented and back-ported into all JDK
versions we support for javadoc generation. But if that ever happens, it might take a while.
-->
<execution>
<id>filter-javadocs</id>
<!-- Override phase to 'package' in modules which need to filter javadocs -->
<phase>none</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- See https://ant.apache.org/manual/Tasks/replaceregexp.html -->
<replaceregexp byline="true">
<regexp pattern="^(&lt;!-- Generated by javadoc ).* (--&gt;)$"/>
<substitution expression="\1\2"/>
<fileset dir="${project.build.directory}/apidocs">
<include name="**/*.html"/>
</fileset>
</replaceregexp>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>

Loading…
Cancel
Save