I have two wars which I deploy in two maven projects using tomcat plugin. I want to do this in one step and be able to deploy more than one war in a single maven project. How can I do this? any suggestions?
相关问题
- Tomcat and SSL Client certificate
- Can't configure nginx as a proxy for tomcat wi
- Tomcat 8 how to remove sessionCookieName from URL
- How to resolve Maven exec plugin: classpath too lo
- Maven: How to read the Parent POM version
相关文章
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- Making a two way SSL authentication between apache
- Maven directory structure
- Can't start Tomcat as Windows Service
you can create a "super war" and deploy that, as well
I'm not in a position to test this, but there are two approaches I can think of. Either may work for you.
Option 1:
In one of the projects you can define the configuration for the tomcat plugin. In the snippet below there are two executions defined, both bound to the pre-integration-test phase (this might not be the best phase to do this, but it seems a good starting point as the war will have been packaged). Each execution will deploy the war defined in its configuration's warFile property.
Option 2: This is probably the better approach. Define one execution in each war (you can omit the warFile element as the default can be used). You can then define a third project with a modules declaration referencing each war project. When the parent is built both wars will be be built and the wars deployed.
The modules declaration for the third project:
And the config for each war project:
Maven has some properties you can use to avoid absolute paths.