Using a maven build maven version as a parameter in a dependent build

Hi,

I can't find a way nor documentation on how to do this: is there a way to use a build's Maven version as a parameter in another build (should have to be a dependent one).

Since my Maven build automatically builds new Git branches, +:refs/heads/hotfix/* in my case, I need to be able to know the latest artifact version uploaded to a central repo to be able to deploy it.

Hope my question is clear and that there's a way to do this in TC.

6 comments
Comment actions Permalink

This is a rather important issue for us in our continuous deplyment process, I wish I could get some help as I really have no clue on how to get this peace of information in a dependent build: the maven version

Thanks

0
Comment actions Permalink

Hello,

Sorry for delay.
Do I correctly understand that you want to pass parameters' values from one build configuration to dependent one? If yes, you can use dep.<buildId>.<propertie name> in the dependent build. For more details see: https://confluence.jetbrains.com/display/TCD9/Predefined+Build+Parameters#PredefinedBuildParameters-DependenciesProperties

0
Comment actions Permalink

Right, that's what I want to do.

But my real question is: how can I get a build's Maven Version as a property ?
I don't seem to be able to get this as a property.

Thanks

0
Comment actions Permalink

Build's maven version is stored in %maven.project.version% configuration parameter. You can find the list of all available properties on Build > Parameters page.

0
Comment actions Permalink

thanks, %dep.<buildID>.maven.project.version% is what I was looking for.
Somehow reading the doc, it wasn't clear to me this was possible.

Now I can trigger a deploy build with the dependent build maven version as a param.
I still have to manually change the Artifact Dependency watching branch as it doesn't support wildcard (https://devnet.jetbrains.com/thread/475158) to fully automate the deployment of hotfix branches.

0
Comment actions Permalink

Not all build parameters are documented. You can find the list of all defined parameters if you open build and go to Parameters tab.

0

Please sign in to leave a comment.