Я хотел бы установить свойство, если установлена переменная среды. Я много гуглил, и все, что я нашел, похоже на код ниже, но я продолжаю получать сообщение об ошибке:
[FATAL] Неанализируемый POM Y:\Maven\parent-pom\pom.xml: за TEXT должен следовать END_TAG, а не START_TAG (позиция: START_TAG s een ...properties"\r\ n
classpathref="maven.plugin.classpath" />... @29:55) @ строка 29, столбец 55
Это код, который я пробую, он внутри pom.xml, и я выполнил команду -
mvn --errors развертывание
Конечно, я буду рад получить любое другое решение, если у вас есть другое предложение о том, как установить свойство в pom.xml в зависимости от содержимого переменной среды.
Спасибо, Эли
<distributionManagement>
.....
</distributionManagement>
<properties>
<tasks>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<if>
<condition>
<equals arg1="${env.WAS60_HOME}" arg2=""\>
</condition>
<then>
<was60.home>${env.WAS60_HOME}</was60.home>
<javac>${was60.home}/java/bin/javac</javac>
</then>
</if>
<if>
<condition>
<equals arg1="${env.WAS85_HOME}" arg2=""\>
</condition>
<then>
<was85.home>${env.WAS85_HOME}</was60.home>
<javac>${was85.home}/java/bin/javac</javac>
</then>
</if>
</tasks>
</properties>
<profiles>
<profile>
<id>was.base.v60</id>
<dependencies>
<dependency>
....
<systemPath>${was60.home}/java/jre/lib/xml.jar</systemPath>
</dependency>
.....
</dependencies>
</profile>
<profile>
<id>was.base.v85</id>
<dependencies>
<dependency>
....
<systemPath>${was85.home}/java/jre/lib/xml.jar</systemPath>
</dependency>
.....
</dependencies>
</profile>
</profiles>