ash*_*aka 5 java cygwin maven-2
我在m2eclipse插件,windows命令行和我的cygwin命令行中运行maven.
cygwin的bash shell将工件转储到cygwin /home/me/.m2目录中
但是m2eclipse和windows shell(在vista上)使用/Users/me/Documents/.m2
是否可以告诉mvn命令使用一个中央.m2目录?
谢谢
Ale*_*ler 17
当然,有几种方法.最典型的是在settings.xml文件中指定它:
Run Code Online (Sandbox Code Playgroud)<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>/my/secret/repository</localRepository> </settings>
对于 Cygwin,创建一个名为 ~/.mavenrc 的文件并将以下文本放入其中:
MAVEN_OPTS="-Dmaven.repo.local=c:\documents and settings\user\.m2\repository"
export MAVEN_OPTS
Run Code Online (Sandbox Code Playgroud)
或者,您可以在 /etc/.mavenrc 下创建文件
另一种选择是在 Windows 下的 .m2 和 cygwin 配置文件之间创建NTFS 连接。