在maven设置中,有一个实体引用本地存储库:
<localRepository>~/.m2/repository</localRepository>当我再加一个,就像这样:
<localRepository>~/another/place</localRepository>它会引发Duplicated tag错误。
我可以拥有多个本地存储库,也可以向本地存储库添加另一个direcotry吗?
编辑这个想法似乎也是一个可能的答案:
mvn -Dmaven.repo.local=/path/to/repo发布于 2015-07-22 13:26:49
是的,你可以拥有它,你可以在你的POM.xml本身做它。下面是一个例子。
<project>
...
<repositories>
<repository>
<id>firstrepo</id>
<name>repo</name>
<url>http://myrepo.my</url>
</repository>
<repository>
<id>secondrepo</id>
<name>repo2</name>
<url>http://myrepo.yours</url>
</repository>
</repositories>
...
</project>第二种方法是在profile中创建settings.xml
对于、多个本地存储库,可以有多个settings.xml文件。在命令行中,使用mvn -Dmaven.repo.local=/path/to/repo指定备用路径以获得更多信息,您可以检查此link。希望能帮上忙。
https://stackoverflow.com/questions/31564343
复制相似问题