我希望maven属性值是原始字符串${var}
,而不是属性var
的实际值。如何逃避占位符symbel $
。
你可以使用这样的东西......
<properties>
<junit.version>4.11</junit.version>
<dollarSign>$</dollarSign>
<maven.resources.escapeString>\</maven.resources.escapeString>
<someVariable>${dollarSign}{junit.version}</someVariable>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${someVariable}</version>
<scope>test</scope>
</dependency>
</dependencies>