0
votes

I have a maven based spring mvc project. I can build that project and run it via tomcat manually like this

mvn package -Dbuild.name=App1
mvn package -Dbuild.name=App2
mvn package -Dbuild.name=App3

and then can copy those generate war files App1.war, App2.war and App3.war into my tomcat folder and start it. It works fine.

Question is how to do the same using intelliJ IDEA?

I generated war files one by one by using Maven Project window and creating custom value for package goal. It generates .war files in target folder. But when I run it in Tomcat of intelliJ it only runs the application at root "/" address. For other addresses

/App2 -> 404
/App3 -> 404
1

1 Answers

1
votes

You can have multiple artifacts created in IntelliJ IDEA and configured for deployment at the same time in the application server Run/Debug configuration, Deployment tab under different contexts.

Note that Deployment tab has a configuration to perform the deployment from the External source where you can specify the location of the war produced by Maven if you don't want to use artifacts for some reason.