I have multi-module Maven project in which I run the maven-javadoc-plugin to generate javadoc. In my parent pom.xml I have defined the plugin build as follows:
我有多模块Maven项目,我在其中运行maven-javadoc-plugin来生成javadoc。在我的父pom.xml中,我已经定义了插件构建如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<!-- Default configuration for all reports -->
</configuration>
<executions>
<execution>
<id>aggregate</id>
<goals>
<goal>aggregate-jar</goal>
</goals>
<phase>install</phase>
<configuration>
<!-- Specific configuration for the aggregate report -->
</configuration>
</execution>
</executions>
</plugin>
When I run mvn clean install
the build fails with unresolved dependencies, but I see the following warning:
当我运行mvn clean install时,构建失败并显示未解析的依赖项,但是我看到以下警告:
[WARNING] The dependency: [my.application:my-module:jar:1.7.1] can't be resolved but has been found in the reactor (probably snapshots). This dependency has been excluded from the Javadoc classpath. You should rerun javadoc after executing mvn install.
[警告]依赖项:[my.application:my-module:jar:1.7.1]无法解析,但已在反应堆中找到(可能是快照)。此依赖项已从Javadoc类路径中排除。您应该在执行mvn install后重新运行javadoc。
As I am currently building my-module 1.7.1, I would assume Maven to detect this and run the aggregate-jar after building my-module, but for some reason it expects my-module to already be installed in a repo.
由于我目前正在构建my-module 1.7.1,我会假设Maven在构建my-module后检测到并运行aggregate-jar,但由于某种原因,它希望my-module已经安装在repo中。
My Maven version is 3.0.4. Please keep in mind that I am new to Maven builds so this may be a very simple question, but I was not able to find any answer.
我的Maven版本是3.0.4。请记住,我是Maven构建的新手,所以这可能是一个非常简单的问题,但我无法找到任何答案。
Some observations:
一些观察:
- The build succeeds if I first run
mvn clean install
without the javadoc pluginaggregate-jar
goal - 如果我第一次运行mvn clean install而没有javadoc插件的aggregate-jar目标,那么构建会成功
- The javadoc plugin
aggregate
goal runs fine. - javadoc插件聚合目标运行良好。
- This bug refers exactly to my issue, but should have been solved in Maven 3 (2010)
- 这个错误完全是指我的问题,但应该在Maven 3(2010)中得到解决
1 个解决方案
#1
0
I run this command in my parent pom and this is how I do it without issues:
我在父pom中运行此命令,这是我如何做到没有问题:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
When I want to generate the docs, I do mvn javadoc:aggregate
当我想生成文档时,我做了mvn javadoc:aggregate
#1
0
I run this command in my parent pom and this is how I do it without issues:
我在父pom中运行此命令,这是我如何做到没有问题:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
When I want to generate the docs, I do mvn javadoc:aggregate
当我想生成文档时,我做了mvn javadoc:aggregate