【发布时间】:2011-10-13 09:00:14
【问题描述】:
我想转义 pom.xml 中的一个属性。不在资源中,我知道可以使用过滤器。例如,我尝试像这样使用 launch4j 插件:
<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} 不能由 maven 解释,而是由 launch4j 生成的程序解释。 我试试:
\${ALLUSERSPROFILE}
\\${ALLUSERSPROFILE}
$${ALLUSERSPROFILE}
和
<properties>
<dollar>$</dollar>
</properties>
${dollar}{ALLUSERSPROFILE}
但没有任何效果。
【问题讨论】:
-
根据this thread,
$${ALLUSERSPROFILE}应该可以工作。 -
我看到了这个帖子,但它不起作用
-
发布一个完整的 POM,它可以开箱即用并重现错误。
-
\u0024 为我工作