Search code examples
javamavenjboss7.xmaven-javadoc-plugin

Maven Javadoc aggregate fails on JBoss AS 7.1.1.Final


I am trying to generate aggregate javadoc for multiple projects with Maven Javadoc plugin. If I run javadoc:javadoc goal the build finishes with SUCCESS. Anyhow I would like to combine all javadocs with javadoc:aggregate goal and it fails when trying to find org.jboss.msc.service package:

org.apache.maven.reporting.MavenReportException: 
Exit code: 1 - /home/me/proj/proj/subproject1/src/main/java/com/test/hasingleton/HATimerServiceActivator.java:6: error: package org.jboss.msc.service does not exist
import org.jboss.msc.service.DelegatingServiceContainer;

How can I configure the maven javadoc plugin to exclude this import? I have tried with following settings:

<excludePackageNames>org.jboss.msc.service.*</excludePackageNames>
<dependencySourceExcludes>
     <dependencySourceExclude>org.jboss.msc.service:*</dependencySourceExclude>
</dependencySourceExcludes>

But no luck. All help is appreciated!


Solution

  • You could try this way (include instead of exclude)

            <configuration>
              <!-- switch on dependency-driven aggregation -->
              <includeDependencySources>true</includeDependencySources>
    
              <dependencySourceIncludes>
                <!-- include ONLY dependencies I control -->
                <dependencySourceInclude>org.test.dep:*</dependencySourceInclude>
              </dependencySourceIncludes>
            </configuration>
    

    Other way is to use artifact id (rather than package name)

           <configuration>
              <!-- switch on dependency-driven aggregation -->
              <includeDependencySources>true</includeDependencySources>
    
              <dependencySourceExcludes>
                <!-- exclude ONLY commons-cli artifacts -->
                <dependencySourceExclude>commons-cli:*</dependencySourceExclude>
              </dependencySourceExcludes>
            </configuration>