You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christian Domsch <la...@gmail.com> on 2018/08/14 09:19:39 UTC
Influence property substitution
Hi,
we are facing an awkward problem with property substitution. The following part is in our cargo-maven2-plugin configuration:
…
<build>
<plugins>
<plugin>
...
<configuration>
<container>
<systemProperties>
<dbUrl>jdbc:derby:${basedir}/target/database/Repository1.db;create=true</dbUrl>
</systemProperties>
</container>
</configuration>
</plugin>
</plugins>
</build>
What is done here, is configuring the derby driver. This works fine under all *nix systems. In windows environments there is a very bad case. ${baseDir} gets substituted with the absolute path using File.separator (\). Derby takes that string literally and if the path contains path segments that happen to start with a t or an r the url is not usable anymore, since it now contains tabs or line feeds (\t or \r).
I am not sure how to circumvent that problem, since it seems to be a core maven mechanism that is not to be tampered with.
Any ideas to work around that problem are highly appreciated.
Christian
Re: Influence property substitution
Posted by Arnaud bourree <ar...@gmail.com>.
Could ${ project.baseUri} help you?
Source: http://maven.apache.org/ref/3.2.3/maven-model-builder/
Arnaud.
Le mar. 14 août 2018 à 11:19, Christian Domsch <la...@gmail.com> a écrit :
> Hi,
>
> we are facing an awkward problem with property substitution. The following
> part is in our cargo-maven2-plugin configuration:
>
> …
> <build>
> <plugins>
> <plugin>
> ...
> <configuration>
> <container>
> <systemProperties>
>
> <dbUrl>jdbc:derby:${basedir}/target/database/Repository1.db;create=true</dbUrl>
> </systemProperties>
> </container>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> What is done here, is configuring the derby driver. This works fine under
> all *nix systems. In windows environments there is a very bad case.
> ${baseDir} gets substituted with the absolute path using File.separator
> (\). Derby takes that string literally and if the path contains path
> segments that happen to start with a t or an r the url is not usable
> anymore, since it now contains tabs or line feeds (\t or \r).
>
> I am not sure how to circumvent that problem, since it seems to be a core
> maven mechanism that is not to be tampered with.
>
> Any ideas to work around that problem are highly appreciated.
>
> Christian