Github Package 私服
demo : http://github.com/sunkz/common
settings.xml
生效顺序 : .m2/settings.xml > $M2_HOME/conf/settings.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| <?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">
<activeProfiles> <activeProfile>nexus</activeProfile> </activeProfiles>
<servers> <server> <id>github</id> <username>sunkz</username> <password>xxxx</password> </server> </servers>
<mirrors> <mirror> <id>aliyun</id> <mirrorOf>central</mirrorOf> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> </mirrors>
<profiles> <profile> <id>nexus</id> <repositories> <repository> <id>central</id> <url>https://repo1.maven.org/maven2</url> </repository> <repository> <id>github</id> <url>https://maven.pkg.github.com/sunkz/common</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles>
</settings>
|
pom.xml
1 2 3 4 5 6 7 8
| <distributionManagement> <repository> <id>github</id> <url>https://maven.pkg.github.com/sunkz/common</url> </repository> </distributionManagement>
|