maven: Is it possible to override location of local repository via the use of command line option or env variable?

后端 未结 2 1613
误落风尘
误落风尘 2020-12-04 14:20

Currently we specify the location of local repository in the settings.xml. Is it possible to override this setting via command line or env variable, such that I can use an a

2条回答
  •  一向
    一向 (楼主)
    2020-12-04 14:29

    Use the localRepository setting in your settings.xml file. Example:

    
      /repo
      ...
    
    

    See here for more info.

    You can also set the repository via the command line using "-Dmaven.repo.local=" such as:

    mvn -U clean install -Dmaven.repo.local=C:\tmp
    

提交回复
热议问题