如何从Nexus自动部署战争到Tomcat? [英] How can I automatically deploy a war from Nexus to Tomcat?

查看:519
本文介绍了如何从Nexus自动部署战争到Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Nexus自动部署战争到Tomcat?

How can I automatically deploy a war from Nexus to Tomcat?

我有一个maven web项目,可以在Nexus上构建和部署(SNAPSHOT和发布版本)成功。我想知道Nexus中是否有功能/插件,它会选择已发布的战争并自动部署在远程Tomcat上?

I have a maven web project which gets built and deployed (both SNAPSHOT and release versions) on Nexus successfully. I would like to know if there is feature/plugin in Nexus where it picks the released war and deploys on remote Tomcat automatically?

我知道您可以使用maven-tomcat-plugin将战争部署到远程Tomcat,但想知道是否有替代解决方案。

I know that you can deploy the war to remote Tomcat using maven-tomcat-plugin but would like to know if there is an alternative solution.

请指导。

推荐答案

通常你会使用CI像Jenkins这样的工具可以运行Maven构建,将你的War文件发布到Nexus中。然后,Nexus将被您用于将战争推送到目标tomcat环境的任何工具使用:

Typically you'd use a CI tool like Jenkins to run the Maven build that publishes your War file into Nexus. Nexus would then be used by whatever tool you're using to push the War onto the target tomcat environment:

有很多很多选项。

从Jenkins运行构建后的SSH任务,执行类似的操作目标tomcat服务器:

Run a post-build SSH task from Jenkins that does something like this on the target tomcat server:

curl "http://myrepo/nexus/service/local/artifact/maven/redirect?r=releases&g=myorg&a=myapp&v=1.1&e=war" \
     -o /usr/local/share/tomcat7/webapps/myapp.war
service tomcat7 restart



Rundeck



我的偏好是使用< a href =http://rundeck.org/ =noreferrer> Rundeck 用于部署,因为它有 Nexus插件,提供方便的可用版本下拉菜单。

Rundeck

My preference is to use Rundeck for deployments, because it has a Nexus plugin, providing convenient drop-down menus of available releases.

还有一个 Jenkins的Rundeck插件,可用于协调CI进程,Jenkins执行构建,移交Rundeck进行部署,然后进行Jenkins回调以运行集成测试。

There is also a Rundeck plugin for Jenkins that can be used to orchestrate a CI process with Jenkins performing the build, hand-over to Rundeck for deployment, followed by a Jenkins call-back to run the integration tests.

我还使用厨师,可以用拉动的方式自动部署软件。

I also use chef which can be used to automatically deploy software in a pull fashion.

神器食谱直接支持Nexus,而 application_java cookbook使用更通用的从URL拉取方法也很有效。

The artifact cookbook has direct support for Nexus, whereas the application_java cookbook uses a more generic "pull from a URL" approach that also works well.

..
..

.. ..

列表继续,所以我希望这有帮助。

The list goes on, so I hope this helps.

这篇关于如何从Nexus自动部署战争到Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆