JDK-8268771 : javadoc -notimestamp option does not work on index.html
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 11
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2021-06-11
  • Updated: 2021-08-05
  • Resolved: 2021-06-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11.0.13-oracleFixed
Related Reports
Duplicate :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
When running javadoc for a project, it still adds a timestamp to index.html of the generated JavaDocs

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I've created a project for reproducible build from this guide
https://maven.apache.org/guides/mini/guide-reproducible-builds.html

Plugins:

maven-jar-plugin 3.2.0
maven-javadoc-plugin 3.3.0
maven-source-plugin 3.2.1
 

This project has only one class

/**
 * Hello
 */
public class Hello {
}
 

Then I check buildinfo via

./mvnw clean verify -e -DskipTests artifact:buildinfo -Dbuildinfo.ignoreJavadoc=false


sha512 is always the same for reproducible-build-1.0-SNAPSHOT.jar and reproducible-build-1.0-SNAPSHOT-sources.jar

But for reproducible-build-1.0-SNAPSHOT-javadoc.jar it changes after each build

Cause of this behaviour is index.html file. Also can be found in target/apidocs folder after build.
It contains the line like
`<!-- Generated by javadoc (11.0.11) on Fri Jun 11 17:35:15 MSK 2021 -->`
and timestamp is different after each build



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Timestamp should not be generated because of the setting in the maven plugin
ACTUAL -
Timestamp generated

---------- BEGIN SOURCE ----------
Here is the example

https://github.com/varpa89/reproducible-build
---------- END SOURCE ----------

FREQUENCY : always



Comments
Changeset: d522372d Author: Pavel Varchenko <varpa89@gmail.com> Committer: Christoph Langer <clanger@openjdk.org> Date: 2021-06-29 05:28:32 +0000 URL: https://git.openjdk.java.net/jdk11u/commit/d522372d05e9dbea79e719a864385fee8cc67d51
05-08-2021

Changeset: d522372d Author: Pavel Varchenko <varpa89@gmail.com> Committer: Christoph Langer <clanger@openjdk.org> Date: 2021-06-29 05:28:32 +0000 URL: https://git.openjdk.java.net/jdk11u-dev/commit/d522372d05e9dbea79e719a864385fee8cc67d51
29-06-2021

OK. The idea is to only backport the change from JDK-8215599 to file src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java. Thus, a JDK 11u-only change. That makes sense as full JDK-8215599 seems too invasive.
28-06-2021

Fix request (11u) on behalf of Pavel Varchenko: This timestamp issue has been fixed in JDK13 as part of JDK-8215599. It makes sense to repair it in JDK11 as well.
25-06-2021

The issue is being discussed at : https://issues.apache.org/jira/browse/MJAVADOC-681
15-06-2021

The issue is reproducible as javadoc puts timestamp inspite of using -notimestamp option in javadoc in index.html. The bug was fixed in JDK14+. JDK-8261784 is a duplicate bug.
15-06-2021

The error got resolved using double quotes with -Dbuildinfo.ignoreJavadoc=false on Windows. ./mvnw clean verify -e -DskipTests artifact:buildinfo "-Dbuildinfo.ignoreJavadoc=false"
15-06-2021

I am not able to reproduce the issue. Maven terminates with error: org.apache.maven.lifecycle.LifecyclePhaseNotFoundException: Unknown lifecycle phase ".ignoreJavadoc=false". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. =================================== Requested submitter to update the reproducer
14-06-2021