0

我已经配置了 javadoc i Maven,但是 当我执行mvn package时,我必须执行mvn javadoc:javadoc i like Maven to this 。

我的 pom 看起来像

<plugin>
    <artifactId>maven-javadoc-plugin</artifactId>
     <version>${maven-javadoc-plugin.version}</version>
    <configuration>
        <aggregate>true</aggregate>
    </configuration>
    <executions>
        <execution>
            <id>attach-javadocs</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>package</goal>
            </goals>
        </execution>
    </executions>
</plugin>
4

1 回答 1

1

您的插件配置显示在准备包阶段调用了 javadoc 插件。因此,如果你调用mvn package这个插件就会被执行。但是 javadoc 插件没有目标包:请参阅此处的插件信息

我想你想调用 javadoc 目标:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <configuration>
                ...
            </configuration>
            <executions>
                <execution>
                    <id>generate-javadoc</id>
                    <phase>package</phase>
                    <goals>
                        <goal>javadoc</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
于 2013-10-07T14:52:17.423 回答