Mine is a maven based java project and for continuous integration I am using Teamcity. For some purpose ( deploy Snapshot and release ) I need to overwrite project version within team city. I have tried using maven.project.version and project.version in build step Paramus but no luck. Currently mentioning it in pom.xml in tag Please suggest.
It all depends on what you want to do. Do you want to set the version, build, test and if successful update/tag your VCS? If that is the case, then you probably want to take a look at the release
plugin and a combination of the goals that it provides. If you only want to change the version and then build, then the versions:set
goal will suffice. If might be helpful if you specify exactly what is your scenario and what do you want to accomplish with your build.