Maven构建生命周期(3)

Site 生命周期

Maven Site 插件一般用来创建新的报告文档、部署站点等。

阶段:

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

在下面的例子中,我们将 maven-antrun-plugin:run 目标添加到 Site 生命周期的所有阶段中。这样我们可以显示生命周期的所有文本信息。

我们已经更新了 pom.xml 文件。


4.0.0
com.companyname.projectgroup
project
1.0



org.apache.maven.plugins
maven-antrun-plugin
1.1
   
      
         id.pre-site
         pre-site
         
            run
         
         
            
               pre-site phase
            
         
      
      
         id.site
         site
         
         run
         
         
            
               site phase
            
         
      
      
         id.post-site
         post-site
         
            run
         
         
            
               post-site phase
            
         
      
      
         id.site-deploy
         site-deploy
         
            run
         
         
            
               site-deploy phase
            
         
      
   




现在打开命令控制台,跳转到 pom.xml 所在目录,并执行以下 mvn 命令。
mvn site
Maven 将会开始处理并显示直到 site 阶段的 site 生命周期的各个阶段。

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------
[INFO] Building Unnamed - com.companyname.projectgroup:project:jar:1.0
[INFO]    task-segment: [site]
[INFO] ------------------------------------------------------------------
[INFO] [antrun:run {execution: id.pre-site}]
[INFO] Executing tasks
     [echo] pre-site phase
[INFO] Executed tasks
[INFO] [site:site {execution: default-site}]
[INFO] Generating "About" report.
[INFO] Generating "Issue Tracking" report.
[INFO] Generating "Project Team" report.
[INFO] Generating "Dependencies" report.
[INFO] Generating "Project Plugins" report.
[INFO] Generating "Continuous Integration" report.
[INFO] Generating "Source Repository" report.
[INFO] Generating "Project License" report.
[INFO] Generating "Mailing Lists" report.
[INFO] Generating "Plugin Management" report.
[INFO] Generating "Project Summary" report.
[INFO] [antrun:run {execution: id.site}]
[INFO] Executing tasks
     [echo] site phase
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Sat Jul 07 15:25:10 IST 2012
[INFO] Final Memory: 24M/149M
[INFO] ------------------------------------------------------------------```

你可能感兴趣的:(Maven构建生命周期(3))