确保IDEA中项目为Maven项目,并且在nexus中已经创建了Maven私服。
一、Linux 安装Nexus3.42.0-01图文教程
二、nexus创建Maven私服图文教程
三、使用nexus上传jar包图文教程
<distributionManagement>
<repository>
<id>test_hostedid>
<name>Releasesname>
<url>http://t-test.dmsd.tech:8089/repository/test_hosted/url>
repository>
<snapshotRepository>
<id>test_snapshot_hostedid>
<name>Snapshotname>
<url>http://t-test.dmsd.tech:8089/repository/test_snapshot_hosted/url>
snapshotRepository>
distributionManagement>
<servers>
<server>
<id>test_snapshot_hostedid>
<username>adminusername>
<password>adminpassword>
server>
<server>
<id>test_hostedid>
<username>adminusername>
<password>adminpassword>
server>
servers>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0">
<localRepository>F:\maven\apache-maven-3.6.1\reponsitorylocalRepository>
<servers>
<server>
<id>test_snapshot_hostedid>
<username>adminusername>
<password>adminpassword>
server>
<server>
<id>test_hostedid>
<username>adminusername>
<password>adminpassword>
server>
servers>
<mirrors>
<mirror>
<id>nexusid>
<name>nexus repositoryname>
<url>http://t-test.dmsd.tech:8089/repository/test_group/url>
<mirrorOf>centralmirrorOf>
mirror>
mirrors>
settings>
注意:由于pom.xml文件的1.0-SNAPSHOT中以SNAPSHOT为后缀,最终会上传test_snapshot_hosted资源库中
如果以RELEASE为后缀则会上传到test_hosted资源库中。
](https://1000bd.com/contentImg/2024/05/24/34946a1a4dd48165.png)



