To all who are developing web apps with Maven:

First, Maven is awesome. Much thanks to all the developers.

Ideally, every time I make a change to a web app, I'd like to test the changes without having to run 'maven war:webapp'. I looked, but didn't find any concrete tutorials on this, so here is a quick how to, using Tomcat as an example servlet container.

<project.home> will refer to the location of your Maven-enabled project.

1. in Tomcat's server.xml (e.g. <tomcat.home>/conf/server.xml) point the context for your web app to <project.home>/src/webapp

<Context path="/cart" docBase="/home/ericemminger/Projects/foo/src/webapp" reloadable="true"/>

2. in your build.properties, set maven.war.build=target/webapp

3. create symbolic links (good luck Windows users!) for the following
3.1. cd <project.home>/src/webapp/WEB-INF
3.2. ln -s ../../../target/classes
3.3. ln -s ../../../target/webapp/cart/WEB-INF/lib

4. remember to run 'maven war:webapp' once (after every clean) so that the sym links will work

5. start your application server

Now, Tomcat will automatically reload your web app when you change and compile your Java sources.

Please, add your comments, corrections, suggestions, etc. As I said, I looked in serveral places without finding this information, so I thought it might be valuable to others.

Eric


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to