I am trying to create a template for my Maven projects in JetBrains IntelliJ IDEA 12.
My goal is to avoid the predefined maven property inside the template. Unfortunately, the syntax is the same as the IntelliJ options in the template.
According to online help, I can avoid the $ character with another $ in front of it, so my template looks like this (the important part of the plugin below):
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> #if (${HAS_PARENT}) <parent> <groupId>${PARENT_GROUP_ID}</groupId> <artifactId>${PARENT_ARTIFACT_ID}</artifactId> <version>${PARENT_VERSION}</version> #if (${HAS_RELATIVE_PATH}) <relativePath>${PARENT_RELATIVE_PATH}</relativePath> #end </parent> #end <groupId>${GROUP_ID}</groupId> <artifactId>${ARTIFACT_ID}</artifactId> <version>${VERSION}</version> <properties> <jdk.version>1.7</jdk.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>$${jdk.version}</source> <target>$${jdk.version}</target> </configuration> </plugin> </plugins> </build> ${END} </project>
But with this template, the output is all the same:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>$JDK.VERSION$</source> <target>$JDK.VERSION$</target> </configuration> </plugin> </plugins> </build>
So my question is: how can I get ${jdk.version} instead of $JDK.VERSION$ and what is the correct way to avoid a string?
source share