Maven setting配置镜像仓库
1.配置IDE构建的Maven存放目录(解压目录)
2.配置IDE的User setting file路径,修改setting配置文件
配置本地仓库
<!--自定义本地仓库路径-->
<localRepository>D:\Program Files\Develop\Portable\localRepository</localRepository>
配置mirrors远程镜像(一般配置一到两个镜像)
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven-central</id>
<name>aliyun maven central</name>
<url>https://maven.aliyun.com/repository/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven-spring</id>
<name>aliyun maven-spring</name>
<url>https://maven.aliyun.com/repository/spring</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>spring-snapshots</id>
<mirrorOf>central</mirrorOf>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
</mirror>
<mirror>
<id>spring-milestones</id>
<mirrorOf>central</mirrorOf>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</mirror>
</mirrors>
配置profiles构建
<profile>
<id>jdk18</id>
<activation>
<jdk>1.8</jdk>
<activeByDefault>true</activeByDefault>
</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>
</profile>
国内Maven镜像仓库值得收藏
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/mvn/view</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>ibiblio</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>https://maven.aliyun.com/mvn/view</url>
</mirror>
<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
</mirrors>
完整setting配置
<?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">
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>D:\Program Files\Develop\Portable\localRepository</localRepository>
<pluginGroups>
</pluginGroups> <proxies>
</proxies> <servers>
</servers> <mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>https://maven.aliyun.com/repository/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven-central</id>
<name>aliyun maven central</name>
<url>https://maven.aliyun.com/repository/central</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>alimaven-spring</id>
<name>aliyun maven-spring</name>
<url>https://maven.aliyun.com/repository/spring</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>spring-snapshots</id>
<mirrorOf>central</mirrorOf>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
</mirror>
<mirror>
<id>spring-milestones</id>
<mirrorOf>central</mirrorOf>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</mirror>
</mirrors> <profiles>
<profile>
<id>jdk18</id>
<activation>
<jdk>1.8</jdk>
<activeByDefault>true</activeByDefault>
</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>
</profile>
</profiles>
</settings>
-- 更新于 2020-4-26
备注:
作者:Shengming Zeng
博客:http://www.cnblogs.com/zengming/
严正声明:
1.由于本博客部分资源来自互联网,版权均归原作者所有。转载的目的是用于学术交流与讨论学习,将不对任何资源负法律责任。
2.若无意中侵犯到您的版权利益,请来信联系我,我会在收到信息后会尽快给予处理!
3.所有资源内容仅供学习交流之用,请勿用作商业用途,谢谢。
4.如有转发请注明出处,来源于http://www.cnblogs.com/zengming/,谢谢合作。
Maven setting配置镜像仓库的更多相关文章
- eclipse中安装maven,配置本地仓库和镜像
1.安装maven,配置MAVEN_HOME 首先:下载免安装版解压配置MAVEN_HOME(和配置JAVA_HOME一样) 然后按照下面的配置,主要第3步,指定settings.xml文件的位置(在 ...
- Maven - 配置镜像仓库
默认仓库的配置(全球中央仓库): 可以打开maven的安装目录/conf/settings.xml文件,配置镜像,找到如下一段配置,这里默认没有配置任何镜像,但是有一个被注释的配置范例: id: 镜像 ...
- maven setting 配置仓库,pom.xml中repository不起作用
问题描述 最近做java项目,需要使用公司自己搭建的maven仓库,但是有些包公司的仓库中没有,导致下载失败. 项目环境 jdk:1.8 maven:3.5 问题原因分析 maven的setting文 ...
- Maven下载 || 配置本地仓库 || IntelliJ IDEA配置Maven教程
本文章主要介绍1.Maven下载 2.配置本地仓库Repository 3.IDEA配置Maven 三点. 相关博客: Eclipse配置Maven https://www.cnblogs.c ...
- maven的配置及仓库的配置
1.maven的配置 1.1.注意:电脑上需要安装jdk. 1.2.配置MAVEN_HOME,再在path中配置到bin这一层. (1)配置MAVEN_HOME:我的电脑--->右击---> ...
- maven的setting配置远程仓库
maven的setting,配置远程库. <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mi ...
- maven setting配置
<?xml version="1.0" encoding="UTF-8"?> <!--Licensed to the Apache Softw ...
- maven中配置jboss仓库
有两种方式,一种是在项目的pom.xml中<repositories>中添加,这是配置是针对具体的某一个项目,更多时候,我们想把jboss仓库作为所有项目的仓库,这就需要在maven的se ...
- win10下docker安装和配置镜像仓库
初学docker记录一下流程 1.首先安装直接官网下载 DockerToolbox 即可,安装过程傻瓜式下一步即可.(这个集成了虚拟机,果然安装过的可以去掉) 2.安装好后双击Docker Quick ...
随机推荐
- 10. Regular Expression Matching (JAVA)
Given an input string (s) and a pattern (p), implement regular expression matching with support for ...
- 【python深入】collections-Counter使用总结
关于collections的使用,首先介绍:Counter的使用 需要执行:from collections import Counter 在很多使用到dict和次数的场景下,Python中用Coun ...
- 41 【docker】初识
常用的docker命令: docker ps #查看当前正在运行的容器 docker ps -a | grep <keyword> #查看所有的容器,运行的或者停止的 docker sto ...
- SQL Server 定价及授权方式
https://www.microsoft.com/zh-cn/sql-server/sql-server-2017-pricing http://www.360doc.com/content/15/ ...
- 73. Set Matrix Zeroes 把矩阵同一行列的元素都改成0
[抄题]: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. ...
- 英雄联盟lol登录错误:登录服务器未响应、您可能遇到了一个网络问题、请检查您的网络。
第一方法cmd 用管理员命令打开,输入 netsh winsock reset.重启 第二种方法 win+r 输入 regedit 在 HKEY_CURRENT_USER\Software\Mi ...
- Python中单引号,双引号,3个单引号及3个双引号的区别
单引号和双引号在Python中我们都知道单引号和双引号都可以用来表示一个字符串,比如 str1 = 'python' str2 = "python" str1和str2是没有任何区 ...
- boost asio 学习(五) 错误处理
http://www.gamedev.net/blog/950/entry-2249317-a-guide-to-getting-started-with-boostasio?pg=6 5. Erro ...
- 基于Zxing的二维码的二维码扫描之横屏扫描
最近项目条码扫描要改为横屏,网上所搜了一下,然后发现我写的需要改动几行代码就可以了,还是很给力的. 如未查看之前的代码,请移步: 基于Zxing的二维码生成和二维码扫描 修改下面写代码就可以实现横屏条 ...
- 别人的Linux私房菜(10)vim程序编辑器
很多软件的编辑接口会主动调用vi vi分一般命令模式.编辑模式.命令行模式. 使用vi :/bin/vi welcome.txt 下下端显示文本有多少行,多少字符, 一般命令模式: 上下左右移动光标k ...