Hi, all! Please, help me with my problem.
In Maven step I used goals: "clean install sonar:sonar -Dsonar.forceAnalysis=true -Dsonar.branch=[%teamcity.build.branch%]".
Later I added configuration parameter "sonar_goals", and set it to "sonar:sonar -Dsonar.forceAnalysis=true -Dsonar.branch=[%teamcity.build.branch%]".
After that my Maven goals looked like: "clean install %sonar_goals%".
So, the problem.
In case of building master branch Maven step is failing because %teamcity.build.branch% returns value "<default>", and '<>' are illegal characters, which can't be passed to sonar plugin.
I decided to make command line step, which will go before Maven and check if %teamcity.build.branch% equals** <default>.
if [ "%teamcity.build.branch%" = "" ]
echo "Building master branch"
Original message URL: http://devnet.jetbrains.net/message/5488504#5488504