我想使用Maven Resources Plugin在XML资源文件中设置XML架构位置:
func share(sender: UIBarButtonItem) {
let masterpiece = canvas.snapshotViewAfterScreenUpdates(true)
let image = snapshot(masterpiece)
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}
func snapshot(masterpiece: UIView) -> UIImage{
UIGraphicsBeginImageContextWithOptions(masterpiece.bounds.size, false, UIScreen.mainScreen().scale)
masterpiece.drawViewHierarchyInRect(masterpiece.bounds, afterScreenUpdates: true)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
除了一件事情之外 - 取代路径有双反斜杠而不是一个黑色斜杠,例如:
<root xsi:noNamespaceSchemaLocation="${env.myxsdpath}" ...>
所以有两个问题:
环境变量<root xsi:noNamespaceSchemaLocation="C:\\mypath\\myschema.xsd" ...>
为myxsdpath
。 C:\mypath\myschema.xsd
除了指定打开过滤时要包含的文件外,没有任何特殊配置。
答案 0 :(得分:9)
此行为由版本2.4中引入的escapeWindowsPaths
的maven-resources-plugin
属性控制。它默认为true
,这意味着默认情况下,所有反斜杠都将被转义,将单\
转换为双\\
。
是否在Windows风格的路径中转义反斜杠和冒号。
禁用此功能的示例配置:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<escapeWindowsPaths>false</escapeWindowsPaths>
</configuration>
</plugin>