一 配置settings.xml
在settings.xml的<servers></servers>中配置:
<server>
<id>my-maven-public</id>
<username>damin</username>
<password>admin</password>
</server>
二
1.在Idea中直接deploy
在pom文件中配置:
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>maven-snapshots</name>
<url>http://maven.my.com/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
2.用命令上传
mvn deploy:deploy-file -DgroupId=com.my -DartifactId=test -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=E:\test.jar -Durl=http://maven.my.com/repository/maven-snapshots/ -DrepositoryId=snapshots
Dfile:需要上传的jar包的绝对路径
Durl:私服上仓库的位置
DrepositoryId:服务器的表示id
Dversion:版本信息