不要被公司局限自己的技术栈,还得抽时间提升自己!!!
最近在docker上搭建了nexus,实战jar上传下载过程中遇到的问题,记录一下(你也可能遇到的坑),下一篇介绍nexus搭建https://mp.csdn.net/console/editor/html/105124404
1、配置maven settings文件,添加nexus server
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>test</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
配置pom.xml
<distributionManagement>
<repository>
<id>releases</id>
<name>Repository</name>
<url>http://127.0.0.1:8081/repository/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshot Repository</name>
<url>http://127.0.0.1:8081/repository/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<!--local库配置-->
<repository>
<id>releases</id>
<name>private maven release</name>
<url>http://127.0.0.1:8081/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshots</id>
<name>private maven snapshot</name>
<url>http://127.0.0.1:8081/repository/snapshots/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
编译成功后deploy
2、命令式
-DgroupId=jar包的组名
-DartifactId=jar包名称
-Dversion=jar包版本
-Dfile=jar包绝对路径
-DrepositoryId=仓库名称(releases)
cmd命令窗口执行(不需要pom,项目deploy才需要pom)