Details
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...
<cargo.datasource.datasource>
cargo.datasource.url=jdbc:hsqldb:file:${project.build.directory}/database/db|
... other properties ...
</cargo.datasource.datasource>
... 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...
<Resource url='jdbc:hsqldb:file:C:foobarbaz arget/database/db'
...other attrs.../>
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.
thanks for specifying the issue so clearly. this is now covered by unit tests