I am using Maven 2 and I have an external Tomcat 7. I was wondering how to run Tomcat 7 from using Maven Tomcat plugin.
And does Maven Tomcat plugin in Maven 3 runs the Tomcat 7 by default.
Thanks.
I am using Maven 2 and I have an external Tomcat 7. I was wondering how to run Tomcat 7 from using Maven Tomcat plugin.
And does Maven Tomcat plugin in Maven 3 runs the Tomcat 7 by default.
Thanks.
This works for me: http://tomcat.apache.org/maven-plugin-2.1/
With this plugin config:
And running with
(Please note that
tomcat7:run
, nottomcat:run
.)Plugin documentation is here: http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/plugin-info.html
For example, the default value of
additionalConfigFilesDir
is${basedir}/src/main/tomcatconf
, so if you put your configs into this directory it will be used ontomcat7:run
.mvn -X tomcat7:run
prints the configration, for example:Note that
warSourceDirectory
points tosrc
(nottarget
), so it runs as an usual dynamic web project, you could change your JSPs, HTMLs and it will visible immediately. That's why thetarget/tomcat/webapps
folder is empty.