开发者

How to generate Javadoc for Maven Dependencies

开发者 https://www.devze.com 2023-02-20 16:46 出处:网络
I have a maven project with the following POM snippet: <modelVersion>4.0.0</modelVersion> <artifactId>Foo-Deploy</artifactId>

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 dep开发者_开发百科endency 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消