[BUILD-195] Disable doclint for javadoc (Cannot build javadoc of main on java 8) Created: 13/Mar/15  Updated: 07/May/15  Resolved: 07/May/15

Status: Closed
Project: Build
Component/s: None
Affects Version/s: None
Fix Version/s: POMs 31

Type: Improvement Priority: Neutral
Reporter: Mikaël Geljić Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File main-release-perform-failure-javadoc.txt    
Issue Links:
relation
is related to BUILD-198 Use Animal Sniffer to make sure we do... Closed
is related to BUILD-200 Introduce asciidoc for Javadoc Closed
is related to BUILD-209 Update javadoc plugin to 2.10.3 Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Cannot release main on java 8.
mvn release:prepare passes fine
mvn release:perform fails on maven javadoc plugin

I could reproduce that twice in a row.
Then I switched to Java 7 and could release:perform successfully.

[INFO] Generating /Users/mika/Work/magnolia/checkout/magnolia_main/target/checkout/magnolia-core/target/apidocs/overview-summary.html...
[INFO] Generating /Users/mika/Work/magnolia/checkout/magnolia_main/target/checkout/magnolia-core/target/apidocs/help-doc.html...
[INFO] 100 errors
[INFO] 100 warnings
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Reactor Summary:
[INFO] [INFO] 
[INFO] [INFO] Magnolia Main Project (Parent) ..................... SUCCESS [  3.709 s]
[INFO] [INFO] Magnolia Core ...................................... FAILURE [02:02 min]
[INFO] [INFO] Magnolia Configuration Framework ................... SKIPPED
[INFO] [INFO] Magnolia JAAS ...................................... SKIPPED
[INFO] [INFO] Magnolia Internationalization Framework ............ SKIPPED
[INFO] [INFO] Magnolia Rendering ................................. SKIPPED
[INFO] [INFO] Magnolia Templating ................................ SKIPPED
[INFO] [INFO] Magnolia Templating for JSP ........................ SKIPPED
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 02:06 min
[INFO] [INFO] Finished at: 2015-03-13T08:55:08+01:00
[INFO] [INFO] Final Memory: 53M/197M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.1:jar (attach-javadocs) on project magnolia-core: MavenReportException: Error while creating archive:
[INFO] [ERROR] Exit code: 1 - /Users/mika/Work/magnolia/checkout/magnolia_main/target/checkout/magnolia-core/src/main/java/info/magnolia/audit/AuditLoggingManager.java:93: warning: no @return
[INFO] [ERROR] public boolean isAuditLoggingActive() {
[INFO] [ERROR] ^
[INFO] [ERROR] /Users/mika/Work/magnolia/checkout/magnolia_main/target/checkout/magnolia-core/src/main/java/info/magnolia/audit/AuditLoggingUtil.java:68: warning: no @param for action
[INFO] [ERROR] public static void log(String action, String workspaceName, ItemType nodeType, String nodePath) {
[INFO] [ERROR] ^
(...)
[INFO] [ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/../bin/javadoc @options @packages
[INFO] [ERROR] 
[INFO] [ERROR] Refer to the generated Javadoc files in '/Users/mika/Work/magnolia/checkout/magnolia_main/target/checkout/magnolia-core/target/apidocs' dir.
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR] 
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR] 
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] [ERROR] 
[INFO] [ERROR] After correcting the problems, you can resume the build with the command
[INFO] [ERROR]   mvn <goals> -rf :magnolia-core


 Comments   
Comment by Pete Ryland [ 13/Mar/15 ]

doclint is turned on by default in java8. According to http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javadoc.html#BEJEFABE and http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#additionalparam, you can fix this by putting this in your pom:

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <configuration>
      <additionalparam>-Xdoclint:none</additionalparam>
    </configuration>
  </plugin>
</plugins>
Comment by Pete Ryland [ 13/Mar/15 ]

Alternatively, you can leave doclint turned on and fix the javadoc comments.

Comment by Magnolia International [ 13/Mar/15 ]

For now, we really need to make with build with Java 7 anyway, so I'm glad this happens.
In future, we can

  • use Animal Sniffer. This would let us build with Java 8 while ensuring we don't accidentally introduce usages of APIs that don't exist in Java 7.
  • fix Javadoc comments. But at that point, I'd rather move to using something like asciidoc-for-javadoc (https://github.com/asciidoctor/asciidoclet).

Moving this issue to the BUILD project, because this is something we'll fix in the parent poms.

Comment by Magnolia International [ 18/Mar/15 ]

Asciidoclet currently does not do doclint. If we use Asciidoclet, we do get a bunch of warnings, which is better than nothing, but I'd like options to enforce correctness.
See https://github.com/asciidoctor/asciidoclet/issues/18

Comment by Philip Mundt [ 07/May/15 ]

Reopening issue due to problems with Java 1.7:

When using Java 1.8 mvn javadoc:javadoc works like a charm.
When using Java 1.7 mvn javadoc:javadoc results in:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc (default-cli) on project magnolia-site: An error has occurred in JavaDocs report generation:
[ERROR] Exit code: 1 - javadoc: error - invalid flag: -Xdoclint:none
[ERROR]
[ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/../bin/javadoc @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in '/Users/prm/Code_Magnolia/git/modules/site/magnolia-site/target/site/apidocs' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :magnolia-site
Comment by Magnolia International [ 07/May/15 ]

Moved the <additionalparam> into a profile enabled when running JDK8+.
Additionally introduced a <javadocDoclint> property set to none by default, which will allow modules to enable doclint selectively.

Generated at Sun Feb 11 23:39:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.