Escape property in pom.xml

I would like to avoid the property in pom.xml. Not in resources, I know that this is possible with a filter. For example, I am trying to use a plug4j plugin as follows:

<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} should not be interpreted by maven, but by the program generate start4j. I'm trying to:

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

and

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

but nothing works.

+5
source share
4 answers

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

+1
source

I add the same problem when I need to filter my log4j.properties file by resolving the key '$ {log4j.dir}' with the property value pom <strong> '$ {user.home}.

$$ {key} hack ${dollar} {key} hack . , , HEXA $ char pom.

<project>
    <properties>
    <log4j.dir>\u0024{user.home}</log4j.dir>
    </properties>
    <!--...-->
</project>
0

pom.xml .

Surefire, . .

Maven . .

- , , :

$&#8203;{somePomProperty}

:

$ + zero-width-space + { + somePomProperty + }

.

0

:

    <properties> 
      <dollar>$</dollar> 
      <dollar.bloop>${dollar}{bloop}</dollar.bloop> 
    </properties> 
  • $$ IntelliJ. , squiggles.
  • \u0024 , $.

YMMV .

-1

All Articles