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 ...
随机推荐
- 二叉搜索树与双向链表(python)
题目描述 输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表.要求不能创建任何新的结点,只能调整树中结点指针的指向. # -*- coding:utf-8 -*- # class TreeNo ...
- Django的rest_framework认证组件之全局设置源码解析
前言: 在我的上一篇博客我介绍了一下单独为某条url设置认证,但是如果我们想对所有的url设置认证,该怎么做呢?我们这篇博客就是给大家介绍一下在Rest_framework中如何实现全局的设置认证组件 ...
- python note 06 编码方式
1.有如下值li= [11,22,33,44,55,66,77,88,99,90],将所有大于 66 的值保存至字典的第一个key中,将小于 66 的值保存至第二个key的值中.即: {'k1': 大 ...
- ABP框架提示框
abp.message.info('some info message', 'some optional title');abp.message.success('some success messa ...
- 基于springboot的restful接口的单元测试示例
一.知识点 代码中对应的知识点 1.jsonPath github网址 1)操作符见文档 2)方法见文档 3)例子见文档 2.MockMvc(org.springframework.test.web. ...
- spring boot项目升级到2.0.1,提示java.lang.ClassNotFoundException: org.apache.log4j.Logger错误
首先肯定是版本出现了一点兼容问题 所以我就进入项目,查看依赖树,cd到项目目录下,mvn dependency:tree 我看到我的项目原先是1.5.9和现在2.0.1的区别在于org.slf4j的依 ...
- [BeijingWc2008]雷涛的小猫
--BZOJ1270 Description 雷涛的小猫雷涛同学非常的有爱心,在他的宿舍里,养着一只因为受伤被救助的小猫(当然,这样的行为是违反学生宿舍管理条例的). 在他的照顾下,小猫很快恢复了健康 ...
- Python 多进程编程之multiprocessing--Process
Python 多进程编程之multiprocessing 1,Process 跨平台的进程创建模块(multiprocessing), 支持跨平台:windowx/linux 创建和启动 创 ...
- Spring AOP配置方式
AOP 面向切面编程,允许在 java 应用中的方法调用的前后做一些处理. 本文通过实例介绍两种主要的Spring AOP 配置方式:xml 方式配置,注解方式配置 XML 方式配置 1. 项目包类结 ...
- (22)Embrace the near win
https://www.ted.com/talks/sarah_lewis_embrace_the_near_win/transcript?referrer=playlist-talks_to_get ...