我想在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