1、maven的配置文件
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<localRepository>D:/software/apache-maven-rep2</localRepository>
<mirrors>
<mirror>
<id>maven-local</id>
<name>maven-local</name>
<url>http://10.11.139.107:9000/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<!-- 仅当你需要 deploy 到某个仓库时才需要对应的 server 配置 -->
<!-- 如果 maven-public 是只读代理,可删除 servers 块 -->
<servers>
<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>u%_ilZ=jcHCd%8r1P.mxM^@4oqE+kF</password>
<configuration>
<httpConfiguration>
<all>
<!-- 关键:禁用连接复用 -->
<useKeepAlive>false</useKeepAlive>
<connectionTimeout>30000</connectionTimeout>
<socketTimeout>60000</socketTimeout>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>
</settings>
2、在项目配置拉取及推送,在pom.xml添加如下配置:
<repositories>
<repository>
<id>public</id>
<url>http://10.18.55.37:30907/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>maven-snapshots</id>
<url>http://10.18.55.37:30907/repository/maven-snapshots/</url>
</repository>
</distributionManagement>