9

I have a maven project with the following POM snippet:

<modelVersion>4.0.0</modelVersion>
<artifactId>Foo-Deploy</artifactId>
<name>Foo-Deploy</name>
<packaging>pom</packaging>
<description>foobar</description>
<dependencies>
<dependency>
        <groupId>de.foo.bar</groupId>
        <artifactId>some-api</artifactId>
        <version>${project.version}</version>
        <classifier>doc</classifier>
        <type>zip</type>
    </dependency>
</dependencies>

The idea is to have a dependency defined in which some sources are (this is created successfully before). Now I want to run javadoc on exactly THIS dependency. When I call

mvn javadoc:jar -DincludeDependencySources=true -DdependencySourceIncludes=de.foo.bar:some-api:*:doc:zip

it fails with the message

Not executing Javadoc as the project is not a Java classpath-capable package

what is wrong ? and would it work anyhow ?

or how can I generate javadoc from a specific dependency (assuming this project has more dependencies) ?

Thanks

Emerson
  • 1,247
  • 2
  • 15
  • 24
  • OK... i changed the packaging to jar (it was pom) - and then the error does not occur again. BUT - it doesnt do anything... maven says Successfull, but nothing is generated :( – Emerson Mar 29 '11 at 10:34
  • Perhaps http://stackoverflow.com/questions/4947215/maven-3-generate-javadoc-for-defined-artifacts is related – Raghuram Mar 29 '11 at 12:06

1 Answers1

8

To generate javadoc for dependant sources, a sequence of steps needs to be done. These are outlined in this link.

Essentially you need to ensure that the source files of the dependency is generated/available and <includeDependencySources> parameter is enabled.

Raghuram
  • 49,195
  • 9
  • 101
  • 120