简体   繁体   English

maven-javadoc-plugin:如何排除违反Java包命名约定的资源文件夹?

[英]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 . 我正在尝试从相关项目的集合中生成一组汇总的javadocs, 例如so

In a nutshell, this POM project declares a bunch of dependencies and then uses the maven-javadoc-plugin 's <includeDependencySources>true</includeDependencySources> option. 简而言之,该POM项目声明了一堆依赖项,然后使用maven-javadoc-plugin<includeDependencySources>true</includeDependencySources>选项。

Some of the dependencies have a script-templates folder in their resources, which gets lumped into the "-sources" JAR by the maven-source-plugin . 一些依赖项在它们的资源中有一个script-templates文件夹,它被maven-source-plugin集中到“ -sources” JAR中。

Unfortunately, it seems the javadoc tool dislikes folders with violate java package naming conventions. 不幸的是,似乎Javadoc工具不喜欢带有违反Java包命名约定的文件夹。 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. 我尝试将<excludePackageNames>script-templates</excludePackageNames>maven-javadoc-plugin配置中,但似乎没有效果。

Does anyone have ideas how to work around this problem? 有谁知道如何解决此问题?

Have you tried the fakeClass source modification? 您是否尝试过fakeClass源修改?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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