如何在Maven Pom属性值中转义'$'

时间:2019-04-10 08:20:27

标签: maven maven-2 maven-3

我希望Maven属性值是原始字符串@IBAction func ColorSwitch(_ sender: UISwitch) { sender.isOn = !sender.isOn Color.firstColor = sender.isOn } ,而不是属性${var}的真实值。如何转义占位符symbel var

1 个答案:

答案 0 :(得分:1)

您可以使用类似这样的东西...

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