maven包上传私服
我们使用的版本是 nexus respository manager 3.17.0-01 ,下面是基于此版本的一套使用手册
- 下载并导入maven配置 settings.xml ;
<?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">
<localRepository>D:\work\project\repository</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<mirrors>
<!-- 阿里云仓库-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<!-- 中央仓库1-->
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<!-- 中央仓库2-->
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>public</id>
<mirrorOf>central</mirrorOf>
<name>central repository</name>
<url>http://仓库地址/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexusProfile</id>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>http://仓库地址/repository/maven-central/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexusProfile</activeProfile>
</activeProfiles>
<servers>
<server>
<id>releases</id>
<username>仓库用户名</username>
<password>仓库密码</password>
</server>
<server>
<id>snapshots</id>
<username>仓库用户名</username>
<password>仓库密码</password>
</server>
</servers>
</settings>
- 配置本地项目pom.xml,加入配置
<distributionManagement>
<repository>
<id>releases</id>
<name>User Project RELEASES</name>
<url>http://10.109.20.137:8091/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>User Project SNAPSHOTS</name>
<url>http://10.109.20.137:8091/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
|
- 如何上传jar包到私服仓库
选择需要上传的项目右键-->Run As-->Run Configurations-->Maven Buid-->右键 new -->选择 base directory-->配置 Goals 输入 deploy -e

浙公网安备 33010602011771号