Maven使用--setting.xml配置(转载)

Maven使用--setting.xml配置(转载)

http://www.360doc.com.cn/showWeb/0/0/381623.aspx

 

配置:

打开 ${maven.home}/conf 下面的 Setting.xml ,为了大家对照方便,我只在原来的基础上更改,顺序按从上往下

配置本地 Repository

<!-- localRepository

| The path to the local repository maven will use to store artifacts.

|

| Default: ~/.m2/repository

-->
<localRepository>E:/LoaclRepository/m2</localRepository>
 

其中 E:/LoaclRepository/m2 是本地 Repository ,这个必须时绝对路径 。如果不改的话默认路径是在 C:\Documents and Settings \ %username%\.m2 下。其中 %username% 为操作系统登录用户名,这样不方便维护。

与用户的交互模式

<!-- interactiveMode

| This will determine whether maven prompts you when it needs input. If set to false,

| maven will use a sensible default value, perhaps based on some other setting, for

| the parameter in question.

|

| Default: true

<interactiveMode>true</interactiveMode>

-->
 

默认为 true ,当需要输入参数时 Maven 会提示用户输入参数,如果设置为 false ,则在遇到有输入参数时不会提示用户, Maven 会自己生成一些参数,这样可能会出错,一般不需要改变默认设置。

是否连接互联网

<!-- offline

| Determines whether maven should attempt to connect to the network when executing a build.

| This will have an effect on artifact downloads, artifact deployment, and others.

|

| Default: false

<offline>false</offline>

-->
 

当运行的时候,决定 Maven 是否尝试与网络建立连接。这样可能会对已有的本地储藏室中的自定义 .jar 文件产生影响,默认为 false ,一般不需要改。

配置代理服务器(如果你使用代理服务器上网的话)

<!-- proxies
	
	| This is a list of proxies which can be used on this machine to connect to the network.
	
	| Unless otherwise specified (by system property or command-line switch), the first proxy
	
	| specification in this list marked as active will be used.
	
	|-->

<proxies>

	<!-- proxy
		
		| Specification for one proxy, to be used in connecting to the network.
		
		|
		
	-->

	<proxy>

		<id>optional</id><!--代理服务器ID,可随意命名-->

		<active>true</active><!-- 是否启用 -->

		<protocol>http</protocol><!-- 通信协议 -->

		<username>proxyuser</username><!-- 代理服务器用户名 -->

		<password>proxypass</password><!-- 代理服务器密码 -->

		<host>proxy.host.net</host><!-- 代理服务器主机地址 -->

		<port>80</port><!-- 通信端口 -->

		<nonProxyHosts></nonProxyHosts>

	</proxy>

</proxies>
 

其中 proxy.host.net 是你的代理服务器主机地址

展开我的项目到远程服务器

Pom .xml 文件:

<distributionManagement>

	<repository>

		<id>mycompany-repository
</id>

		<name>MyCompany Repository</name>

		<url>scp://repository.mycompany.com/repository/maven2</url>

	</repository>

</distributionManagement>
 

Settings.xml

 

<!-- servers
	
	| This is a list of authentication profiles, keyed by the server-id used within the system.
	
	| Authentication profiles can be used whenever maven must make a connection to a remote server.
	
	|-->

<servers>

	<!-- server
		
		| Specifies the authentication information to use when connecting to a particular server, identified by
		
		| a unique name within the system (referred to by the 'id' attribute below).
		
		|
		
		| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
		
		| used together.
		
		|
		
		<server>
		
		<id>deploymentRepo

</id>
		
		<username>repouser</username>
		
		<password>repopwd</password>
		
		</server>
		
	-->



	<!-- Another sample, using keys to authenticate. -->

	<id>mycompany-repository</id>

	<username>jvanzyl</username>

	<!-- Default value is ~/.ssh/id_dsa -->

	<privateKey>/path/to/identity</privateKey>
	(default is ~/.ssh/id_dsa)

	<passphrase>my_key_passphrase</passphrase>

</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>ggi-project.org</id>

		<url>http://ftp.ggi-project.org/pub/packages/maven2</url>

		<mirrorOf>central</mirrorOf>

	</mirror>

	<mirror>

		<id>planetmirror.com</id>

		<url>http://public.planetmirror.com/pub/maven2</url>

		<mirrorOf>central</mirrorOf>

	</mirror>

	<mirror>

		<id>lsu.edu</id>

		<url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>

		<mirrorOf>central</mirrorOf>

	</mirror>

	<mirror>

		<id>ibiblio.net</id>

		<url>http://www.ibiblio.net/pub/packages/maven2</url>

		<mirrorOf>central</mirrorOf>

	</mirror>

</mirrors>
 
超越数据手册:深入Zynq XADC的DRP接口与PL端自定义采样逻辑 本文深入探讨Zynq-7000系列XADC模块的DRP接口机制与PL端自定义采样逻辑实现。通过硬件级多通道轮询、触发采样和实时校准技术,突破传统软件驱动限制,为高精度电压测量和通讯应用提供极致灵活性和响应速度。 阅读详情

相关推荐

【SAP PO】SAP PO 接口配置完整教程之二REST服务对接

SAP PO 接口配置完整教程之二REST服务对接

XLevon的博客 1万+

maven2的配置

配置:打开${maven.home}/conf下面的Setting.xml,为了大家对照方便,我只在原来的基础上更改,顺序按从上往下配置本地Repository(储藏室) | The path to the local repository ma

TomyGuan的专栏 1569

深入解析YT8521S千兆以太网PHY芯片的设计与调试要点

本文深入解析了YT8521S千兆以太网PHY芯片的设计与调试要点。重点剖析了硬件设计中的电源方案、RGMII接口电平配置(尤其是1.8V电平方案)以及PCB布局布线等关键细节,并提供了从硬件检查、驱动配置到性能测试的完整调试流程,帮助工程师规避常见陷阱,实现稳定可靠的千兆网络连接。

weixin_29190573的博客 687

不联网,idea 只访问本地maven仓库

idea 只访问本地maven仓库中的依赖

一夜飘零 1万+

告别云端依赖:手把手教你在Windows 10/11上离线部署WhisperDesktop(含模型下载避坑指南)

本文详细介绍了如何在Windows 10/11上离线部署WhisperDesktop,包括硬件要求、模型下载、环境配置和实战应用。通过本地部署,用户可以实现高效的语音转文字功能,无需依赖云端服务,特别适合注重数据隐私和需要离线工作的场景。

weixin_33736048的博客 322

Linux中Hadoop 集群搭建

零、下载Hadoop: http://archive.cloudera.com/cdh5/cdh/5/?tdsourcetag=s_pctim_aiomsg 一、集群规划: 搭建的 hadoop 集群由 3 台服务器组成,分别叫做 master,salve1 和 slave2。其中 master 作为主节点,slave1 和 slave2 作为从节点。 二、网络配置: 1.查看 3 个节点的主机名...

白墨的小白博客 3991

maven 本地仓库的配置

<?xml version="1.0" encoding="UTF-8"?> <!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work fo...

weixin_30547797的博客 137

uniapp中使用canvas生成海报,并下载保存到手机相册

如下图,是在H5中,canvas生成后的效果,首先说明,H5不支持返回图片的临时路径,不能用于保存,APP端生成成功后,会返回图片的临时路径用来保存到相册。本地测试,用的网络图片,没有出现跨域的问题,APP端也正常显示。 完整代码:可以将整个代码复制到你得uniapp项目中直接运行。代码中做了详细的注册,关于API的用法,这里只标注的简单的提示,具体还是参考 官方链接uniapp-canvas吧 <template> <view class="demo"> <c.

sunluyi的博客 3万+

配置mvnrepository仓库_详解Maven settings.xml配置(指定本地仓库、阿里云镜像设置)

一、settings.xml文件会在两个目录下存在:1、maven安装目录(全局):%maven_home%\conf\settings.xml2、用户安装目录(用户):${user.home}\.m2\settings.xml第一个是全局配置,第二个是用户配置。当两者都存在,它们的内容将被合并,特定于用户的settings.xml文件占主导地位。如果从头开始创建用户特定的配置,可以将全局的set...

weixin_39542340的博客 4749

自动化Ai Agent全流程实现【设计+代码】

本文探讨了人工智能代理(AI代理)如何通过自动化复杂的业务流程来帮助企业提高效率和降低成本。AI代理具有适应性、智力、自主性和可扩展性等特点,能够处理非结构化信息、在定义参数范围内做出判断、协调多个系统或利益相关者,以及处理变量输入和异常。文章详细介绍了AI代理在文件处理、客户服务、人才招聘和财务运作等领域的应用,并提供了一个逐步实现发票处理自动化的案例。此外,文章还强调了实施AI代理自动化的优势,包括效率提升、成本降低、准确性和可扩展性的改进,并提出了实施最佳实践,如从高影响力流程开始、设计人机交互、优先

FeelTouch Labs 895

Python爬虫实战 | 拼多多商品评论采集与深度分析

本文从 API 调用、网页渲染到情感分析与关键词提取,全流程剖析了“拼多多商品评论采集与分析”项目。Scrapy + API 可快速抓取评论;Playwright 可突破 API 限制,抓取完整页面内容;数据清洗 + 分析揭示用户真实反馈;可持续部署、扩展至更多商品 & 时间段;

2201_76125261的博客 1696

maven3读书笔记3 第一个maven工程

在命令行中输入: mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false 可以先切换到目标目录后执行此命令。 执行后,进入my-app目录 可以看...

pengjj2的博客 969

thermal系列(5)-DTSI中配置Thermal

By: fulinux E-mail: fulinux@sina.com Blog: https://blog.csdn.net/fulinus 喜欢的盆友欢迎点赞和订阅! 你的喜欢就是我写作的动力! 目录thermal系列目录DTSI中配置ThermalDTSI节点类型描述CPU0的配置举例CPU核hot-plugging举例修改热缓解阈值DTSI的node中带有tracks-lowDTSI中关闭某个Thermal Zones thermal系列目录 thermal系列(1)-引言部分 thermal.

fulinux的博客 1231

收藏

转载: maven setting.xml配置,修改为阿里云镜像: https://blog.csdn.net/cxionc123/article/details/106410562/ 转载: maven配置文件 setting.xml设置和设置阿里云镜像 https://blog.csdn.net/cxionc123/article/details/106410562/ 官网: http://maven.apache.org/settings.html 转载:(重点) 基于阿里云的maven配置setti

Hsssc的博客 219

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

idea中maven的setting.xml的配置

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34355715的博客 6415

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

maven 配置setting文件

转载自:https://blog.csdn.net/u013631223/article/details/79082491           maven配置文件为settings.xml,主要应用于对maven管理的项目的依赖配置进行自动更新和下载,一般情况下,maven会根据settings.xml文件给出的配置信息和url依次从本地仓库、远程仓库和中央仓库下载项目指定的依赖jar包(依赖包...

Bernard Han的博客 3785

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

设置Maven的setting.xml

Maven的库在中国大陆非常慢,有些包更新不上,上一篇用了阿里云的镜像有些包还是下载不了,搜了一下发现这个setting.xml写法,这个很好用。转载一波:https://zhuanlan.zhihu.com/p/71998219,并在此感谢大佬的分享。 附上相关的setting.xml内容: <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema

qq_34353583的博客 341

配置 maven setting.xml 为国内(aliyun)的仓库 不生效

配置 maven setting.xml 为国内的仓库 不生效 maven的 setting文件默认是中央仓库地址,国外的,速度比较慢 想换成国内的仓库地址:http://maven.aliyun.com/nexus/content/groups/public/ 但是 修改了几次使用不生效,依...

chuzhunji8860的博客 1781

idea设置maven配置文件setting.xml的位置

--------------------- 作者:fengqing5578 来源:优快云 原文:https://blog.csdn.net/fengqing5578/article/details/82854495 版权声明:本文为博主原创文章,转载请附上博文链接! ...

u012028371的博客 9074

maven 的私服配置setting.xml 丝滑般拉jar包

长话短说 转载加入作者链接地址 直接这个文件替换maven 中 conf 的setting.xml 文件,命名不要改 打开 setting.xml 替换一下文件中的脚步,使用我这个 <?xml version="1.0" encoding="UTF-8"?> <settings> <localRepository>/home/yizhen/.m2/...

徐小冠 848

日常填坑系列-Maven-1、Maven的安装及setting.xml配置

一、下载Maven 官方网站https://mirrors.tuna.tsinghua.edu.cn/apache/maven/,选择想要下载的版本 2.3.5.3版本的http://mirrors.shu.edu.cn/apache/maven/maven-3...

chongkuang5202的博客 157

maven私服setting 和pom的配置信息

<?xml version="1.0" encoding="UTF-8"?> <!-- -------------------------------------------------在父类POM的配置如下: --> <!-- 本地快照 和release 发布 的配置 --> <distributionManageme...

avj64803的博客 215

maven setting.xml 配置信息

版权声明:本文为博主原创文章,欢迎转载,转载请注明作者、原文超链接 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOT...

y18832550310的博客 217

Maven setting.xml简易配置

使用国内阿里云的下载源: <?xml version="1.0" encoding="UTF-8"?> <settings> <localRepository>D:\Tools\java\maven\repository</localRepository><!--local Repository--> &l...

diaojinxun8373的博客 127

Maven .m2 setting.xml配置

settings.xml <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 ...

dexia7362的博客 415

setting.xml配置文件

转载:http://www.cnblogs.com/yangxia-test/p/4409736.html 文件存放位置 全局配置:${M2_HOME}/conf/settings.xml 用户配置:${user.home}/.m2/settings.xml note:用户配置优先于全局配置。${user.home}和和所有其他系统属性只能在3.0+版本上使用。请注意windo...

qq_33366098的博客 2496
上一篇: Maven Detail Task
下一篇: maven2的主要配置pom.xml
topinking
博客等级 码龄20年 15粉丝 242原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值