I'm wondering if a whole 'nother approach would work for you. It really depends on your workflow, but I submit it for your consideration.
Doing 'mvn compile war:inplace' will cause maven to copy the .class files to web-inf/classes and the pom dependencies to web-inf/lib so that you can do your gui testing in place. I'd also suggest setting up your source control to ignore these folders. I've done it with subversion, but don't recall the syntax. To go a step further, add those directories to the 'clean' plugin in your pom like this: <plugin> <artifactId>maven-clean-plugin</artifactId> <configuration> <filesets> <fileset> <directory>${basedir}/src/main/webapp/WEB-INF/lib</directory> </fileset> <fileset> <directory>${basedir}/src/main/webapp/WEB-INF/classes</directory> </fileset> </filesets> </configuration> </plugin> Now you can do 'mvn clean package' to get a pristine war. Does that meet your overall goal? -Greg Vaughn "Julian Wood" <[EMAIL PROTECTED]> wrote on 03/02/2007 02:35:48 PM: > I'm actually beginning to think this is not possible with the way the > war plugin currently works. You are always going to have either both > sets of jars, or neither set. The reason is because the war plugin > seems to do its excludes at the last possible moment, so it can't > differentiate between the two sources. > > I think the pom snippet which should work is this one: > > <configuration> > <warSourceExcludes>**/*.jar</warSourceExcludes> > </configuration> > > I execute mvn clean package > > In the target folder, in the "webappDirectory" in maven-war-plugin > nomenclature (http://maven.apache.org/plugins/maven-war-plugin/war- > mojo.html), it creates the perfect webapp (minus the META-INF). That > is, it has everything from src/main/webapp, with the exception of any > jars from src/main/webapp/lib. It does have a lib directory, > assembled from the dependencies in the pom. This is seldom identical > to the lib directory at src/main/webapp/lib, but that's okay (that's > the point, actually). This webapp works perfectly. > > Now unfortunately, the war plugin doesn't simply make a war from that > directory it just built. First it wars it, then it grabs all the > files from src/main/webapp again, and then it applies any excludes > (again). So in this situation, I get no jars at all in the lib folder > of the final war file. > > That's why if I specify no excludes at all, I get all the jars from > the src/main/webapp/lib and all the jars from the dependencies. > > I'm not sure if this should be labeled a bug with the war plugin or > not. I haven't looked at the code - it is all surmised from what it > produces. > > I think my best bet might be to do an antrun to move the lib folder > before the war is generated, and move it back afterwards, which is > what I do manually right now. > > Thanks, > > J > > > > On 28-Feb-07, at 4:36 PM, Julian Wood wrote: > > > In my src/main/webapp/WEB-INF I have a classes folder and a lib > > folder, which are not part of the source, but let me compile in > > place and immediately see the results of my changes in tomcat. > > > > Now when I go to actually build a war using maven, I don't want > > that lib nor classes folder - I want the one which maven generates. > > In its default state, using version 2.0.2 of the war plugin, what > > happens is that you get both sets - in the lib folder for example, > > you get everything in my "dev" lib folder, plus any new snapshots > > or new dependencies maven might have downloaded. So usually you end > > up with duplicate jars. Not good. > > > > How do you tell the war plugin to ignore src/main/webapp/WEB-INF/ > > lib and classes (but not ignore the ones assembled during > > compilation)? > > > > No matter what configuration I use, it always either ignores both > > sets, or includes both sets. > > > > Thanks, > > > > J > > > > -- > Julian Wood <[EMAIL PROTECTED]> > > Software Engineer > Teaching & Learning Centre > University of Calgary > > http://tlc.ucalgary.ca > > ====================================================================== Confidentiality Notice: The information contained in and transmitted with this communication is strictly confidential, is intended only for the use of the intended recipient, and is the property of Countrywide Financial Corporation or its affiliates and subsidiaries. If you are not the intended recipient, you are hereby notified that any use of the information contained in or transmitted with the communication or dissemination, distribution, or copying of this communication is strictly prohibited by law. If you have received this communication in error, please immediately return this communication to the sender and delete the original message and any copy of it in your possession. ======================================================================