I'd like to use the Maven Resources Plugin to set the XML schema location within an XML resource file:
<root xsi:noNamespaceSchemaLocation="${env.myxsdpath}" ...>
This works except for one thing - the substituted path has double backslashes instead of a single blackslash, e.g:
<root xsi:noNamespaceSchemaLocation="C:\\mypath\\myschema.xsd" ...>
So two questions:
The environment variable myxsdpath
is C:\mypath\myschema.xsd
. The maven-resources-plugin
doesn't have any special configuration other than specifying the files that are to be included with filtering turned on.
This behaviour is controlled by the escapeWindowsPaths
attribute of the maven-resources-plugin
, introduced in version 2.4. It defaults to true
meaning that, by default, all back-slashes will be escaped, turning single \
into double \\
.
Whether to escape backslashes and colons in windows-style paths.
Sample configuration to disable this:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<escapeWindowsPaths>false</escapeWindowsPaths>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With