生命周期 - site

Maven的网站插件通常用于创建新的文档,创建报告,部署网站等。

阶段

  • pre-site
  • site
  • post-site
  • site-deploy

在下面的示例中,我们将附加 maven-antrun-plugin:run 目标网站的生命周期的所有阶段。这将使我们能够调用短信显示的生命周期的各个阶段。

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-antrun-plugin</artifactId>
      <version>1.1</version>
      <executions>
        <execution>
          <id>id.pre-site</id>
          <phase>pre-site</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <tasks>
              <echo>pre-site phase</echo>
            </tasks>
          </configuration>
        </execution>
        <execution>
          <id>id.site</id>
          <phase>site</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <tasks>
              <echo>site phase</echo>
            </tasks>
          </configuration>
        </execution>
        <execution>
          <id>id.post-site</id>
          <phase>post-site</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <tasks>
              <echo>post-site phase</echo>
            </tasks>
          </configuration>
        </execution>
        <execution>
          <id>id.site-deploy</id>
          <phase>site-deploy</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <tasks>
              <echo>site-deploy phase</echo>
            </tasks>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

运行 mvn site

MIT Licensed | Copyright © 2018-present 滇ICP备16006294号

Design by Quanzaiyu | Power by VuePress