Maven用到的Repositories說明:
maven-central:maven中央庫,默認從https://repo1.maven.org/maven2/拉取jar
maven-releases:私庫發(fā)行版jar
maven-snapshots:私庫快照(調(diào)試版本)jar(只需要在發(fā)布的版本號后面加上-SNAPSHOT)
maven-public:倉庫分組,把上面三個倉庫組合在一起對外提供服務灌诅,在本地maven基礎配置settings.xml中使用售担。
nexus3中央倉庫改為阿里云
https://maven.aliyun.com/repository/central
配置文件
<?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">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>h*yi</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>h*yi</password>
</server>
<server>
<id>central</id>
<username>admin</username>
<password>h*yi</password>
</server>
</servers>
<mirrors>
<mirror>
<id>central</id>
<mirrorOf>*</mirrorOf>
<name>Central Repository</name>
<url>http://139.155.180.*:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>Nexus</id>
<url>http://139.155.180.*:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</settings>
發(fā)布包
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://你的maven地址/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://你的maven地址/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
如果出現(xiàn)
from/to central (http://139.155.180.170:8081/repository/maven-public/): Not authorized
檢查server對應的id和mirror的id是否一致