Maven Console and setting properties
I've been using Maven at my new gig and the Maven Console in order to avoid its painfully slow startup times. Using a slow-ass PowerBook in conjunction with Maven makes my face turn read and my ears smoke sometimes, but I'm getting used to it, much to my dismay. While the console has made things tolerable, Maven itself keeps getting in the way. I hate how it *requires* me to run my tests everytime I build or deploy. So I've turned that off by creating a build.properties file with "maven.test.skip=true". The problem with the Maven Console is it doesn't let me turn tests back on, so I'm stuck with running "maven test -Dmaven.test.skip=false" when I want to run my tests.
There's two ways I can think of to solve this problem:
- If "maven idea:multiproject" allows me to setup my project so that Tomcat/Resin/whatever can point to my source directory and I don't have to deploy. I'm a web developer, and I typically have to run "maven deploy" to test simple UI changes. That's why I turn the tests off - because I want a 1-2 second turnaround to see my changes. BTW, it's too bad there's no "eclipse:multiproject" goal.
- Enhance the console so it's possible to set properties. For example, typing "-Dmaven.test.skip=false" would set the property so the next time I run "maven war", my tests would be run. That, or allow me to run "maven war -Dmaven.test.skip=false". Allowing this would also make it possible to run a single test from the command line, instead of all (the only current option).
Posted by Norm Deane on January 20, 2005 at 05:54 PM MST #
My main issue is I want to turn on/off running of tests when using the console. Since the console doesn't allow setting of properties - (AFAIK) this is not currently possible.
Posted by Matt Raible on January 20, 2005 at 06:01 PM MST #
By skipping the prereq on war:webapp you'll skip running the tests. I've looked through the console plugin and I don't see any way to set properties from within a maven console session.
Posted by Norm Deane on January 20, 2005 at 06:25 PM MST #
Then, at your console prompt,
If you don't want to skip the tests,
should do it.
Posted by Sri Sankaran on January 20, 2005 at 06:33 PM MST #
Posted by Rick Hightower on January 20, 2005 at 10:15 PM MST #
I've updated the doco to reflect this as I notice it didn't have anything. Thanks.
I tend to get Maven to do its thing in 3-10 seconds on an old P3 laptop - if you are getting worse performance I'd encourage you to come over to the Maven User's List so that we can find out what the problem is.
You can also use your IDE for deploying webapps like you mentioned. If you set
on your webapp's project.properties, maven idea:multiproject will generate a web module (IDEA 4.0+). I use this, and then have IDEA compile and copy the files directly into the servlet container. From IDEA 4.5+ you can also start Tomcat (in normal or debug mode) inside IDEA and have it deploy the webapp for you. I now use this all the time and find it to be most efficient.
This leaves Maven for CI, the site and making releases, or for users to build the product rather than day-to-day use; leaving that to the IDE which is what it does best. Horses for courses as they say.
Posted by Brett Porter on January 20, 2005 at 11:01 PM MST #
Posted by Wolfgang Groiss on January 21, 2005 at 07:38 AM MST #
Posted by 81.10.192.170 on January 21, 2005 at 07:40 AM MST #
Posted by Matt Raible on January 21, 2005 at 07:48 AM MST #
Posted by Todd Huss on January 21, 2005 at 05:55 PM MST #
Posted by Rob on January 24, 2005 at 06:52 AM MST #