I have two maven profiles
- buildProfile
- testProfile
So whenever i do
mvn clean install -P buildProfile
it should activate testProfile implicitly first and if testProfile fails it should not proceed to buildProfile and mark the result as Failure.
i want testProfile to be activated only when i run buildprofile.
mvn clean install -P buildprofile --> testProfile(if testProfile success then proceed to buildProfile) + buildProfile
mvn clean install -P anotherProfile ---> anotherProfile
is there anyways to achieve this?
Yes. You can do this by using Jenkins. In Jenkins you will have to create 2 jobs, 1 for buildProfile and another for testProfile... and you can create dependency between these two jobs that 'buildProfile' should run only if the 'testProfile' gets passed (complates without any test failures)