setting.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">
<!-- 本地仓库的存储位置, Default: ~/.m2/repository-->
<localRepository>C:\Users\asus\.m2\repository</localRepository>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.oschina.net/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.oschina.net/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile></profiles>

<!-- 激活生效的Profiles文件 -->
</settings>

转载于:https://www.cnblogs.com/zhengzhongqi/p/9048882.html

提供的参考引文中未提及在IntelliJ IDEA中向pom.xml文件添加setting.xml的方法。一般而言,在IntelliJ IDEA里,pom.xmlsetting.xml有着不同的作用。pom.xml主要用于定义项目的依赖、插件等项目构建信息,而setting.xml用于配置Maven的全局设置,像本地仓库路径、镜像配置等。以下是通常配置setting.xml的步骤: 1. 打开IntelliJ IDEA,点击“File” -> “Settings”(Windows/Linux)或者“IntelliJ IDEA” -> “Preferences”(Mac)。 2. 在设置窗口中,找到“Build, Execution, Deployment” -> “Build Tools” -> “Maven”。 3. 在“User settings file”处,选择你要使用的setting.xml文件的路径。可以点击右侧的“...”按钮来浏览选择文件。 4. 如果setting.xml文件里配置了本地仓库路径,在“Local repository”处会自动显示相应路径。 5. 点击“Apply”和“OK”保存设置。 代码示例方面,这更多是在IntelliJ IDEA的图形界面操作,并没有直接的代码体现。不过,示例的setting.xml文件内容如下: ```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 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>/path/to/your/local/repository</localRepository> <mirrors> <mirror> <id>central</id> <mirrorOf>*</mirrorOf> <url>https://mirrors.aliyun.com/maven/repository/central/</url> </mirror> </mirrors> </settings> ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值