Can I add maven repositories in the command line?

后端 未结 7 1763
小鲜肉
小鲜肉 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:36

    I'll assume here that you're asking this because you occasionally want to add a new 3rd-party repository to your builds. I may be wrong of course... :)

    Your best bet in this case is to use a managed proxy such as artifactory or nexus. Then make a one-time change in settings.xml to set this up as a mirror for the world.

    Any 3rd party repos that you need to add from that point on can be handled via the proxy.

提交回复
热议问题