java - pom.xml 中的转义属性

标签 java maven-2 launch4j

我想转义 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}

但没有任何作用。

最佳答案

$$ 为我工作 ${surefire.forkNumber} .

关于java - pom.xml 中的转义属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59264290/

相关文章:

java - 我按照这个 maven-glassfish-plugin 示例但是出现错误消息,为什么?

java - Launch4j maven 插件不能在 64 位 linux 机器上运行

java - 在 JAR/EXE 应用程序中 bundle JRE

java - 包装和使用安装程序后可执行文件不会在 Windows 上退出

java - 无法从 src/main/resources 加载dispatcher-servlet.xml

java - 远程 JMX 连接和通知的问题

java - 如何突出显示 JTable 中的特定列标题

java - 来自 Baseadapter 的 Android Java 进度对话框

maven-2 - 如何安装第三方源代码和 javadoc JAR?

maven - mvn部署问题