0

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?

ctrueden
  • 6,751
  • 3
  • 37
  • 69

1 Answers1

0

Have you tried the fakeClass source modification?

<sourceModifications>
  <sourceModification>
    <className>fakeClass</className>
      <includes>
        <include name="script-templates.java"/>
      </includes>
    </sourceModification>
</sourceModifications>
APerson
  • 8,140
  • 8
  • 35
  • 49
  • I tried [this](https://github.com/imagej/imagej-javadoc/commit/40a227ec16f9cc2bf13b534ae42cf47fb263607b). Unfortunately, I still see the same error. Is that what you meant? And where did you find this hack? I couldn't find it anywhere after 5 minutes of searching... – ctrueden Nov 07 '14 at 23:42
  • This bit is from when [it was proposed](http://community.jedit.org/?q=node/view/1663) that jEdit use Maven. – APerson Nov 08 '14 at 00:49
  • That thread is ten years old. I think `sourceModifications` must be from Maven 1; it isn't mentioned anywhere in the modern Maven POM reference. What makes you think it is relevant to this issue? – ctrueden Nov 11 '14 at 04:56
  • Well, reading your question I had remembered seeing something that told Maven that something wasn't a real class and shouldn't be compiled; one look through my browser history later, I posted this. – APerson Nov 12 '14 at 02:05