2011-04-07 87 views
2

我已经成功地设置了一些使用Maven自动将Maven生成的站点部署到他们的git仓库的gh-pages分支的项目。 GitHub然后在个人子域的公共URL上提供这些文件。我正在寻求利用这一功能来服务于仅有丰富客户端的GWT应用程序。用GWT编译插件替换Maven站点插件

我修改了我的pom.xml以将GWT应用程序编译到target/site/目录。我仍试图实现的两个主要目标是:

  • 如何防止标准Maven站点插件在site阶段运行?
  • 什么是需要这么gwt:compilesite阶段执行?
+0

是你成功的在得到这个工作? – 2011-08-16 10:07:14

回答

0

通过指定插件的新执行,可以将目标绑定到阶段。我假设你已经有了一些自定义的东西来使这些工作正常进行,所以我只关注应该如何将插件目标绑定到特定阶段。

<plugin> 
    <artifactId>gwt-maven-plugin</artifactId> 
    ... 
    <executions> 
    <execution> 
     <id>gwt-site</id> 
     <phase>site</phase><!-- phase to bind to --> 
     <goals> 
     <goal>compile</goal><!-- goal to run in that phase --> 
     </goals> 
     <configuration> 
     <!-- Your magic configuration stuff goes here --> 
     </configuration> 
    </execution> 
    <!-- Possible other executions might be defined here --> 
    </executions> 
</plugin> 

防止从正在运行默认的Maven站点更有趣,因为它是一个阶段,各种各样的绑定到它的目标。通过明确指定没有目标的执行,可以防止标准网站:网站目标在网站阶段中运行。这可能会略有不同,从maven 2到3,所以我会在这里稍微泛泛。看看您的构建日志,看看什么是执行ID方面目前规定,组/工件ID来纠正可能的疏忽在我的例子:

<plugin> 
    <artifactId>maven-site-plugin</artifactId> 
    ... 
    <executions> 
    <execution> 
     <phase>site</phase> 
     <goals></goals><!-- This is empty to indicate that no goals should be run in this phase --> 
    </execution> 
    </executions> 
</plugin>