开发者

Maven Local Repository using environment variables

How can I set up the < localRepository >开发者_JAVA百科 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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜