Maven的标准settings.xml文件
配置目标
1. 默认jdk采用java8
2. 配置阿里云镜像和私服镜像, 并且先从阿里云下载, 下载不到的再去私服下载
<?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>${user.home}/.m2/repository</localRepository> <!-- Apache Maven 配置 -->
<pluginGroups/>
<proxies/> <!-- 私服发布的用户名密码 -->
<servers>
<server>
<id>releases</id>
<username>deployment</username>
<password>He2019</password>
</server>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>He2019</password>
</server>
</servers> <!-- 阿里云镜像 -->
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<!-- https://maven.aliyun.com/repository/public/ -->
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors> <!-- 配置: java8, 先从阿里云下载, 没有再去私服下载 -->
<!-- 20190929 hepengju 测试结果: 影响下载顺序的是profiles标签的配置顺序(后面配置的ali仓库先下载), 而不是activeProfiles的顺序 -->
<profiles>
<!-- 全局JDK1.8配置 -->
<profile>
<id>jdk1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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> <!-- Nexus私服配置: 第三方jar包下载, 比如oracle的jdbc驱动等 -->
<profile>
<id>dev</id>
<repositories>
<repository>
<id>nexus</id>
<url>http://nexus.hepengju.cn:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>Public Repositories</name>
<url>http://nexus.hepengju.cn:8081/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile> <!-- 阿里云配置: 提高国内的jar包下载速度 -->
<profile>
<id>ali</id>
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile> </profiles> <!-- 激活配置 -->
<activeProfiles>
<activeProfile>jdk1.8</activeProfile>
<activeProfile>dev</activeProfile>
<activeProfile>ali</activeProfile>
</activeProfiles>
</settings>
Maven的标准settings.xml文件的更多相关文章
- 【maven学习】settings.xml文件详解
环境 apache-maven-3.6.1 jdk 1.8 eclipse 4.7 Settings.xml是设置maven参数的配置文件,包含类似本地仓储位置.修改远程仓储服务器.认证信息等配置.p ...
- 解决Maven项目中pom.xml文件报错(Failure to transfer....)的问题
打开pom.xml文件,查看错误,如果错误类型为:Failure to transfer.........之类的,则表明你的pom中依赖的jar包没有完全下载. 解决方法:找到你本地的maven仓库, ...
- maven在windows环境下加载settings.xml文件
今天发现maven在windows环境下加载的settings.xml文件是c:下的,就算修改conf下的settings.xml里的<localRepository>给他明确指向也没用.
- Maven入门2-pom.xml文件与settings.xml文件
Maven入门2-pom.xml文件与settings.xml文件 本文内容来源于官网文档部分章节,settings.xml文件:参考http://maven.apache.org/settings. ...
- maven settings.xml 文件
指定jdk 的版本: <profile> <id>jdk-1.8</id> <activation> <activeByDefault>tr ...
- maven设置------settings.xml文件学习
https://blog.csdn.net/tomato__/article/details/13025187 快速预览 maven的配置文件为settings.xml,在下面路径中可以找到这个文件, ...
- maven - settings.xml文件详解
Settings.xml配置文件详解 maven默认的settings.xml是一个包含注释和例子的模板,可以快速的修改settings.xml文件 maven安装后不会在用户目录下自动生成setti ...
- 一次解决idea maven settings.xml文件不生效
一直使用eclipse,在eclipse中可以手动指定global和user settings,并且settings的文件名称可以不是settings.xml,只要内容符合maven规范就行.如下: ...
- Maven中settings.xml文件各标签含义
原文地址:http://www.cnblogs.com/jingmoxukong/p/6050172.html?utm_source=gold_browser_extension settings.x ...
随机推荐
- git的一些简单用法
1.工作区暂存区和仓库区 工作区 对于添加.修改.删除文件的操作,都发生在工作区中 暂存区 暂存区指将工作区中的操作完成小阶段的存储,是版本库的一部分 仓库区 仓库区表示个人开发的一个小阶段的完成 仓 ...
- java中String类的面试题大全含答案
1.下面程序的运行结果是()(选择一项)String str1="hello";String str2=new String("hello");System.o ...
- spring framework三个版本的下载包区别
docs:该文件夹下包含Spring的相关文档.开发指南及API参考文档:dist:该文件夹下包含Spring jar包.文档.项目等内容:schema:里面包含了Spring4所用到的xsd文件:
- koa 的 Context
context上下文对象: 该对象类似原生http中的 req + res - 该对象的req,res属性也存在,就是原生没有包装过的req,res - 简单说: context 对象就是从请求到响应 ...
- java.lang.SecurityException: class "javax.servlet.ServletRegistration"'s signer information does not match signer information of other classes in the same package
报错信息: 报错截图: 解决方案: 因为本人是sbt项目,所以添加一下依赖之后解决: 如果是maven项目的话,添加依赖到pom文件中然后在重新build,之后就可以了
- Mongodb导入本地数据(.dat)到仓库(window)
借鉴文章,完成了数据文件导入到Mongodb, 尊重作者版权:https://blog.csdn.net/weixin_44198965/article/details/100022616 1.找到你 ...
- 树分基础 bzoj 1468
我们对于一棵树,我们找一个根,然后统计过这个点的路径有多少符合要求.怎么搞呢?我们可以先维护一个数据结构,然后把先把根作为一个距离自己为0的点放进去,然后对于每一棵子树,先找出所有的与之前的数据结构的 ...
- Delphi实现提取可执行文件内部所有图标
本实例实现的功能是能够从用户选择的可执行文件(后缀名为exe)中提取所有图标并且显示在窗体上. 在窗体中添加TImage 组件.TOpenDialog组件和TButton组件,TImage组件充当显示 ...
- contest-20191021
文化课读的真不开心 回来竞赛 假人 sol 根据不等式有 abs(a-b)+abs(b-c)>=abs(a-c) 那么每一个都会选. 可以发现每一段只会选在端点上(否则移到端点更优). 那么dp ...
- [bzoj3073] Journeys 题解(线段树优化建图)
Description Seter建造了一个很大的星球,他准备建造N个国家和无数双向道路.N个国家很快建造好了,用1..N编号,但是他发现道路实在太多了,他要一条条建简直是不可能的!于是他以如下方式建 ...