I have a large build where tests sometimes prevent creation of artifacts because they stall or terminate the build due to make module timeout. I'd like my build server to:
At present unit and integration tests execute during each module's test and integration test phases in the typical maven way. This is great for developers but places risk of lack of build. The build server can easily setup a build/publish step by skipping the tests and I'd like to run a testing only test that skips process-resources through package phases just running the tests. However, I'm fairly certain that maven will traverse all the previous stages again.
I'd like to avoid lengthening an already quite long build by needlessly rebuilding and repackaging my artifacts.
Has anyone split a maven build like this so the desktop developers get the benefit of test integration and the build server / continuous integration system get's the benefit of pushing risky tests to the end of the process so we always produce artifacts?
Am I trying to break the build up in the wrong fashion and should consider changing a monolithic end-to-end build in a series of smaller component builds?
Thanks
Peter
Here's how you can do this:
Like so:
mvn install -DskipTests
mvn surefire:test failsafe:integration-test
If you have to do this all on one command line line, I'm sure you can figure something out by having two profiles. One that skips tests and one that only runs tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With