Jenkins conditional steps for maven project -


I use Jenkins for continuous integration.

How can I run conditional steps with Maven projects? I am able to establish conditional steps for free style projects but this is not available with Maven projects.

In addition to this, I want to publish conditionalback / PMD reports in Maven projects conditionally. Then it is possible to use the flexible publishing plugin only for free style projects.

Any help will be highly appreciated

- thanks

You can add a profile to your POM and it can only be activated when a variable exists (for example, determined by Jenkins). Slightly like this:

  & lt; Profile & gt; & Lt ;! - By default, Jenkins defines a property BUILD_NUMBER, which is used to enable profiles - & gt; & Lt; Profile & gt; & Lt; ID & gt; Coverage & lt; / Id & gt; & Lt; Activation & gt; & Lt; Property & gt; & Lt; Name & gt; Env.BUILD_NUMBER & lt; / Name & gt; & Lt; / Property & gt; & Lt; / Activation & gt; & Lt; Construction & gt; & Lt; / Create & gt; & Lt; / Profile & gt; & Lt; / Profile & gt;   

Alternatively, you can manually add some profiles in the Jenkins command line by adding:

  mvn-P coverage  < / Pre>  

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -