有没有办法告诉maven在哪里放置工件? [英] Is there a way to tell maven where to place the artifacts?

查看:143
本文介绍了有没有办法告诉maven在哪里放置工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在maven里面运行m2eclipse插件,windows命令行和我的cygwin命令行。

I am running both maven inside the m2eclipse plugin, windows command line and my cygwin command line.

cygwin的bash shell将工件导入cygwin / home / .m2目录

cygwin's bash shell dumps artifacts into the cygwin /home/me/.m2 directory

但是m2eclipse& windows shell(on vista)使用/Users/me/Documents/.m2

but m2eclipse & windows shell (on vista) uses /Users/me/Documents/.m2

是否可以告诉mvn命令使用一个中心.m2目录?

Is it possible to tell the mvn command to use one central .m2 directory ?

感谢

推荐答案

对于Cygwin,创建一个名为〜/ .mavenrc的文件将以下文本放在里面:

For Cygwin, create a file called ~/.mavenrc and put the following text inside:

MAVEN_OPTS="-Dmaven.repo.local=c:\documents and settings\user\.m2\repository"
export MAVEN_OPTS

或者,您可以创建文件/etc/.mavenrc

Alternatively, you can create the file under /etc/.mavenrc

另一个选项是创建 NTFS交界处。Windows下的.m2和您的cygwin配置文件之间。

Another option is to create NTFS junction between .m2 under your windows and your cygwin profile.

这篇关于有没有办法告诉maven在哪里放置工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆