Can I add maven repositories in the command line?

后端 未结 7 1765
小鲜肉
小鲜肉 2020-12-07 19:52

I\'m aware I can add maven repositories for fetching dependencies in ~/.m2/settings.xml. But is it possible to add a repository using command line, something like:



        
相关标签:
7条回答
  • 2020-12-07 20:49

    I haven't really used maven 2 before, our system is still working on maven 1.x because of some issues with maven 2.

    However, looking at the documentation for maven 2 it seems that there aren't any specific System properties like that. However, you could probably build one into your poms/settings using the System properties. See System properties part of this http://maven.apache.org/settings.html

    So you'd have ${maven.repository} in your settings file and then use the -Dmaven.repository like you do above.

    I am unsure as to if this would work, but with some tweaking I am sure you can come up with something.

    0 讨论(0)
提交回复
热议问题