Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-53788] - Add profile to workaround javadoc crash on JDK 11.0.2 #173

Merged

Conversation

batmat
Copy link
Member

@batmat batmat commented Mar 8, 2019

Cf. for details https://bugs.openjdk.java.net/browse/JDK-8212233

Seen among many repos these days.
Known already to be blocking

cc @jenkinsci/java11-support

Deployed as 3.40-20190308.114139-1. Demonstration of the fix upcoming.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix for https://issues.jenkins-ci.org/browse/JENKINS-53788 . Would be nice to also ignore previous JDK versions, but profiles do not easily support it

@oleg-nenashev oleg-nenashev changed the title Add profile to workaround javadoc crash on JDK 11.0.2 [JENKINS-53788] - Add profile to workaround javadoc crash on JDK 11.0.2 Mar 8, 2019
@batmat
Copy link
Member Author

batmat commented Mar 8, 2019

Not sure this is the same actually, the error I'm seeing in a few places is visible on this build for instance.

[INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @ workflow-job ---
[INFO] 
1 error
7 warnings
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:51 min
[INFO] Finished at: 2019-03-07T22:37:08Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project workflow-job: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @param for context
[ERROR]         public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
[ERROR]                                                     ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @return
[ERROR]         public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
[ERROR]                                                     ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @param for acl
[ERROR]     public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
[ERROR]                         ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @return
[ERROR]     public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
[ERROR]                         ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java:711: warning: no @return
[ERROR]     public ListenableFuture<FlowExecution> getExecutionPromise() {
[ERROR]                                            ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @return
[ERROR]     public HttpResponse doDot() throws IOException {
[ERROR]                         ^
[ERROR] /home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @throws for java.io.IOException
[ERROR]     public HttpResponse doDot() throws IOException {
[ERROR]                         ^
[ERROR] 
[ERROR] Command line was: /home/jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2/bin/javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/target/apidocs' dir.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project workflow-job: MavenReportException: Error while generating Javadoc: 
Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @param for context
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @return
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @param for acl
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @return
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java:711: warning: no @return
    public ListenableFuture<FlowExecution> getExecutionPromise() {
                                           ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @return
    public HttpResponse doDot() throws IOException {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @throws for java.io.IOException
    public HttpResponse doDot() throws IOException {
                        ^

Command line was: /home/jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2/bin/javadoc @options @packages

Refer to the generated Javadoc files in '/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/target/apidocs' dir.

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: MavenReportException: Error while generating Javadoc: 
Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @param for context
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @return
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @param for acl
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @return
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java:711: warning: no @return
    public ListenableFuture<FlowExecution> getExecutionPromise() {
                                           ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @return
    public HttpResponse doDot() throws IOException {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @throws for java.io.IOException
    public HttpResponse doDot() throws IOException {
                        ^

Command line was: /home/jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2/bin/javadoc @options @packages

Refer to the generated Javadoc files in '/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/target/apidocs' dir.

    at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.failOnError (AbstractJavadocMojo.java:6202)
    at org.apache.maven.plugins.javadoc.JavadocJar.doExecute (JavadocJar.java:194)
    at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.execute (AbstractJavadocMojo.java:1912)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.reporting.MavenReportException: 
Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @param for context
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java:707: warning: no @return
        public Collection<FlowDefinitionDescriptor> getDefinitionDescriptors(WorkflowJob context) {
                                                    ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @param for acl
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJobProperty.java:40: warning: no @return
    public @Nonnull ACL decorateACL(@Nonnull ACL acl) {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java:711: warning: no @return
    public ListenableFuture<FlowExecution> getExecutionPromise() {
                                           ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @return
    public HttpResponse doDot() throws IOException {
                        ^
/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/src/main/java/org/jenkinsci/plugins/workflow/job/views/GraphVizAction.java:73: warning: no @throws for java.io.IOException
    public HttpResponse doDot() throws IOException {
                        ^

Command line was: /home/jenkins/tools/hudson.model.JDK/jdk11/jdk-11.0.2/bin/javadoc @options @packages

Refer to the generated Javadoc files in '/home/jenkins/workspace/ugins_workflow-job-plugin_PR-126/target/apidocs' dir.

    at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeJavadocCommandLine (AbstractJavadocMojo.java:5298)
    at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.executeReport (AbstractJavadocMojo.java:2134)
    at org.apache.maven.plugins.javadoc.JavadocJar.doExecute (JavadocJar.java:190)
    at org.apache.maven.plugins.javadoc.AbstractJavadocMojo.execute (AbstractJavadocMojo.java:1912)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[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
script returned exit code 1

pom.xml Outdated Show resolved Hide resolved
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>${java.level}</source>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not get it. Should this not just be the default?

diff --git a/pom.xml b/pom.xml
index 1fc3cdd..e44fcef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -379,6 +379,7 @@
           <artifactId>maven-javadoc-plugin</artifactId>
           <version>3.0.1</version>
           <configuration>
+            <source>${java.level}</source>
             <quiet>true</quiet>
             <links>
               <link>http://javadoc.jenkins.io/</link>

Copy link
Member Author

@batmat batmat Mar 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently only needed, and ever was, on JDK 11.0.2. It started failing in CI recently once the JDK was bumped from 11.0.1 to 11.0.2, and this is deemed fixed in JDK 11.0.3, so I don't think it should be needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that builds might have worked without this is interesting but my point is that this setting should have been configured on this mojo in all cases from the start, and that this was forgotten was only discovered thanks to this bug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the evaluation by Jonathan Gibbons:

If this really is a JDK8-era program, use the javadoc option --source 8 or --release 8.

@batmat batmat force-pushed the workaround-javadoc-crash-jdk-11.0.2 branch from 256aa39 to 4081a4d Compare March 8, 2019 14:30
@batmat batmat merged commit 0c705d5 into jenkinsci:master Mar 8, 2019
@batmat
Copy link
Member Author

batmat commented Mar 8, 2019

Released as 3.40

@batmat batmat deleted the workaround-javadoc-crash-jdk-11.0.2 branch March 8, 2019 16:24
batmat added a commit to batmat/buildtriggerbadge-plugin that referenced this pull request Mar 21, 2019
batmat added a commit to batmat/workflow-support-plugin that referenced this pull request Mar 27, 2019
batmat added a commit to batmat/aws-global-configuration-plugin that referenced this pull request Mar 27, 2019
* will fix the javadoc issue, cf. jenkinsci/plugin-pom#173
* bumping to more recent powermock and mockito to be Java 11 compatible
batmat added a commit to batmat/cctray-xml-plugin that referenced this pull request Apr 5, 2019
batmat added a commit to batmat/workflow-support-plugin that referenced this pull request Apr 11, 2019
Picking up jenkinsci/plugin-pom#173
Also fix actual Javadoc error on JDK 11: <tt> is not allowed anymore
batmat added a commit to batmat/workflow-support-plugin that referenced this pull request Apr 11, 2019
Picking up jenkinsci/plugin-pom#173
Also fix actual Javadoc error on JDK 11: <tt> is not allowed anymore
v1v added a commit to v1v/display-url-api-plugin that referenced this pull request Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants