You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/05/01 15:59:40 UTC

[GitHub] [maven-javadoc-plugin] rfscholte opened a new pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

rfscholte opened a new pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67


   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MJAVADOC) filed 
          for the change (usually before you start working on it).  Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without 
          pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[MJAVADOC-XXX] - Fixes bug in ApproximateQuantiles`,
          where you replace `MJAVADOC-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the 
          commit message.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean verify -Prun-its` to make sure basic checks pass. A more thorough check will 
          be performed on your pull request automatically.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] rfscholte closed pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
rfscholte closed pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] michael-o commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624547577



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -2954,8 +2959,18 @@ private void populateCompileArtifactMap( Map<String, Artifact> compileArtifactMa
      */
     private String getBottomText()
     {
-        int currentYear = Calendar.getInstance().get( Calendar.YEAR );
-        String year = String.valueOf( currentYear );
+        final String year;
+        String buildTime = project.getProperties().getProperty( "project.build.outputTimestamp" );
+        if ( buildTime != null )
+        {
+            year = String.valueOf( DateTimeFormatter.ISO_DATE_TIME.parse( buildTime ).get( ChronoField.YEAR ) );
+        }
+        else
+        {
+            getLog().debug( "Missing property project.build.outputTimestamp, using current year instead" );

Review comment:
       Since when did this plugin jump on Java 8?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] rfscholte commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624647376



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -922,9 +924,12 @@
      * Specifies the text to be placed at the bottom of each output file.<br/>
      * If you want to use html, you have to put it in a CDATA section, <br/>
      * e.g. <code>&lt;![CDATA[Copyright 2005, &lt;a href="http://www.mycompany.com">MyCompany, Inc.&lt;a>]]&gt;</code>
-     * <br/>
+     * <br>
+     * <strong>Note:<strong>If the project has the property <code>project.build.outputTimestamp</code>, its year will
+     * be used as {currentYear}. This way it is possible to generate reproducible javadoc jars.
+     * <br>
      * See <a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#bottom">bottom</a>.
-     * <br/>
+     * <br>

Review comment:
       It depends on the Java version. As the minimum is Java 8, it should be be HTML (I think v4)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] bmarwell commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
bmarwell commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624539285



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -2954,8 +2959,18 @@ private void populateCompileArtifactMap( Map<String, Artifact> compileArtifactMa
      */
     private String getBottomText()
     {
-        int currentYear = Calendar.getInstance().get( Calendar.YEAR );
-        String year = String.valueOf( currentYear );
+        final String year;
+        String buildTime = project.getProperties().getProperty( "project.build.outputTimestamp" );
+        if ( buildTime != null )
+        {
+            year = String.valueOf( DateTimeFormatter.ISO_DATE_TIME.parse( buildTime ).get( ChronoField.YEAR ) );
+        }
+        else
+        {
+            getLog().debug( "Missing property project.build.outputTimestamp, using current year instead" );

Review comment:
       "missing" sounds like a warning. Maybe instead use "property xyz is not set, using..."?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] ebourg commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r641321365



##########
File path: src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java
##########
@@ -28,6 +28,8 @@
 import java.net.URL;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoField;

Review comment:
       Unused imports?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] rfscholte commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624647199



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -2954,8 +2959,18 @@ private void populateCompileArtifactMap( Map<String, Artifact> compileArtifactMa
      */
     private String getBottomText()
     {
-        int currentYear = Calendar.getInstance().get( Calendar.YEAR );
-        String year = String.valueOf( currentYear );
+        final String year;
+        String buildTime = project.getProperties().getProperty( "project.build.outputTimestamp" );
+        if ( buildTime != null )
+        {
+            year = String.valueOf( DateTimeFormatter.ISO_DATE_TIME.parse( buildTime ).get( ChronoField.YEAR ) );
+        }
+        else
+        {
+            getLog().debug( "Missing property project.build.outputTimestamp, using current year instead" );

Review comment:
       @michael-o https://issues.apache.org/jira/browse/MJAVADOC-675
   @bmarwell Let me rephrase it by flipping the statements: if available ... otherwise ...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] michael-o commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624563073



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -922,9 +924,12 @@
      * Specifies the text to be placed at the bottom of each output file.<br/>
      * If you want to use html, you have to put it in a CDATA section, <br/>
      * e.g. <code>&lt;![CDATA[Copyright 2005, &lt;a href="http://www.mycompany.com">MyCompany, Inc.&lt;a>]]&gt;</code>
-     * <br/>
+     * <br>
+     * <strong>Note:<strong>If the project has the property <code>project.build.outputTimestamp</code>, its year will
+     * be used as {currentYear}. This way it is possible to generate reproducible javadoc jars.
+     * <br>
      * See <a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#bottom">bottom</a>.
-     * <br/>
+     * <br>

Review comment:
       Not really, HTML5. Javadoc will complain.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] rfscholte commented on pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
rfscholte commented on pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#issuecomment-834273272


   Merged with https://github.com/apache/maven-javadoc-plugin/commit/3926bd4cadaa6e4c49c7f973f04927602e384d40


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-javadoc-plugin] bmwiedemann commented on a change in pull request #67: [MJAVADOC-619] Maven Javadoc bottom claims copyright for future years

Posted by GitBox <gi...@apache.org>.
bmwiedemann commented on a change in pull request #67:
URL: https://github.com/apache/maven-javadoc-plugin/pull/67#discussion_r624562883



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -922,9 +924,12 @@
      * Specifies the text to be placed at the bottom of each output file.<br/>
      * If you want to use html, you have to put it in a CDATA section, <br/>
      * e.g. <code>&lt;![CDATA[Copyright 2005, &lt;a href="http://www.mycompany.com">MyCompany, Inc.&lt;a>]]&gt;</code>
-     * <br/>
+     * <br>
+     * <strong>Note:<strong>If the project has the property <code>project.build.outputTimestamp</code>, its year will
+     * be used as {currentYear}. This way it is possible to generate reproducible javadoc jars.
+     * <br>
      * See <a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#bottom">bottom</a>.
-     * <br/>
+     * <br>

Review comment:
       If this is XHTML, then `<br/>` is the correct way to write a standalone (unpaired) tag that is already closed. Same for the other two `<br>` above.
   In case of doubt, pass the rendered output to http://validator.w3.org/




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org