我想在pom.xml中转义属性。不是在资源中,我知道可以使用过滤器。例如,我尝试使用launch4j插件这样的:pom.xml中的转义属性
<plugin>
<groupId>org.bluestemsoftware.open.maven.plugin</groupId>
<artifactId>launch4j-plugin</artifactId>
<executions>
<execution>
<id>l4j-cli</id>
<phase>install</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<outfile>../out.exe</outfile>
<dontWrapJar>true</dontWrapJar>
<jar>./../out.jar</jar>
<icon>../icon.ico</icon>
<chdir>.</chdir>
<customProcName>true</customProcName>
<downloadUrl>http://www.oracle.com/technetwork/java/javase/downloads/index.html</downloadUrl>
<classPath>
<mainClass>com.stack.Main</mainClass>
<addDependencies>true</addDependencies>
<jarLocation>./lib</jarLocation>
</classPath>
<jre>
<opts>
<opt>-DconfigBasePath=${ALLUSERSPROFILE}/dir</opt>
</opts>
</jre>
</configuration>
</execution>
</executions>
</plugin>
和$ {} ALLUSERSPROFILE必须不被行家进行解释,而是由程序通过launch4j产生。 我尝试:
\${ALLUSERSPROFILE}
\\${ALLUSERSPROFILE}
$${ALLUSERSPROFILE}
和
<properties>
<dollar>$</dollar>
</properties>
${dollar}{ALLUSERSPROFILE}
,但没有工作。
根据[该线程](http://maven.40175.n5.nabble.com/escape-some-value-td122820.html),'$$ {ALLUSERSPROFILE}'应该工作。 –
我看到了这个主题,但它不起作用 – EFalco
发布了一个完整的POM,它可以用于开箱即用,并重现错误。 – palacsint