maven配置及更改仓库镜像为阿里云
来源:互联网 发布:手机淘宝客户端在哪里 编辑:程序博客网 时间:2024/05/07 06:31
配置maven中心仓库为阿里云
1、在官方网站在apache-maven-3.5.0-bin.zip,仅仅8M。
maven官方下载
2、解压出来之后在电脑系统变量中增加
3、在path这个系统变量中增加
增加好过后打开命令提示符(cmd)–输入mvn -v–输入对应的版本号则成功。
4、更改仓库镜像为阿里云
打开解压好的maven文件夹,进入conf文件夹下面的settings.xml文件,修改其中的数据:
<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- 默认的值是${user.home}/.m2/repository --> <localRepository>F:/.m2/repository</localRepository> <!-- 如果Maven要试图与用户交互来得到输入就设置为true,否则就设置为false,默认为true。 --> <interactiveMode>true</interactiveMode> <!-- 如果Maven使用${user.home}/.m2/plugin-registry.xml来管理plugin的版本,就设置为true,默认为false。 --> <usePluginRegistry>false</usePluginRegistry> <!-- 如果构建系统要在离线模式下工作,设置为true,默认为false。 如果构建服务器因为网络故障或者安全问题不能与远程仓库相连,那么这个设置是非常有用的。 --> <offline>false</offline> <servers> <server> <id>releases</id> <username>ali</username> <password>ali</password> </server> <server> <id>Snapshots</id> <username>ali</username> <password>ali</password> </server> </servers> <!--阿里云maven镜像--> <mirrors> <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> </mirrors> <!-- settings.xml中的profile是pom.xml中的profile的简洁形式。 它包含了激活(activation),仓库(repositories),插件仓库(pluginRepositories)和属性(properties)元素。 profile元素仅包含这四个元素是因为他们涉及到整个的构建系统,而不是个别的POM配置。 如果settings中的profile被激活,那么它的值将重载POM或者profiles.xml中的任何相等ID的profiles。 --> <profiles> <profile> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> <repositories> <repository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local private nexus</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!-- activations是profile的关键,就像POM中的profiles,profile的能力在于它在特定情况下可以修改一些值。 而这些情况是通过activation来指定的。 --> <!-- <activeProfiles/> --> <activeProfiles> <activeProfile>nexus-aliyun</activeProfile> </activeProfiles> </settings>
阅读全文
0 0
- maven配置及更改仓库镜像为阿里云
- Maven镜像更换为阿里云中央仓库(精)
- Maven镜像更换为阿里云中央仓库
- maven更改镜像路径为阿里镜像
- maven镜像 阿里云中央仓库
- maven国内镜像(阿里云仓库)
- Maven 阿里云仓库镜像
- 阿里Maven仓库镜像
- maven配置:中心仓库更改至阿里云
- aliyun阿里云Maven仓库镜像地址
- 阿里云提供的maven中央仓库镜像设置
- maven 阿里云 国内镜像 中央仓库
- aliyun阿里云Maven仓库镜像地址
- maven使用国内阿里仓库镜像
- maven 镜像,仓库配置
- 配置阿里云maven仓库
- maven仓库阿里云配置
- 阿里云maven仓库配置
- HTML5去除input [type=search] 的默认边框和删除按钮
- java精确小数位数的几种方法
- 【算法小总结】广度优先搜索剖析
- linux安装curl
- 向集合中一次性添加一组元素的方法
- maven配置及更改仓库镜像为阿里云
- 01背包问题
- 用Java实现判断链表是否有环,环的大小,环的长度以及计算链表的长度
- 计算系数 解题报告
- viewPager item 变高在项目中的使用
- 约瑟夫环
- Android Tab类型主界面总结
- python 数据结构二 之 字符串
- java api操作hbase