Specifying Maven's local repository location as a CLI parameter

后端 未结 3 1460
长发绾君心
长发绾君心 2020-11-28 02:02

Is it possible to set the location of the local Maven repository as argument on the Maven command line?

The thing is that I don\'t use the default one in ~/.m2

3条回答
  •  北海茫月
    2020-11-28 02:40

    For git:

    alias mvn='mvn "-Dmaven.repo.local=$(git rev-parse --show-toplevel)/.m2/repository"'
    

    This uses a separate maven repository in each git repository

提交回复
热议问题