用 GWT 编译插件替换 Maven 站点插件
我已经成功设置了一些项目,这些项目使用 Maven 自动将 Maven 生成的站点部署到其 git 存储库的 gh-pages 分支。然后,GitHub 在个人子域上的公共 URL 上提供这些文件。我希望利用此功能来为仅富客户端的 GWT 应用程序提供服务。
我修改了 pom.xml
以将 GWT 应用程序编译到 target/site/
目录。我仍在尝试实现的两个主要目标是:
- 如何防止标准 Maven 站点插件在
site
阶段运行? gwt:compile
在site
阶段执行需要什么?
I have successfully set up a few projects which use Maven to automatically deploy the Maven-generated site to the gh-pages
branch of their git repository. GitHub then serves these files at a public URL on a personal subdomain. I'm looking to utilize this functionality to serve a rich client-side only GWT application.
I have modified my pom.xml
to compile the GWT application to the target/site/
directory. The two main goals I am still attempting to achieve are:
- How do I prevent the standard Maven site plugin from running during the
site
phase? - What is required so
gwt:compile
executes during thesite
phase?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以通过为插件指定新的执行来将目标绑定到阶段。我假设您已经拥有一些使大部分工作正常工作所需的自定义内容,因此我将重点关注如何将插件目标绑定到特定阶段。
阻止默认的 Maven 站点运行更有趣,因为它是一个阶段,有多种目标与之绑定。通过显式指定没有目标的执行,可以阻止标准站点:站点目标在站点阶段运行。这在 maven 2 到 3 中可能略有不同,所以我在这里稍微笼统一点。查看您的构建日志,了解当前在执行 id、组/工件 id 方面指定的内容,以纠正我的示例中可能存在的疏忽:
A goal can be bound to a phase by specifying a new execution for the plugin. I'm assuming you've got some custom stuff you need to make most of this work correctly, so I'm just going to focus on what should work to bind a plugin goal to a particular phase.
Preventing the default maven site from being run is more interesting, as it is a phase, with a variety of goals bound to it. The standard site:site goal can be prevented from running in the site phase by explicitly specifying an execution with no goals. This may vary slightly from maven 2 to 3, so I'm going to be a little general here. Take a look at your build logs to see what is currently specified in terms of execution id, group/artifact id to correct possible oversights in my example: