Sunday, May 1, 2011

How do I control execution of Maven Jetty Plugin with -Dmaven.test.skip

I am using Jetty and Selenium to automate some unit tests from my Maven 2. We only really want to run these tests as part of the CI build and would like to control it via the -Dmaven.test.skip property.

I cannot find a way to apply this to the executions for the Jetty plugin. Am I missing something obvious?

From stackoverflow
  • see http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

    bmatthews68 : This link just refers me to the documentation which does not actually cover the use case.
    Michael Lange : hmm there is the automatic execution example (as part of test process) and if there is no test process (with -skip...) well then there is no jetty startup for it
  • The maven.test.skip property is a property that the surefire plugin looks at to decide if it should just skip. The jetty plugin doesn't care at all about this property. The only way to do this would move your jetty plugin execution to a profile and try activating it if the maven.test.skip property is false.

    bmatthews68 : This doesn't work if the -Dmaven.test.skip is omitted. It means that the solution is to create a profile specifically for the CI server and specify that as part of the build instruction.

0 comments:

Post a Comment