Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32619

Javadoc link displays only documentation frame with no content

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      Javadoc Plugin 1.5

      Description

      When building a project in freestyle mode using Apache Maven 3.3.9 and creating the javadoc using the javadoc:javadoc top-level target, the Javadoc link appears on the project's dashboard, but when clicking it, only a blank Documentation frame appears without the content of the Javadoc.

      I should point out that the data IS there, since I opened the index.html file in my browser and it displayed perfectly.

      Attached is the result from clicking the Javadoc button and the Javadoc itself when launched via the index.html.

      Any help would be appreciated.

        Attachments

          Issue Links

            Activity

            bienstock Gad Maor created issue -
            Hide
            fastblitzer Christian Gnüchtel added a comment -

            I guess the reason is the new content security policy:
            https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy

            Quick and dirty solution:

            1. Go to Jenkins Script Console at https://my-jenkins-server/script
            2. Input

            System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

            3. Hit Run button

            Better solution:

            Read the article above and apply it

            Show
            fastblitzer Christian Gnüchtel added a comment - I guess the reason is the new content security policy: https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy Quick and dirty solution: 1. Go to Jenkins Script Console at https://my-jenkins-server/script 2. Input System .setProperty( "hudson.model.DirectoryBrowserSupport.CSP" , "") 3. Hit Run button Better solution: Read the article above and apply it
            Hide
            bienstock Gad Maor added a comment -

            Hi Christian and thanks very much for your reply.

            Something is very weird: I only managed to see the Javadoc after applying the specific fix for the Javadoc plugin( i.e., default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self' but NOT when completely disabling(unsetting) the header (i.e., System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "") as you yourself suggested).

            Thanks again.

            Show
            bienstock Gad Maor added a comment - Hi Christian and thanks very much for your reply. Something is very weird: I only managed to see the Javadoc after applying the specific fix for the Javadoc plugin( i.e., default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self' but NOT when completely disabling(unsetting) the header (i.e., System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "") as you yourself suggested). Thanks again.
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Remote Link This issue links to "PR 4 (Web Link)" [ 14520 ]
            Hide
            jglick Jesse Glick added a comment -

            With the upcoming release you no longer need to disable security this way.

            Show
            jglick Jesse Glick added a comment - With the upcoming release you no longer need to disable security this way.
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking SECURITY-95 [ SECURITY-95 ]
            Hide
            romanp Roman Pickl added a comment -

            I'm sorry to say that this does not seem to work without the
            JAVA_ARGS="$JAVA_ARGS -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self';\""
            fix even with the newest version of the plugin using jenkins 1.651.3

            Show
            romanp Roman Pickl added a comment - I'm sorry to say that this does not seem to work without the JAVA_ARGS="$JAVA_ARGS -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self';\"" fix even with the newest version of the plugin using jenkins 1.651.3
            romanp Roman Pickl made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 168275 ] JNJira + In-Review [ 186341 ]
            Hide
            dimitkoto Dimitar Sakarov added a comment -

            Having Jenkins ver. 1.642.2 and Javadoc Plugin (Version 1.4 from Jun 17, 2016) installed - it still doesn't display the Javadoc contents.

            What was referred to as "the upcoming release?" and what could be the problem?

            Show
            dimitkoto Dimitar Sakarov added a comment - Having Jenkins ver. 1.642.2 and Javadoc Plugin (Version 1.4 from Jun 17, 2016) installed - it still doesn't display the Javadoc contents. What was referred to as "the upcoming release?" and what could be the problem?
            Hide
            bishiboosh Valentin Rocher added a comment -

            Same thing here, cannot see the javadoc at all, and as I'm not the admin on my Jenkins instance, changing the JAVA_ARGS is not possible :/

            Show
            bishiboosh Valentin Rocher added a comment - Same thing here, cannot see the javadoc at all, and as I'm not the admin on my Jenkins instance, changing the JAVA_ARGS is not possible :/
            Hide
            mesc mesc added a comment -

            have got the "javadoc does not load" issue too
            I do get HTTP code 304 (not modified) in my FireFox web client - is this a HTTP client problem? When the web client cache is cleared, it works 1 time - then again not ...
            Maybe it's not Jenkins alone but in conjunction with sitting in a Tomcat?
            I'll check the HTTP headers further, maybe there's something wrong with 'em.

            Show
            mesc mesc added a comment - have got the "javadoc does not load" issue too I do get HTTP code 304 (not modified) in my FireFox web client - is this a HTTP client problem? When the web client cache is cleared, it works 1 time - then again not ... Maybe it's not Jenkins alone but in conjunction with sitting in a Tomcat? I'll check the HTTP headers further, maybe there's something wrong with 'em.
            Hide
            roidelapluie Julien Pivotto added a comment -

            This is a bug in the configuration. See https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy

            There is nothing to do at the plugin level.

            The resolution of this bug is that as a workaround we open by default the non-framed page.

            Show
            roidelapluie Julien Pivotto added a comment - This is a bug in the configuration. See https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy There is nothing to do at the plugin level. The resolution of this bug is that as a workaround we open by default the non-framed page.
            Hide
            mesc mesc added a comment -

            well, I'm using the non-framed page workaround too

            But, it's still a pity not to have the framed javadoc working.

            I'm pleased so far with

            System.setProperty("hudson.model.DirectoryBrowserSupport.CSP",
             "default-src 'none'; img-src 'self'; style-src 'self'; child-src 'self'; frame-src 'self'; script-src 'unsafe-inline';")
            

            but tried to clear the hudson...CSP system property (see 1st comment by Christian) ... but this does not help, (framed) javadoc not loading.

            Show
            mesc mesc added a comment - well, I'm using the non-framed page workaround too But, it's still a pity not to have the framed javadoc working. I'm pleased so far with System .setProperty( "hudson.model.DirectoryBrowserSupport.CSP" ,   " default -src 'none' ; img-src 'self' ; style-src 'self' ; child-src 'self' ; frame-src 'self' ; script-src 'unsafe-inline' ;" ) but tried to clear the hudson...CSP system property (see 1st comment by Christian) ... but this does not help, (framed) javadoc not loading.
            Hide
            jglick Jesse Glick added a comment -

            It does not work when there is just one package, because the attempted fix looked only for overview-summary.html, which is generated only when there are multiple packages. A refined fix could look for index-all.html, or overview-tree.html, or allclasses-noframe.html, or some */package-summary.html.

            Show
            jglick Jesse Glick added a comment - It does not work when there is just one package, because the attempted fix looked only for overview-summary.html , which is generated only when there are multiple packages. A refined fix could look for index-all.html , or overview-tree.html , or allclasses-noframe.html , or some * /package-summary.html .
            Hide
            jglick Jesse Glick added a comment -

            One workaround: use the more general Publish HTML plugin, for example:

            publishHTML([reportDir: 'target/site/apidocs/', reportName: 'Javadoc', reportTitles: 'Javadoc', reportFiles: 'allclasses-noframe.html'])
            Show
            jglick Jesse Glick added a comment - One workaround: use the more general Publish HTML plugin, for example: publishHTML([reportDir: 'target/site/apidocs/' , reportName: 'Javadoc' , reportTitles: 'Javadoc' , reportFiles: 'allclasses-noframe.html' ])
            Hide
            olivergondza Oliver Gondža added a comment - - edited

            To make this a bit more interesting, javadoc generated by Java 11 (likely Java9+) changes the behavior even further[1]:

            • No frames by default (can be turned on but the feature is expected to go away).
            • Dependency on javascript execution.
              • Redirect from index.html to single package-summary.html in case of single package project.
              • Framed navigation is replaced by JS-based search.
            • It even appears, the <noscript> does not kick in when javascript is disables through CSP.

            I went on exploring Jesse's suggestion of using different landing page on Javadoc 8 and 11 as well as using single/multi package projects. Both index-all.html and overview-tree.html appears to work (though subjectively, I am not sure this is the first page I would like to see) but allclasses-noframe.html is not generated on Java 11 (by default, at least).

            [1] https://bugs.openjdk.java.net/browse/JDK-8202961

            Show
            olivergondza Oliver Gondža added a comment - - edited To make this a bit more interesting, javadoc generated by Java 11 (likely Java9+) changes the behavior even further [1] : No frames by default (can be turned on but the feature is expected to go away). Dependency on javascript execution. Redirect from index.html to single package-summary.html in case of single package project. Framed navigation is replaced by JS-based search. It even appears, the <noscript> does not kick in when javascript is disables through CSP. I went on exploring Jesse's suggestion of using different landing page on Javadoc 8 and 11 as well as using single/multi package projects. Both index-all.html and overview-tree.html appears to work (though subjectively, I am not sure this is the first page I would like to see) but allclasses-noframe.html is not generated on Java 11 (by default, at least). [1] https://bugs.openjdk.java.net/browse/JDK-8202961
            Hide
            olivergondza Oliver Gondža added a comment -

            It even seems javadoc 11 redirects from overview-summary.html to index.html for multipackage projects while it redirects from index.html to the only package-summary.html available in case of singlepackage project. IOW, none of the locations is safe to use.

            Show
            olivergondza Oliver Gondža added a comment - It even seems javadoc 11 redirects from overview-summary.html to index.html for multipackage projects while it redirects from index.html to the only package-summary.html available in case of singlepackage project. IOW, none of the locations is safe to use.
            Hide
            olivergondza Oliver Gondža added a comment -

            The **/package-summary.html can not be used as an index page either as it does not reside in the project root (obviously, it is summary of a java package) and therefore it refers to resources as ../../../foo.bar which obviously fails. In theory, this can be overcome by not using it as an index page for DirectoryBrowserSupport but modifying the JavadocAction too redirect to it instead so it is rendered at expected path.

            I gave up decided to keep things simple and used overview-tree.html that is not ideal but prone of all those issues: https://github.com/jenkinsci/javadoc-plugin/pull/10

            Show
            olivergondza Oliver Gondža added a comment - The **/package-summary.html can not be used as an index page either as it does not reside in the project root (obviously, it is summary of a java package) and therefore it refers to resources as ../../../foo.bar which obviously fails. In theory, this can be overcome by not using it as an index page for DirectoryBrowserSupport but modifying the JavadocAction too redirect to it instead so it is rendered at expected path. I gave up decided to keep things simple and used overview-tree.html that is not ideal but prone of all those issues: https://github.com/jenkinsci/javadoc-plugin/pull/10
            olivergondza Oliver Gondža made changes -
            Assignee Oliver Gondža [ olivergondza ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels javadoc jenkins java11-compatibility javadoc jenkins
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            https://github.com/jenkinsci/javadoc-plugin/pull/10 needs to be released to close it

            Show
            oleg_nenashev Oleg Nenashev added a comment - https://github.com/jenkinsci/javadoc-plugin/pull/10  needs to be released to close it
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I have released 1.5 today which should integrate the recent reports

            Show
            oleg_nenashev Oleg Nenashev added a comment - I have released 1.5 today which should integrate the recent reports
            oleg_nenashev Oleg Nenashev made changes -
            Released As Javadoc Plugin 1.5
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Fixed but Unreleased [ 10203 ]
            Hide
            jglick Jesse Glick added a comment -

            Wrong status in that case.

            Show
            jglick Jesse Glick added a comment - Wrong status in that case.
            jglick Jesse Glick made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            mramonleon Ramon Leon made changes -
            Link This issue is related to JENKINS-56492 [ JENKINS-56492 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels java11-compatibility javadoc jenkins java11-compatibility java11-devtools-compatibility javadoc jenkins

              People

              Assignee:
              olivergondza Oliver Gondža
              Reporter:
              bienstock Gad Maor
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: