Maven下载私服上的jar包
Posted 流易
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Maven下载私服上的jar包相关的知识,希望对你有一定的参考价值。
1、配置M2_HOME/conf/settions.xml
<server> <id>maven-public</id> <username>admin</username> <password>admin123</password> </server>
<mirror> <id>maven-public</id> <mirrorOf>maven-public</mirrorOf> <name>maven-public</name> <url>http://127.0.0.1:8081/repository/maven-public/</url> </mirror>
2、配置需要下载jar包的项目的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.126.at.boazy</groupId>
<artifactId>boazy-test-download</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.126.at.boazy</groupId>
<artifactId>boazy-test-upload</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-public</id>
<name>maven-public</name>
<url>http://127.0.0.1:8081/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</project>
以上是关于Maven下载私服上的jar包的主要内容,如果未能解决你的问题,请参考以下文章