Jenkins pre-build check of pom.xml

62 views
Skip to first unread message

Andreas G.

unread,
Nov 17, 2015, 12:22:20 PM11/17/15
to Jenkins Users
Hi guys,

completely new to Jenkins and need help with a super simple thing. 

In my setup I would like to check if the "version" tag in the main pom.xml of our project has the correct value. And if it has not the correct value the build is supposed to fail. I looked around but my understanding of the "pre-build step" (which seems the correct place for this kind of stuff) is that should the script fail the build still carries on. 

Happy about any feedback.

--Andreas

Mark Bidewell

unread,
Nov 17, 2015, 9:06:21 PM11/17/15
to Jenkins Users
We do something similar to validate the connections section of a pom.  We use an ant script to do the validation. 

Baptiste Mathus

unread,
Nov 18, 2015, 12:02:43 PM11/18/15
to jenkins...@googlegroups.com

Using a simple freestyle job, just add a first step to check the pom.xml (use what works best for you: shell, ant...), then call the typical mvn build.

A failing step will fail the whole build immediately (hence not call the mvn build in that example)

Cheers

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cce35d18-7cd0-4f6d-884f-bb18ad2bd8a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages