On Wed, May 11, 2011 at 8:13 AM, Eric Jain <[email protected]> wrote: > I may just have run `mvn compile` and now want to run `mvn test` (and > later perhaps `mvn install`) without having Maven go through all the > preceding phases again -- even if it is smart enough to figure out > e.g. that nothing needs to be recompiled. Is this possible to get > Maven to trust me enough to allow this?
No. Maven runs the full lifecycle for you, its not like Ant where you invoke targets. Generally its much better to always run "mvn install". Since maven hands off to javac to do the compiling if it is up to date then there is no work to be done. You want to run your tests to make sure everything works (you can skip them with -DskipTests, see http://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-test.html) If you do most of your work inside an IDE then you can compile/test in there without the overhead of maven. Once you are ready to commit your stuff into version control, its always a good idea to run "mvn clean; mvn install" to make sure you have remembered to declare all the correct dependencies, that javac is being used to compile (instead of your IDEs compiler) and that all the tests work correctly. Generally this shouldn't take long, say a few minutes - but you do this infrequently since most of the time you are in the IDE. You also will want something like Jenkin running builds continuously to make sure that your stuff still works as people will forget to run mvn install before checking in (laziness, mistakes, etc) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
