Question

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!

Was it helpful?

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top