Hi Martijn,

  How did you ensure that the maven settings.xml file is used by your build
? Did you manually deployed it on the slave where the job is executed or by
using a plugin like the Config File Provider ?
  What you did seems good, thus I think that the problem is that Maven
doesn't see at all your settings.xml file

cheers

On Tue, Feb 9, 2016 at 2:50 PM, Martijn Hiemstra <[email protected]>
wrote:

> I have a maven project and locally everything perfectly. When I do maven
> tomcat7:redeploy everything works perfectly. When I run that same project
> on Jenkins then the wrong profile properties are loaded.
>
> This is the situation. In my pom.xml in the build plugins section I have
> this:
>
> <plugin>
> <groupId>org.apache.tomcat.maven</groupId>
> <artifactId>tomcat7-maven-plugin</artifactId>
> <version>2.2</version>
> <configuration>
> <server>${tomcat-server}</server>
> <url>${tomcat-url}</url>
> <path>${tomcat-context}</path>
> </configuration>
> </plugin>
>
> In my settings.xml I have this:
>
>   <profiles>
>     <profile>
>       <id>tomcat-localhost</id>
>       <properties>
>         <tomcat-server>local.server</tomcat-server>
>         <tomcat-url>http://localhost:8080/manager/text</tomcat-url>
>         <tomcat-context>/MyProject</tomcat-context>
>       </properties>
>     </profile>
>     <profile>
>       <id>tomcat-test</id>
>       <properties>
>         <tomcat-server>test.server</tomcat-server>
>         <tomcat-url>http://10.101.55.43:8080/manager/text</tomcat-url>
>         <tomcat-context>/</tomcat-context>
>       </properties>
>     </profile>
>   </profiles>
>
> in the servers section I have defined the username and passwords for the
> servers. Now I configure my Maven project in Jenkins and in the maven
> section I set this in the goals and options field:
>
> tomcat7:redeploy -P tomcat-test
>
> This means that Jenkins should load the properties of the profile with id
> tomcat-test however when the war file gets uploaded I see this in the job
> console:
>
> Uploading:
> http://localhost:8080/manager/text/deploy?path=%2FMyProject&update=true
>
> Even though I have clearly indicated that maven should load
> the tomcat-test properties, it loads the tomcat-localhost instead. Outside
> of Jenkins, locally on my machine, it works properly.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/3182dd36-d761-42de-ab65-544e742fa131%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/3182dd36-d761-42de-ab65-544e742fa131%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-----
Arnaud Héritier
http://aheritier.net
Mail/GTalk: aheritier AT gmail DOT com
Twitter/Skype : aheritier

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAFNCU--V-VRwcBzggC1cg1pX046pjOoS-%2BJszoiBUHYsN3mmww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to