You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by onlypq <on...@gmail.com> on 2014/01/02 17:50:54 UTC

Adding the path to the pom file as a variable.

Hello,

The location of my POM is dynamic, my script will create a variable to the
location of the pom file but I do not know how to enter that variable in the
maven command line.
Can that be done?

Thanks
pq



--
View this message in context: http://maven.40175.n5.nabble.com/Adding-the-path-to-the-pom-file-as-a-variable-tp5779909.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Adding the path to the pom file as a variable.

Posted by onlypq <on...@gmail.com>.
Thanks Ziga,

It's a little more complicated than that, sorry I have not explained it
clearly. Anyway, 
stephenconnolly suggestion did the trick :-)


Thanks guys



--
View this message in context: http://maven.40175.n5.nabble.com/Adding-the-path-to-the-pom-file-as-a-variable-tp5779909p5780026.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Adding the path to the pom file as a variable.

Posted by Ziga GREGORIC <zi...@gmail.com>.
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
done.
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 <on...@gmail.com> 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 https://atl-wdsvn1.abctm.org/svn/Pom/CDM $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.host.url=http://12.219.180.137:9000
> -Dsonar.jdbc.url=jdbc:postgresql://12.219.180.137/sonar
> -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:
> http://maven.40175.n5.nabble.com/Adding-the-path-to-the-pom-file-as-a-variable-tp5779909p5779945.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Adding the path to the pom file as a variable.

Posted by onlypq <on...@gmail.com>.
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 https://atl-wdsvn1.abctm.org/svn/Pom/CDM $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.host.url=http://12.219.180.137:9000
-Dsonar.jdbc.url=jdbc:postgresql://12.219.180.137/sonar
-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: http://maven.40175.n5.nabble.com/Adding-the-path-to-the-pom-file-as-a-variable-tp5779909p5779945.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Adding the path to the pom file as a variable.

Posted by Wayne Fay <wa...@gmail.com>.
> The location of my POM is dynamic, my script will create a variable to the
> location of the pom file but I do not know how to enter that variable in the
> maven command line.

Speaking only for myself, I am confused about your use case. Please
provide (a lot) more information about what you are doing, how you are
using Maven, what you are trying to achieve etc and perhaps someone
can reply back with helpful information.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Adding the path to the pom file as a variable.

Posted by Stephen Connolly <st...@gmail.com>.
mvn -f path/to/pom.xml


On 2 January 2014 16:50, onlypq <on...@gmail.com> wrote:

> Hello,
>
> The location of my POM is dynamic, my script will create a variable to the
> location of the pom file but I do not know how to enter that variable in
> the
> maven command line.
> Can that be done?
>
> Thanks
> pq
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Adding-the-path-to-the-pom-file-as-a-variable-tp5779909.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>