如果某个环境变量已经设置了,我想要设置一个属性。我在Google上搜索了很多相关信息,但是我找到的全部都类似下面的代码,而且我一直收到以下错误消息:
[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 seen ...roperties"\r\n
classpathref="maven.plugin.classpath" />... @29:55) @ line 29, column 55 这就是我正在尝试的代码,它在pom.xml文件中,并运行了以下命令 - mvn --errors deploy 当然,如果你有其他建议,我会很高兴得到任何其他解决方案,以便根据环境变量内容在pom.xml中设置属性。 谢谢, Eli
classpathref="maven.plugin.classpath" />... @29:55) @ line 29, column 55 这就是我正在尝试的代码,它在pom.xml文件中,并运行了以下命令 - mvn --errors deploy 当然,如果你有其他建议,我会很高兴得到任何其他解决方案,以便根据环境变量内容在pom.xml中设置属性。 谢谢, Eli
<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>