<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"> <!--就是配置maven本地倉庫的地址爲自定義的地址--> <localRepository>C:\Users\abc\.m2\repository_demo</localRepository> <!--nexus服務器--> <servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> <server> <id>public</id> <username>admin</username> <password>admin123</password> </server> </servers> <mirrors> <mirror> <id>public</id> <mirrorOf>central</mirrorOf> <name>public central</name> <url>http://localhost:8081/repository/my_group/</url> </mirror> </mirrors> <profiles> <profile> <id>default</id>
<repositories> <repository> <id>releases</id> <url>http://localhost:8081/repository/my_hosted_release/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>snapshots</id> <url>http://localhost:8081/repository/my_hosted_snapshots/</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories>
<!--從遠處倉庫下載 public 包含了能夠不用配置--> <pluginRepositories> <pluginRepository> <id>releases</id> <url>http://localhost:8081/repository/my_hosted_release/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>snapshots</id> <url>http://localhost:8081/repository/my_hosted_snapshots/</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>default</activeProfile> </activeProfiles> </settings>
上傳到私有庫配置apache
<!--上傳到私有庫--> <distributionManagement> <repository> <id>releases</id> <name>internal releases</name> <url>http://localhost:8081/repository/my_hosted_release/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>internal snapshot</name> <url>http://localhost:8081/repository/my_hosted_snapshots/</url> </snapshotRepository> </distributionManagement>