2
votes

I'm trying to set up Jenkins so that when it builds a Maven Job, it should set the build name of that build to include, somehow, the Maven version of that project. If I can't get it to work for all builds, I'd like it to at least work on a maven release.

I've looked into both the Build Name Setter plugin (which is fairly underpowered IMO) and the M2 Release Plugin (which we already use).

I see that the Build Name Setter plugin has access to Environment variables, and I was considering checking whether or not the M2 Release Plugin set any.

I also had a look at this question on SO: Getting Maven Version in Jenkins

This is some interesting information...Maybe I could modify the Build Name Setter plugin to use some of the code listed there?

Do you guys have any ideas?

1

1 Answers

2
votes

I ended up adding code to the M2 Release Plugin (Open Source FTW) to offer the option of appending the version number to the build name on successful builds. I made a Pull request on GitHub a week ago and I haven't heard back (which is fine, it's totally up to them), but I figured I'd mention my solution for anybody that might stumble across this page in the future.