Accessing Maven Build Info about modules


in the Maven Build Info, I can access the version of all the modules in the reactor build. In the list of parameters accessible across the UI, I only see the version of the parent pom, not the ones of the modules. Is there a way to access those?


Comment actions Permalink


Maven build info is collected during the build and uploaded to the TeamCity server at the end of the build. There is no way to refer to it's content in configuration UI except for limited set of data described as Provided parameters

Why do you need to access your modules versions in the TeamCity UI?

Comment actions Permalink

Hi Nikita,

we use TC for CI but also for deployments where a build configuration is used for deploying a Maven artifact. The artifact is the outcome of a module build in a multi-module Maven project. I'd like to use the version of this artifact as the build number so one can see at a glance which artifact version has been deployed last. Unfortunately, the version of the parent pom is not the same as the module version, therefore I have to access the module version. For this purpose, it doesn't matter much that the information would only be available after the build finished.

Is there any way a custom plugin could accomplish this?

Best regards,

Comment actions Permalink


I am not aware of TeamCity plugins that can help, but I can suggest a workaround using maven plugin.

You can set TeamCity build number value from inside your Maven build using Ant plugin like this:

                    <echo>##teamcity[buildNumber '${pom.version}']</echo>

add this plugin section to pom.xml (or profile) of module you want to use.
Hope, it helps.

Comment actions Permalink

That's perfect, thank you!



Please sign in to leave a comment.