Two Laptop Bag
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven and Environment Variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven and Environment Variables" Watch "Maven and Environment Variables" New topic

Maven and Environment Variables

Drew Formica

Joined: Apr 06, 2006
Posts: 1
currently in my maven.xml file i have the following
<property name="myApp.home" value="${env.MYAPP_HOME}" />

lets say that env.MYAPP_HOME = C:\Dir1\Dir2\Dir3

my problem is that the value is used to create values in my file. Example: = ${myApp.home}/backup

but the env variable value has \s in it - so when my java code reads the value i get C:\Dir1Dir2Dir3/backup

I can't force my users/installation application to specify the path with double \s or /

is there anyway to read in the env variable value and modify it (changing \ to /) ?
I agree. Here's the link:
subject: Maven and Environment Variables
It's not a secret anymore!