我有多模块Maven项目,我在其中运行maven- javadoc-plugin来生成javadoc.在我的父pom.xml中,我已经定义了插件构建如下: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-javadoc-plugin/artifactId versi
<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>
当我运行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.
由于我目前正在构建我的模块1.7.1,我会假设Maven在构建my-module后检测到并运行aggregate-jar,但由于某种原因,它希望my-module已经安装在repo中.
我的Maven版本是3.0.4.请记住,我是Maven构建的新手,所以这可能是一个非常简单的问题,但我无法找到任何答案.
一些观察:
>如果我在没有javadoc插件aggregate-jar目标的情况下首次运行mvn clean install,那么构建会成功
> javadoc插件聚合目标运行良好.
>这bug完全是指我的问题,但应该在Maven 3(2010)中得到解决
<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>
当我想生成文档时,我做了mvn javadoc:aggregate