How can I set up the < localRepository > tag with an environment user var. I tried this path: %myRepo%/repo but it doesn't works (myRepo=C:/maven/repo). I can't use an absolute path for portability issues but I can setup %myRepo% to the correct place on each system in which the absolute path may vary but the /repo stays the same. Can someone help me? Thanks. Using windows. Maven 2.2.1.
You can use ${env.HOME} to refer to the environment variable %HOME%, and similarly any other environment variable.
However, you may want to set the repository location on each machine by specifying it in settings.xml which is allows each user to enter their own settings. See http://maven.apache.org/settings.html for detail on this and setting environment variables in general (note some parts specific to Maven 3 as marked).
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