Conditional build steps for maven projects

568 views
Skip to first unread message

varun srivastava

unread,
Feb 17, 2014, 2:13:43 AM2/17/14
to jenkins...@googlegroups.com
Hi, 

How can I run conditional steps with Maven projects ? For free style projects I am able to set up conditional steps but this seems not available with Maven projects. 

Additionally I also want to publish findbugs/pmd reports conditionally in maven projects. Again this looks possible using flexible publish plugin only for free style projects. 

Any help would be highly appreciated. 

-Thanks

Eric Pyle

unread,
Feb 17, 2014, 2:37:20 PM2/17/14
to jenkins...@googlegroups.com
You can run a Maven build in a freestyle job. Add a build step of type "Invoke top-level Maven targets". Then you can use conditional build steps and all other features of freestyle builds.

Regards,
Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

varun srivastava

unread,
Feb 17, 2014, 2:43:56 PM2/17/14
to jenkins...@googlegroups.com
Thanks for the reply.

I have tried this. But the disadvantage is that I loose features related to maven projects like Displaying modules built, modules history etc. (For multi-module maven projects) 


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/7evg1xPffd8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Thanks,

Varun Kr Srivastava
mobile- +919666676033

Stephen Connolly

unread,
Feb 17, 2014, 3:14:23 PM2/17/14
to jenkins...@googlegroups.com
Ah but the advantage is you have a reproducible build... Unlike a build with the evil job type
Sent from my phone

Maciej Jaros

unread,
Feb 18, 2014, 1:53:57 AM2/18/14
to jenkins...@googlegroups.com
varun srivastava (2014-02-17 08:13):
Hi, 

How can I run conditional steps with Maven projects ? For free style projects I am able to set up conditional steps but this seems not available with Maven projects.

Conditional steps are available both after and before Maven is build is run (in Pre/Post steps). I'm not sure what is missing? I'm assuming you have Conditional BuildStep Plugin?

Note that you can also add "Conditional steps (multiple)" and inside that add e.g. call to a different job (with Parameterized Trigger Plugin).


Additionally I also want to publish findbugs/pmd reports conditionally in maven projects. Again this looks possible using flexible publish plugin only for free style projects.

You can run Findbugs and other tests within Sonar and you can have a step "Invoke Standalone Sonar Analysis" within "Conditional steps (multiple)". Haven't tried that myself (we have a separate job for full tests), but that seems possible.

Cheers,
Nux.

srivastv

unread,
Feb 13, 2014, 6:41:19 AM2/13/14
to jenkins...@googlegroups.com
Hi,

How can I run conditional steps with Maven projects ? For free style
projects I am able to set up conditional steps but this seems not available
with Maven projects.

Additionally I also want to publish findbugs/pmd reports conditionally in
maven projects. Again this looks possible using flexible publish plugin only
for free style projects.

Any help would be highly appreciated.

-Thanks



--
View this message in context: http://jenkins-ci.361315.n4.nabble.com/Conditional-build-steps-for-maven-projects-tp4690508.html
Sent from the Jenkins users mailing list archive at Nabble.com.
Reply all
Reply to author
Forward
0 new messages