简体   繁体   中英

maven-javadoc-plugin: How can I exclude resource folders which violate Java package naming conventions?

I am trying to generate an aggregated set of javadocs from a collection of related projects, like so .

In a nutshell, this POM project declares a bunch of dependencies and then uses the maven-javadoc-plugin 's <includeDependencySources>true</includeDependencySources> option.

Some of the dependencies have a script-templates folder in their resources, which gets lumped into the "-sources" JAR by the maven-source-plugin .

Unfortunately, it seems the javadoc tool dislikes folders with violate java package naming conventions. So my build ultimately fails with:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project imagej-javadoc: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - javadoc: error - Illegal package name: "script-templates.Java"

I tried adding <excludePackageNames>script-templates</excludePackageNames> to the maven-javadoc-plugin configuration, but it seemed to have no effect.

Does anyone have ideas how to work around this problem?

Have you tried the fakeClass source modification?

<sourceModifications>
  <sourceModification>
    <className>fakeClass</className>
      <includes>
        <include name="script-templates.java"/>
      </includes>
    </sourceModification>
</sourceModifications>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM