How to quickly deploy jsp file using tomcat7-maven-plugin?

I am using tomcat7 with the tomcat-maven plugin. I can do this hotswap my jsp, but it only works if I change it directly to the target. How can I make tomcat also look for changes in my sources directory?

pom.xml

<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <serverXml>${project.build.directory}/config/tomcat-config/${usingDb}/server.xml</serverXml> <tomcatUsers>${project.build.directory}/config/tomcat-config/tomcat-users.xml</tomcatUsers> <configurationDir>${project.build.directory}/config/tomcat-config</configurationDir> <additionalClassesDirs> <classesDir>${project.basedir}/src/main/webapp</classesDir> </additionalClassesDirs> <contextReloadable>true</contextReloadable> <port>${tomcat.http.local.port}</port> <path>/${url.contextPath}</path> </configuration> </plugin> 
+8
maven maven-tomcat-plugin
source share
3 answers

It depends on how you use / run the maven plugin. Running it with

 mvn tomcat7:run 

must do the trick (compared to winning or any other goal). See http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/plugin-info.html for details

This will actually reload the context in your tomcat. I am not sure that an actual β€œhot swap” without reloading the context is possible without third-party libraries / plugins like jrebel or the like.

+3
source share

You should be able to launch a war: the blasted maven target, so that your changes are copied from your source directory to the destination directory.

+1
source share

Change the workspace in Eclipse to \ tomcat \ webapps. Since this is just for your work, this should work fine. Regardless of the changes you make to Eclipse, tomcat searches for deployment applications in the same directory

0
source share

All Articles