title: Maven profile not deploying to correct tomcat using maven-tomcat-plugin
body: <p>So my Maven doesn't want to pickup the right profile, doesn't matter how I tell it:</p>
  
  <p><code>mvn -Denv=dev tomcat7:deploy-only</code> or <code>mvn -P dev -Denv=dev tomcat7:deploy-only</code></p>
  
  <p>I have two servers configured on my <code>settings.xml</code> and have my configuration below pointing to the correct ones.</p>
  
  <p>Using <code>mvn -X</code> it seems that Maven is always picking up the last server in order it appears on the file, which means it's picking up the <code>prod</code> server.</p>
  
  <p>Any clues anyone? Thank you!</p>
  
  <p>Here's my <code>&lt;profiles&gt;</code>:</p>
  
  <pre><code>&lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;dev&lt;/id&gt;
    &lt;activation&gt;
      &lt;property&gt;
        &lt;name&gt;env&lt;/name&gt;
        &lt;value&gt;dev&lt;/value&gt;
      &lt;/property&gt;
    &lt;/activation&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.0-beta-1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;server&gt;dev&lt;/server&gt;
            &lt;url&gt;http://localhost:8080/manager/text&lt;/url&gt;
            &lt;username&gt;tomcat&lt;/username&gt;
            &lt;password&gt;tomcat&lt;/password&gt;
            &lt;path&gt;/&lt;/path&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
  &lt;profile&gt;
    &lt;id&gt;prod&lt;/id&gt;
    &lt;activation&gt;
      &lt;property&gt;
        &lt;name&gt;env&lt;/name&gt;
        &lt;value&gt;prod&lt;/value&gt;
      &lt;/property&gt;
      &lt;jdk&gt;1.6&lt;/jdk&gt;
    &lt;/activation&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.tomcat.maven&lt;/groupId&gt;
          &lt;artifactId&gt;tomcat7-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.0-beta-1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;server&gt;prod&lt;/server&gt;
            &lt;url&gt;http://remote/manager/text&lt;/url&gt;
            &lt;username&gt;usr&lt;/username&gt;
            &lt;password&gt;pwd&lt;/password&gt;
            &lt;path&gt;/&lt;/path&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>