On Friday, Aug 29, 2003, at 08:59 Europe/London, James Strachan wrote:
No - unit tests are part of the build process and they should stay there.
Either that, or a not-build-but-everything-but-tests target should be created; I've not managed to find one in Maven so far (at least, one that does everything bar test).
I don't follow.
// to compile just the code & tests maven java:compile test:compile
You can disable the running of the unit tests if you wish via the maven.test.skip=true property which can be specified in your build.properties or on the command line. What more do you need?
In my experience in using Java projects (using ant, rather than maven; the latter is a bit new to me) there were separate 'build' and 'test' targets. I think there is benefit in a build-and-test target, but the problem is that a build is not just java:compile; dependent Jars need to be created, resources copied to appropriate locations and so forth.
IMNSO the targets would be beneficial if ordered:
build-and-test
+-- build-without-test
+-- java:compile, jar:jar etc. as is at the moment
+-- test
+-- test:compile
+-- test:test (or whatever the appropriate target is)That way, a developer could run build-and-test or build-without-test as desired.
No - unit tests are part of the build process and they should stay there.
Certainly I believe very strongly that there should be tests, and the ability to run them out-of-the-box. You could use whatever names you wanted for the above targets, so 'build-and-test == build' and 'build-without-tests' could have a different name.
But having this as a separate target, as opposed to having to run with setting maven properties (on command line, or in properties file) would be a nicer way of doing it. You could even set up the target 'build-without-test' to set the maven.test.skip and then call the original build process ...
Alex.
