简体   繁体   English

运行配置以构建 maven 项目并部署到 tomcat 服务器

[英]run configuration to build maven project and deploy to tomcat server

I am writing a java program using maven and running on a tomcat 9 server.我正在使用 maven 编写 java 程序并在 tomcat 9 服务器上运行。 I created a run configuration to build the project, but I was wondering if there is a way to modify the configuration to build the project and also deploy it to my server.我创建了一个运行配置来构建项目,但我想知道是否有办法修改配置来构建项目并将其部署到我的服务器。 Thanks in advance!提前致谢!

For small project you need e little workaround here:对于小型项目,您需要一点解决方法:

  • First create e post script for maven ( mavenrc_post.bat for windows) see here首先为 maven ( mavenrc_post.bat for windows) 创建 e post 脚本,请参见此处
  • In this script you have to move build files via ssh, and restart tomcat(you need to configure ssh on server).在此脚本中,您必须通过 ssh 移动构建文件,然后重新启动 tomcat(您需要在服务器上配置 ssh)。

For large projects you need software for automation like:对于大型项目,您需要自动化软件,例如:

  • Ansible Automation platform Ansible 自动化平台
  • Docker Containers Docker 容器
  • Azure Devops etc. Azure 开发运维等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM