如何设置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)都被存储到该仓库中,以方便重用。

step2:修改配置文件,位置为%MAVEN_HOME%/conf/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:\Eclipse\jars\maven</localRepository>

step3: 修改MyEclipse的MAVEN的存储位置:进入MyEclipse→window→Preferences→Maven4MyEclipse→Maven→Installations→User Sittings    点击右侧Browse指向%MAVEN_HOME%\conf\settings.xml----------------------------------------------------------------------%MAVEN_HOME%代表你的MAVEN所在目录
时间: 2024-10-16 06:27:10

如何设置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

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是一个内部网址 其他公共仓

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中,我们

Failure to find parent:pom:2.2.6 in http://maven.aliyun was cached in the local repository...

报错如下: 原因分析:主要是阿里云的Maven仓库无法更新这个版本的pom依赖: 解决过程:于是直接在pom里面添加阿里云maven,还是报同样的错误:看到网上说删除maven仓库的对应目录或目录下的*.lastUpdated文件,然后再次运行maven命令,然后再打包设置相关的属性,但是又报无权限访问的错误:    后来就想着要不更改pom的版本,将其降低点,即改为2.2.5就好了,如下图所示: <?xml version="1.0" encoding="UTF-8&

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