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:

  • 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

6 comments
Comment actions Permalink
Hi Florian,
Sorry for the late response. Can I see the full build log?
Thank you.
0
Comment actions Permalink

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
0
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

I've filed this issue as TW-17709. Please watch for its updates.


Thanks

0
Comment actions Permalink

Thanks and I updated in the community discussion thread as well.

0

Please sign in to leave a comment.