Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-180

aggregation doesn't work for test-javadoc goal

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.5
    • Labels:
      None
    • Environment:
      maven-javadoc-plugin 2.3 final
      maven-javadoc-plugin 2.4-SNAPSHOT r632385
      Maven version: 2.0.8
      Java version: 1.5.0_13
      OS name: "mac os x" version: "10.5.2" arch: "i386" Family: "unix"

    • Number of attachments :
      1

      Description

      When executing 'javadoc:test-javadoc' from a parent project in a multi-module build, it fails complaining of missing dependencies:

      mvn clean -X -e javadoc:test-javadoc

      <snip>

      [DEBUG] embargo-api: using locally installed snapshot
      [DEBUG] dspace-api: resolved to version 1.4.2e-20080118.034638-23 from repository msel.maven.snapshots
      [DEBUG] Compiled artifacts for edu.jhu.library.embargo:embargo-dspace:1.0.0-SNAPSHOT
      /Users/esm/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar
      /Users/esm/.m2/repository/commons-collections/commons-collections/2.1/commons-collections-2.1.jar
      /Users/esm/.m2/repository/xerces/xercesImpl/2.0.2/xercesImpl-2.0.2.jar
      /Users/esm/.m2/repository/commons-dbcp/commons-dbcp/1.2.1/commons-dbcp-1.2.1.jar
      /Users/esm/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
      /Users/esm/.m2/repository/commons-pool/commons-pool/1.2/commons-pool-1.2.jar
      /Users/esm/.m2/repository/logkit/logkit/1.0.1/logkit-1.0.1.jar
      /Users/esm/.m2/repository/edu/jhu/library/embargo/embargo-api/1.0.0-SNAPSHOT/embargo-api-1.0.0-SNAPSHOT.jar
      /Users/esm/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar
      /Users/esm/.m2/repository/org/dspace/dspace-api/1.4.2e-SNAPSHOT/dspace-api-1.4.2e-SNAPSHOT.jar
      /Users/esm/.m2/repository/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar

      <snip>

      [DEBUG] "cd /Users/esm/idea/workspace/embargo/target/site/testapidocs && /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/javadoc" @options @packages
      [search path for source files: [/Users/esm/idea/workspace/embargo/embargo-api/src/test/java, /Users/esm/idea/workspace/embargo/embargo-dspace/src/test/java]]
      [search path for class files: [/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar, /System/Library/Java/Extensions/CoreAudio.jar, /System/Library/Java/Extensions/dns_sd.jar, /System/Library/Java/Extensions/j3daudio.jar, /System/Library/Java/Extensions/j3dcore.jar, /System/Library/Java/Extensions/j3dutils.jar, /System/Library/Java/Extensions/jai_codec.jar, /System/Library/Java/Extensions/jai_core.jar, /System/Library/Java/Extensions/mlibwrapper_jai.jar, /System/Library/Java/Extensions/MRJToolkit.jar, /System/Library/Java/Extensions/QTJava.zip, /System/Library/Java/Extensions/vecmath.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/dnsns.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/localedata.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunjce_provider.jar, /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar, /Users/esm/.m2/repository/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar, /Users/esm/.m2/repository/commons-collections/commons-collections/2.1/commons-collections-2.1.jar, /Users/esm/.m2/repository/xerces/xercesImpl/2.0.2/xercesImpl-2.0.2.jar, /Users/esm/.m2/repository/commons-dbcp/commons-dbcp/1.2.1/commons-dbcp-1.2.1.jar, /Users/esm/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar, /Users/esm/.m2/repository/commons-pool/commons-pool/1.2/commons-pool-1.2.jar, /Users/esm/.m2/repository/logkit/logkit/1.0.1/logkit-1.0.1.jar, /Users/esm/.m2/repository/edu/jhu/library/embargo/embargo-api/1.0.0-SNAPSHOT/embargo-api-1.0.0-SNAPSHOT.jar, /Users/esm/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar, /Users/esm/.m2/repository/org/dspace/dspace-api/1.4.2e-SNAPSHOT/dspace-api-1.4.2e-SNAPSHOT.jar, /Users/esm/.m2/repository/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar]]

      <snip>

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] An error has occurred in Test JavaDocs report generation:Exit code: 1 - /Users/esm/idea/workspace/embargo/embargo-dspace/src/test/java/org/dspace/embargo/AbstractServiceTest.java:3: package org.dbunit does not exist
      import org.dbunit.IDatabaseTester;
      ^
      /Users/esm/idea/workspace/embargo/embargo-dspace/src/test/java/org/dspace/embargo/AbstractServiceTest.java:4: package org.dbunit does not exist
      import org.dbunit.PropertiesBasedJdbcDatabaseTester;

      <snip - more of the same>

        Activity

        Hide
        Elliot Metsger added a comment -
        • The compiled artifacts list doesn't include any of the test dependencies
        • DB Unit is a test dependency. If I make it a compile-time dep, the DB Unit errors go away (but other test deps cannot be found)
        • I can execute the test-javadoc goal successfully if I run it inside the child module instead of the parent.
        Show
        Elliot Metsger added a comment - The compiled artifacts list doesn't include any of the test dependencies DB Unit is a test dependency. If I make it a compile-time dep, the DB Unit errors go away (but other test deps cannot be found) I can execute the test-javadoc goal successfully if I run it inside the child module instead of the parent.
        Hide
        Elliot Metsger added a comment -

        The solution for the 'javadoc' goal seems to have been added via MJAVADOC-72 in r434560. AbstractJavadocMojo's getClasspath() was modified to obtain the classpaths for aggregated projects.

        I'd be happy to work on a patch but need a little direction: should getClasspath() be made protected and allow TestJavadocReport to override it and add the test classpaths?

        Show
        Elliot Metsger added a comment - The solution for the 'javadoc' goal seems to have been added via MJAVADOC-72 in r434560. AbstractJavadocMojo's getClasspath() was modified to obtain the classpaths for aggregated projects. I'd be happy to work on a patch but need a little direction: should getClasspath() be made protected and allow TestJavadocReport to override it and add the test classpaths?
        Hide
        Vincent Siveton added a comment -

        Could you send us a test case?

        Show
        Vincent Siveton added a comment - Could you send us a test case?
        Hide
        Elliot Metsger added a comment -

        Hi Vincent, thanks for taking a look. I'm attaching mjavadoc-180.tar which will explode the test case to its own subdirectory.

        Running 'mvn javadoc:test-javadoc' will produce the failure. I've noted in the parent pom where you can work around this issue by changing <aggregate> to 'false'.

        Hopefully I'm not trying to do anything silly. Thanks!

        Show
        Elliot Metsger added a comment - Hi Vincent, thanks for taking a look. I'm attaching mjavadoc-180.tar which will explode the test case to its own subdirectory. Running 'mvn javadoc:test-javadoc' will produce the failure. I've noted in the parent pom where you can work around this issue by changing <aggregate> to 'false'. Hopefully I'm not trying to do anything silly. Thanks!
        Hide
        Elliot Metsger added a comment -

        The exception from the test case is slightly different than what is reported in the in the description:

        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] An error has occurred in Test JavaDocs report generation:Exit code: 1 - /private/tmp/MJAVADOC-180/module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:3: package org.junit does not exist
        import static org.junit.Assert.assertTrue;
        ^
        /private/tmp/MJAVADOC-180/module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:3: static import only from classes and interfaces
        import static org.junit.Assert.assertTrue;
        ^
        /private/tmp/MJAVADOC-180/module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:4: package org.junit does not exist
        import org.junit.Test;
        ^
        /private/tmp/MJAVADOC-180/module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:5: package org.dbunit.database does not exist
        import org.dbunit.database.IDatabaseConnection;
        ^
        /private/tmp/MJAVADOC-180/module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:19: cannot find symbol
        symbol : class Test
        location: class edu.jhu.library.Mjavadoc180Test
        @Test
        ^

        I think this is because JUnit is not defined in the parent (unlike in my real-world project where it is). I think this still is evidence of this issue.

        Show
        Elliot Metsger added a comment - The exception from the test case is slightly different than what is reported in the in the description: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] An error has occurred in Test JavaDocs report generation:Exit code: 1 - /private/tmp/ MJAVADOC-180 /module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:3: package org.junit does not exist import static org.junit.Assert.assertTrue; ^ /private/tmp/ MJAVADOC-180 /module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:3: static import only from classes and interfaces import static org.junit.Assert.assertTrue; ^ /private/tmp/ MJAVADOC-180 /module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:4: package org.junit does not exist import org.junit.Test; ^ /private/tmp/ MJAVADOC-180 /module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:5: package org.dbunit.database does not exist import org.dbunit.database.IDatabaseConnection; ^ /private/tmp/ MJAVADOC-180 /module1/src/test/java/edu/jhu/library/Mjavadoc180Test.java:19: cannot find symbol symbol : class Test location: class edu.jhu.library.Mjavadoc180Test @Test ^ I think this is because JUnit is not defined in the parent (unlike in my real-world project where it is). I think this still is evidence of this issue.
        Hide
        Vincent Siveton added a comment -

        fixed in r659288, snapshot deployed

        Show
        Vincent Siveton added a comment - fixed in r659288, snapshot deployed

          People

          • Assignee:
            Vincent Siveton
            Reporter:
            Elliot Metsger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: