I\'ve been using mvn tomcat7-maven-plugin:run -am -pl :foo
successfully to run just a single project at a time in Tomcat like is shown here. Now I\'d like to ha
As it was already suggested, use <webapps>
section of plugin configuration, but add additional parameter <asWebapp>true</asWebapp>
for every webapp, i.e:
<webapps>
<webapp>
<groupId>com.company</groupId>
<artifactId>mywebapp</artifactId>
<version>1.0</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
<webapp>
<groupId>com.company</groupId>
<artifactId>mywebapp2</artifactId>
<version>2.0</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
These additional webapps are deployed with ${artifactId}
context path by default.
It looks like without this parameter additional webapps get silently discarded when you run something like mvn tomcat7:run
(tried on stable version 2.0). Related Jira issue tells it was done for "backward compatibility".
Use something like
<configuration>
<webapps>
<webapp>
<groupId>com.company</groupId>
<artifactId>mywebapp</artifactId>
<version>1.0</version>
<type>war</type>
</webapp>
</webapps>
</configuration>