设置maven的配置文件
1>:指定本地仓库位置:
<localRepository>E:\java\Maven\apache-maven-3.5.2\jar</localRepository>
2>:配置镜像路径
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</mirror>
</mirrors>
3>:设置镜像
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://repol.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repol.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
4>:如果要从项目中把 整个仓库上传到nexus中还需要配置 账户权限
这里我配置了两个
<servers>
|
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>
指定了0.0.1-SNAPSHOT
即上传的位置在snopshots仓库中
到这里maven搭建完毕 如果出现配置错误可以参考学习
http://www.cnblogs.com/chowmin/articles/3930277.html
配置完成后就可以运用idea编辑器进行上传
并且还有在Pom.xml文件中配置