Maven Site Plugin
  1. Maven Site Plugin
  2. MSITE-432

Incorrect classpath is used when site plugin/phase launches javadoc command


    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.0-beta-7, 2.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Maven 2.2.1


      When invoking the site plugin (with javadoc reporting enabled) for a project that depends on both the main artifact and the tests artifact of another project, the classpath passed to the javadoc command is incorrect.

      For example:
      Project A produces the following artifacts:

      • ProjectA-version.jar (main artifact)
      • ProjectA-version-tests.jar (test classes)

      And project B has dependencies similar to this:


      Then only one of the jars is included in the classpath passed to the javadoc command. (Normally it seems to be the main artifact, although on one of my projects it was the tests artifact instead.) This causes lots of warnings, or for some projects causes the build to fail.

      Note that if I explicitly run the javadoc goals (i.e. "mvn javadoc:javadoc" or "mvn javadoc:test-javadoc") then the classpath is populated correctly and no errors are shown. It's only when the site plugin/phase launches it that the classpath is wrong. I've also found that the order of the dependencies within the POM file seems to make a difference in some cases.

      I've attached a zip file containing two projects to reproduce this. To run it:

      1. run mvn install on project1
      2. run mvn site on project2 (to see the warnings) or mvn javadoc:test-javadoc

      The warning looks like this:

      [WARNING] Javadoc Warnings
      [WARNING] D:\code\EclipseWorkspaces_chris\PaymentCard\project3\src\main\java\repro3\ cannot find symbol
      [WARNING] symbol  : class MyClass1
      [WARNING] location: package repro1
      [WARNING] import repro1.MyClass1;
      [WARNING] ^

        Issue Links


          Chris Tait created issue -
          Dennis Lundberg made changes -
          Field Original Value New Value
          Link This issue duplicates MNG-2045 [ MNG-2045 ]
          Dennis Lundberg made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:16:22 UTC 2015 [ 1428239782088 ]
          Mark Thomas made changes -
          Workflow jira [ 12726790 ] Default workflow, editable Closed status [ 12757049 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 01:19:02 UTC 2015 [ 1428283142430 ]
          Mark Thomas made changes -
          Workflow jira [ 12964691 ] Default workflow, editable Closed status [ 13001680 ]


            • Assignee:
              Chris Tait
            • Votes:
              6 Vote for this issue
              5 Start watching this issue


              • Created: