Reloading JSPs edited in Eclipse, run with tomcat7-maven-plugin

How can I get a Tomcat instance started with tomcat7-maven-plugin on the command line to reload JSPs when I edit and save them in Eclipse? It's of note that I don't want to start Tomcat via Eclipse, as I depend on some Maven plugin executions that m2e doesn't know how to map.

I start Tomcat thusly, on the command line:

mvn clean package -U tomcat7:run-war-only

Here is the configuration of the Tomcat plugin:

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <systemProperties>
            <spring.profiles.active>local</spring.profiles.active>
        </systemProperties>
        <path>/</path>
        <port>8080</port>
        <contextReloadable>true</contextReloadable>
    </configuration>
</plugin>

When I change and save a JSP in the source of the project, it'd be lovely if Tomcat could reload that without having to go through a full clean/compile/test/package/start cycle.

Answers


This can be done by adding a tomcat server plugin to your eclipse and then deploying your war in tomcat through eclipse and not from command line. If you do that, when you make any changes in JSP or Java, eclipse auto refreshes your war with out you manually triggering it.


Try

mvn clean package -U tomcat7:run

As run-war-only run a packaged war so won't see your code changes.

if you want debug in your ide use

mvnDebug clean package -U tomcat7:run

Then attach a debugger to port 8000

HTH


Need Your Help

How to set custom fill color in dygraph

javascript jquery colors fill dygraphs

By setting the property fillGraph: true , we can fill the dygraph with its default color. But how to fill it with a custom color?