Maven 迁移local repository

1.1 Maven仓库主要有2种:

  • remote repository:相当于公共的仓库,大家都能访问到,一般可以用URL的形式访问
  • local repository:存放在本地磁盘的一个文件夹,例如,windows上默认是C:\Users\{用户名}\.m2\repository目录

1.2 Remote Repository主要有3种:

  • 中央仓库:http://repo1.maven.org/maven2/
  • 私服:内网自建的maven repository,其URL是一个内部网址
  • 其他公共仓库:其他可以互联网公共访问maven repository,例如 jboss repository等

repository里存放的都是各种jar包和maven插件。当向仓库请求插件或依赖的时候,会先检查local repository,如果local repository有则直接返回,否则会向remote repository请求,并缓存到local repository。

也可以把做的东西放到本地仓库,仅供本地使用;或上传到远程仓库,供大家使用。

================================

我用的是idea自带的maven3

默认maven的配置C:\Users\Administrator\.m2

资源全放系统盘,万一要重装系统呢?现在切换到D盘

打开配置文件,位置为%MAVEN_HOME%/conf/setting.xml,maven_home可以查看idea中的maven设置

打开setting.xml,修改配置信息

  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ~/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
<localRepository>D:\360CloudUI\maven\repository</localRepository>

最后就是把这个setting.xml配置文件覆盖掉idea中默认的配置

一切ok,再把原来C盘中的repository资源迁移到新的位置就可以了。

http://zhidao.baidu.com/link?url=9M9KLKNfeTU8gqRBA3sCbwD6HkZZ_PpzxaGZJpgBBnTLNf5bddxtnCn3HusnydRDHwlsFMcnm6eDz2ii0ebV_w59Cd-anw-B4KdIGFQnK5q

https://my.oschina.net/sunchp/blog/100634

时间: 2024-10-13 02:02:38

Maven 迁移local repository的相关文章

将jar文件加到Maven的local repository中

对于Maven项目来说,日常使用的多数第三方java库文件都可以从Maven的Central Repository中自动下载,但是如果我们需要的jar文件不在Central Repository中,那么我们就需要手动将自己下载的jar文件加入到Maven的local reposotory中了,此时我们需要向Maven提供用于识别jar文件(可能多个)的groupId, artifactId和version等信息. 我并不打算讲怎么将一个下载的jar库加入到local repository中,我们

如何设置maven的local repository目录

step1:默认会放在~/.m2/repository目录下 (“~”代表用户的目录,比如windows下一般都是C:\Documents and Settings\[你的用户名]\.由于“Documents and Settings”中含有“空格”会导致“Illegal character in path”异常) 安装Maven后我们会在用户目录下发现.m2 文件夹.默认情况下,该文件夹下放置了Maven本地仓库.m2/repository.所有的Maven构件(artifact)都被存储到该

How to include custom library into maven local repository?--转

原文地址:https://www.mkyong.com/maven/how-to-include-library-manully-into-maven-local-repository/ There are 2 cases that you need to issue Maven’s command to include a jar into the Maven local repository manually. The jar you want to use doesn’t exist in

maven 手动复制repository 里的jar包

对于Maven项目来说,日常使用的多数第三方java库文件都可以从Maven的Central Repository中自动下载,但是如果我们需要的jar文件不在Central Repository中,那么我们就需要手动将自己下载的jar文件加入到Maven的local reposotory中了,此时我们需要向Maven提供用于识别jar文件(可能多个)的groupId, artifactId和version等信息. 我并不打算讲怎么将一个下载的jar库加入到local repository中,我们

Maven依赖中类似was cached in the local repository样的错误

我们在使用maven编译一个项目时经常会遇到诸如此类的问题. Could not get the value for parameter encoding for plugin execution default-resources Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failure to find org.code

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interv

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Origi

MAVEN奇葩问题was cached in the local repository, resolution will not be reattempted until

[ERROR] Non-resolvable import POM: Failure to find org.springframework.cloud:spring-cloud-dependencies:pom:Finchley.M7 in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the upda

Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval o

pom.xml报错: Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are fo

maven build失败 (Failure to find io.renren:renren-security:pom:3.2.0 in http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository...)

今天mvn clean package一个子工程(renren-admin)时报错: Failed to execute goal on project renren-admin: Could not resolve dependencies for project io.renren:renren-admin:war:3.2.0: Failed to collect dependencies at io.renren:renren-common:jar:3.2.0: Failed to rea