maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ziga GREGORIC <>
Subject Re: Adding the path to the pom file as a variable.
Date Thu, 02 Jan 2014 19:37:20 GMT
I have to agree with Wayne here - this setup is not easy to understand.
Since my setup consists of TeamCity and SonarSource, here are my 2 cents.

Is this a maven project?
Can it be build simply with 'mvn clean install'?

If both answers are yes, than have a:
- build configuration in TeamCity that builds it using project's pom.xml
using goal 'mvn clean install' and
- another build configuration that has a goal 'sonar:sonar' and you're
Leave the checkout directory as default and make sure you use the same
build agent to run both build configurations.
All sonar specific environment settings can be moved to settings.xml of the
build agent.

On Thu, Jan 2, 2014 at 8:14 PM, onlypq <> wrote:

> Thanks Wayne...
> In Teamcity I am trying to use maven to run Sonar to analyze a projects.
> When the projects build I need to execute Sonar in that directory, which
> the
> directories are created using a revision number so they will always be
> different.
> When the project builds it creates a text file (POMlastbuild3.0.txt) which
> has the build dir path. I then check out  my pom file into that dir...
> below is the command line script I run from TeamCity
> POMPATH=` cat /home/pomfiles/POMlastbuild3.0.txt`
> export POMPATH
> svn co $POMPATH
> export
> PATH=/home/teamcity/maven-3.0.3/apache-maven-3.0.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> export M2_HOME=/home/teamcity/apache-maven-3.0.5
> export PATH=/usr/java/jdk1.6.0_21/bin:$PATH
> export JAVA_HOME=/usr/java/jdk1.6.0_21
> mvn sonar:sonar
> -Dsonar.jdbc.url=jdbc:postgresql://
> -Dsonar.jdbc.username=sonar -Dsonar.jdbc.password=sonar1dev
> -Dmaven.test.failure.ignore=true
> But when maven runs it looks for the pom in a directory Teamcity created.
> Do not know if i am doing this correctly, but I think all I need to do is
> use $POMPATH in the maven command so it can find the pom.
> Thank you for your help
> --
> View this message in context:
> Sent from the Maven - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message