为什么我的Maven项目会在目标文件夹中自动生成apidoc?

时间:2014-10-22 08:09:51

标签: maven javadoc

我没有在我的maven项目pom.xml文件中配置maven-javadoc-plugin,但是当我运行mvn install命令时,那么生成apidoc?

pom.xml的配置如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.security.oauth</groupId>
    <artifactId>spring-security-oauth-parent</artifactId>
    <version>2.0.3.RELEASE</version>
</parent>
<build>
    <finalName>webcnmobile</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <!-- web.xml is not mandatory since JavaEE 5 -->
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <testResources>
        <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
        </testResource>
    </testResources>
</build>

spring-security-oauth-parent pom.xml请参阅here

1 个答案:

答案 0 :(得分:1)

javadoc插件在您引用的父pom中配置(spring-security-oauth-parent)。这意味着您inherit此配置会自动应用于您的项目。

父pom中的配置如下:

<plugin>
    <artifactId>maven-javadoc-plugin</artifactId>
    <executions>
      <execution>
        <id>javadoc</id>
        <phase>package</phase>
        <goals>
          <goal>jar</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

然后将其应用于您的项目,因此您将生成javadoc。