Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escape property in pom.xml

I would like to escape a property in pom.xml. Not in ressources, I know it is possible with a filter. For example I try to use launch4j plugin like this :

<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>

And ${ALLUSERSPROFILE} must not be interpreted by maven but by the program generate by launch4j. I try :

\${ALLUSERSPROFILE}
\\${ALLUSERSPROFILE}
$${ALLUSERSPROFILE}

and

<properties>
   <dollar>$</dollar>
</properties>
${dollar}{ALLUSERSPROFILE}

but nothing work.

like image 633
EFalco Avatar asked Nov 25 '22 08:11

EFalco


1 Answers

$$ worked for me with ${surefire.forkNumber}.

like image 142
Jesse Glick Avatar answered Jan 24 '23 16:01

Jesse Glick