本文主要是介绍Windows安装配置Nexus3.6与Maven3.3.9配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.编写目录
用于描述Nexus服务器搭建与maven使用
2.Nexus私服搭建
环境准备
需要安装JDK1.8版本并配置环境变量官网地址
https://www.sonatype.com/download-oss-sonatype下载
下载后解压(注意,路径不要带空格及中文)
nexus-3.6.2-01:安装文件
sonatype-work:工作目录安装完成
默认端口:8081
默认帐号:admin
默认密码:admin123启动nexus
在命令行进入nexus-3.6.2-01/bin目录下输入:nexus /run
首次启动比较慢启动成功:
访问地址
http://localhost:8081修改IP和端口
修改nexus-3.6.2-01/etc/nexus-default.properties文件
3.Maven配置
pom.xml
<distributionManagement><repository><id>nexus-releases</id><name>Nexus Release Repository</name><url>http://localhost:8081/repository/maven-releases/</url></repository><snapshotRepository><id>nexus-snapshots</id><name>Nexus Snapshot Repository</name><url>http://localhost:8081/repository/maven-snapshots/</url></snapshotRepository></distributionManagement>
conf.xml
<localRepository>C:/java/mavenRepository</localRepository>
<server><id>nexus-releases</id><username>admin</username><password>admin123</password>
</server>
<server><id>nexus-snapshots</id><username>admin</username><password>admin123</password>
</server>
<mirror><id>nexus-releases</id><mirrorOf>*</mirrorOf><url>http://localhost:8081/repository/maven-public/</url>
</mirror>
<mirror><id>nexus-snapshots</id><mirrorOf>*</mirrorOf><url>http://localhost:8081/repository/maven-public/</url>
</mirror>
<profile><id>nexus</id><repositories><repository><id>nexus-releases</id><url>http://nexus-releases</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository><repository><id>nexus-snapshots</id><url>http://nexus-snapshots</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>nexus-releases</id><url>http://nexus-releases</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository><pluginRepository><id>nexus-snapshots</id><url>http://nexus-snapshots</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories>
</profile>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
这篇关于Windows安装配置Nexus3.6与Maven3.3.9配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!