如何在构建期间自动生成maven站点

时间:2014-11-11 20:03:58

标签: maven maven-3 maven-site-plugin

我知道我可以单独致电mvn site-deploy,但如何在mvn clean deploy的构建过程中启动网站部署?

1 个答案:

答案 0 :(得分:1)

site插件添加到pom的<build>,并在您选择的某个阶段运行相应的目标。

<plugin>
  <artifactId>maven-site-plugin</artifactId>
  <executions>
    <execution>
      <id>site deploy</id>
      <phase>your_choice_of_phase</phase>
      <goals>
        <goal>site</goal>
        <goal>deploy</goal>
      </goals>
    </execution>
  </executions>
</plugin>