How to generate Javadoc for Maven Dependencies
Asked Answered
N

1

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

Netherlands answered 29/3, 2011 at 9:18 Comment(2)
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 :(Netherlands
Perhaps #4947715 is relatedDestructible
D
7

To generate javadoc for dependent 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.

Destructible answered 29/3, 2011 at 12:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.