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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3182dd36-d761-42de-ab65-544e742fa131%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to