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>
</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>
</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>
</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>
</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>
<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="^(<!-- Generated by javadoc ).* (-->)$"/>
+ <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>