1.推送到本地仓库
idea直接install即可
2.推送到公司私库
2.1 使用配置公司仓库地址的setting文件
<?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">
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>admin</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>center</id>
<mirrorOf>*</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://192.168.6.1/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>releases</id>
<mirrorOf>*</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://192.168.6.1/nexus/content/groups/releases</url>
</mirror>
<mirror>
<id>thirdparty</id>
<mirrorOf>*</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://192.168.6.1/nexus/content/repositories/thirdparty</url>
</mirror>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>myprofile</id>
<repositories>
<repository>
<id>central</id>
<url>http://192.168.6.1/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>releases</id>
<url>http://192.168.6.1/nexus/content/groups/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<!--<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
<repositories>
<repository>
<id>jdk16</id>
<name>Repository for JDK 1.6 builds</name>
<url>http://www.myhost.com/maven/jdk16</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
-->
</profile>
</profiles>
<activeProfiles>
<activeProfile>myprofile</activeProfile>
</activeProfiles>
</settings>
2.2 在pom中添加
<distributionManagement>
<repository>
<id>admin</id>
<name>release</name>
<url>http://192.168.6.1/nexus/content/repositories/thirdparty/</url>
</repository>
<snapshotRepository>
<id>admin</id>
<name>maven-snapshots</name>
<url>http://192.168.6.1/nexus/content/repositories/thirdparty/</url>
</snapshotRepository>
</distributionManagement>
注意 : id 里的admin 与 seting文件中的sever id保持一致 url地址注意更改