[SOLVED] Pom.xml dependency version


This is somewhat straying outside scope of TeamCity, but...

We have created our own set of base kotlin scripts and added it as a dependency into pom.xml file. This actually works well, but it seems we need to raise version in the pom.xml file whenever we publish a new version. This is a problem as we planned to extend usage of this base onto dozens of build projects. Having to do 20 pull requests whenever we want to change anything in the base sounds kinda crazy

As an example currently the repository contains versions 1.0.0, 1.0.0-snapshot-1, 1.0.0-snapshot-2, 1.1.0

From docs:

> Maven picks the highest version of each project that satisfies all the hard requirements of the dependencies on that project

Apparently LATEST keyword has been removed. Whenever I use specific version it's selected correctly (any of the above). But using any range like [1.1.0,), (0.0,), [1.1.0, 2.0.0] always results in v 1.0.0 being picked. Even [1.1.0,something picks 1.0.0 which should not be possible I'd think. Am I doing something wrong?

Alternatively does perhaps TeamCity allow some modification of pom.xml before its application? Like setting some global property which would allow us to change the version in one place and be applied in many repositories' .teamcity settings?


Comment actions Permalink

Now that I think about it ... if we achieve that we don't need to update all consumers whenever the dependency changes, now TeamCity will not fetch new changes if the base changes until a new build. Until then all non-build configuration (snapshot dependencies, description etc.) will not be updated

Is there any solution to this? Can VCS settings be updated / recompiled somehow automatically / periodically / via API or something?

Comment actions Permalink

Looks like there is a ticket https://youtrack.jetbrains.com/issue/TW-58754?_ga=2.9353973.1970866111.1592910988-1236548174.1551875989

and there is a workaround so it possibly can even be automated

Comment actions Permalink

So an imperfect solution is to use snapshot and keep the same version + use the workaround above to force updates


Please sign in to leave a comment.