Datasource definition containing backslashes causes problems in server.xml generation

Description

I am using Cargo to set up Tomcat with a JDBC connection to a HSQLDB file-based database in a multi-module project.

For a number of reasons, we need to use {{${project.build.directory}}} in the JDBC URL string. However, putting this in the pom...

... does not generate a valid conf/server.xml file under Windows. Imagine my project's target directory is C:\foo\bar\baz\target - this is the result...

Server.xml

This will obviously cause an error on container startup - the backslashes are not being escaped correctly and so the database cannot be found. There are no workarounds for us as far as I know.

One solution might be to escape the backslashes in the string, similar to how the Maven Resources plugin works: http://maven.apache.org/plugins/maven-resources-plugin/xref/org/apache/maven/plugin/resources/ReflectionProperties.html#62.
0

Status

Assignee

Adrian Cole

Reporter

Jason Royals

Components

Fix versions

Affects versions

0.3.1-maven2

Priority

Minor
Configure