POM文件新增以下配置:maven
<repositories> <repository> <id>nexus-public</id> <name>nexus-public</name> <url>http://<Host>:8091/nexus/repository/maven-public/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> </repositories>
maven 本地配置文件settings.xml新增以下配置:this
<profile>
<id>security</id>
<pluginRepositories>
<pluginRepository>
<id>nexus-public</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://<Host>:8091/nexus/repository/maven-public/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>nexus-public</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<url>http://<Host>:8091/nexus/repository/maven-public/</url>
</repository>
<profile>
<id>NexusRepo</id>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo1.maven.org/maven2/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</repositories>
</profile>url
<activeProfiles>
<activeProfile>security</activeProfile>
</activeProfiles>spa
-------------------------------------------------------------------------------------------------------------server
<mirror>
<id>nexus-mirror</id>
<mirrorOf>*</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://<Host>:8091/nexus/repository/maven-public/</url>
</mirror>xml
===============================================================it
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshot</id>
<username>admin</username>
<password>admin123</password>
</server>io
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>配置
deploy項目POM文件新增以下配置:date
<distributionManagement> <repository> <id>nexus-releases</id> <name>Releases</name> <url>http://<Host>:8091/nexus/repository/maven-releases/</url> </repository> <snapshotRepository> <id>nexus-snapshot</id> <name>Snapshot</name> <url>http://<Host>:8091/nexus/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
>>> mvn clean deploy
END.