前言:
maven默认的本地仓库一般都在c盘,这时候会给我们重装C盘遇到一点小麻烦,为了有效的防止,往往我们会把本地仓库迁出c盘,下面我们就来看一下如何迁移。
- 找到maven的安装目录下的conf文件夹下的settings.xml文件,右键编辑,添加自己的目录
<!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ~/.m2/repository <localRepository>/path/to/local/repo</localRepository> //maven默认路径 --> <localRepository>D:/dev/maven/repository</localRepository> //自己配置的路径 <!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true</interactiveMode> -->