problem with %maven.project.version% and or %build.number% as build step argument
Hi,
I am trying to use the versions plugin to alter the pom dependencies but it just won't set the variable in time.
I can get this done using a script but with the new build steps feature in 6.0.3 (build 15925) I thought I should be able to do this without the need for a script.
It seems that some variables get resolved to late in the build execution:
[16:39:03]: [com.imc.ids:ids-server-embedded] [INFO] Processing com.imc.ids:ids-server-embedded
[16:39:03]: [com.imc.ids:ids-server-embedded] [INFO] Updating project com.imc.ids:ids-server-embedded
[16:39:03]: [com.imc.ids:ids-server-embedded] [INFO] from version 10.0.0-SNAPSHOT to %build.number%
in the general tab:
In a maven build step:
in the general tab:
- Build number format: %maven.project.version%-SNAPSHOT.{0}
In a maven build step:
-
Goals: versions:set
- Additional Maven command line parameters : -DnewVersion=%build.number%
Anyone know if this is possible and just doing something wrong?
cheers,
Florian
Please sign in to leave a comment.
Here is the log file.
I have had to re-construct my build steps as they were. I beleive this is it. I have two build steps. One that sets the version using the versions plugin and the other that does the build.
cheers,
florian
Attachment(s):
SA_-_IDS_-_v10.0.x-SNAPSHOTS_IDS_API_-SNAPSHOT.16.log.zip
Florian,
There are some limitations with "maven.*" properties in TeamCity prior to 6.5.
1. They can be used only in build number patern
2. They are resolved in a tricky way at a very late stage after the standard resolution engine has finished its work. There are no means of getting the resolved build number with "maven.*" references in the build process.
They can be used only to indicate build number in the server UI.
Now in 6.5 this problem is solved. Please consider upgrading.
Hi Sergey,
I am having the same problem in Teamcity 6.5.2. The build.number is set to the pattern %maven.project.version%_{0}. When the agent calls maven the build number is passed in as -Dbuild.number=???_89 (based on build counter). How do I fix this?
Thanks,
Rajesh
I've filed this issue as TW-17709. Please watch for its updates.
Thanks
Thanks and I updated in the community discussion thread as well.