title: Maven: If sentences in pom.xml in the property tag
body: <p>I'd like to set a property if an environment variable is set. I googled a lot on it and all I found is something similar to the code below, but I keep getting the error:</p>
  
  <blockquote>
    <p><strong><em>[FATAL] Non-parseable POM Y:\Maven\parent-pom\pom.xml: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG
    s een ...roperties"\r\n<br>
    classpathref="maven.plugin.classpath" />... @29:55)  @ line 29, column
    55</em></strong></p>
  </blockquote>
  
  <p>That's the code I'm trying, its inside a pom.xml and I ran the command -</p>
  
  <p><em>mvn --errors deploy</em></p>
  
  <p>Of course, I'll be happy to get any other solution, if you have other suggestion on how to set a property in pom.xml depending on an environment variable content.</p>
  
  <p>Thanks,
  Eli</p>
  
  <pre><code>    &lt;distributionManagement&gt;
         .....
      &lt;/distributionManagement&gt;
  
      &lt;properties&gt;
            &lt;tasks&gt;
          &lt;taskdef resource="net/sf/antcontrib/antcontrib.properties"
            classpathref="maven.plugin.classpath" /&gt;
  
          &lt;if&gt;
             &lt;condition&gt;
               &lt;equals arg1="${env.WAS60_HOME}" arg2=""\&gt;
             &lt;/condition&gt;
             &lt;then&gt;
               &lt;was60.home&gt;${env.WAS60_HOME}&lt;/was60.home&gt;
               &lt;javac&gt;${was60.home}/java/bin/javac&lt;/javac&gt;
             &lt;/then&gt;
          &lt;/if&gt;
  
           &lt;if&gt;
             &lt;condition&gt;
               &lt;equals arg1="${env.WAS85_HOME}" arg2=""\&gt;
             &lt;/condition&gt;
             &lt;then&gt;
               &lt;was85.home&gt;${env.WAS85_HOME}&lt;/was60.home&gt;
               &lt;javac&gt;${was85.home}/java/bin/javac&lt;/javac&gt;
             &lt;/then&gt;
          &lt;/if&gt;
        &lt;/tasks&gt;
  &lt;/properties&gt;
      &lt;profiles&gt;
         &lt;profile&gt;
      &lt;id&gt;was.base.v60&lt;/id&gt;
              &lt;dependencies&gt;
                 &lt;dependency&gt;
                   ....
                    &lt;systemPath&gt;${was60.home}/java/jre/lib/xml.jar&lt;/systemPath&gt;
                 &lt;/dependency&gt;
                 .....
              &lt;/dependencies&gt;
          &lt;/profile&gt;
          &lt;profile&gt;
      &lt;id&gt;was.base.v85&lt;/id&gt;
              &lt;dependencies&gt;
                 &lt;dependency&gt;
                   ....
                    &lt;systemPath&gt;${was85.home}/java/jre/lib/xml.jar&lt;/systemPath&gt;
                 &lt;/dependency&gt;
                 .....
              &lt;/dependencies&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  </code></pre>