跟着小编一起来看一看吧!maven仓库配置文件详解一前提已经安装好JDK8并配置好环境。

maven仓库配置文件详解?已经安装好JDK8并配置好环境可以参考:手把手教你Windows安装JDK8与环境配置,我来为大家讲解一下关于maven仓库配置文件详解?跟着小编一起来看一看吧!
maven仓库配置文件详解
一 前提已经安装好JDK8并配置好环境。可以参考:手把手教你Windows安装JDK8与环境配置
二 上传nexus上传nexus-2.11.2-03-bundle.tar.gz到/usr/local/src/目录
三 解压cd /root/mkdir nexustar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexuscd nexus
编辑Nexus的nexus.properties文件,配置端口和work目录信息(保留默认)
cd nexus-2.11.2-03lscd confvi nexus.properties# Jetty sectionapplication-port=8081application-host=0.0.0.0nexus-webapp=${bundleBasedir}/nexusnexus-webapp-context-path=/nexus# Nexus sectionnexus-work=${bundleBasedir}/./sonatype-work/nexusruntime=${bundleBasedir}/nexus/WEB-INF
编辑nexus脚本,配置RUN_AS_USER参数
vi /root/nexus/nexus-2.11.2-03/bin/nexus#RUN_AS_USER=改为:RUN_AS_USER=root
防火墙打开8081端口
vi /etc/sysconfig/iptables添加-A INPUT -p tcp -m state --state NEW -m tcp --dport 8081 -j ACCEPT保存后重启防火墙service iptables restart
/root/nexus/nexus-2.11.2-03/bin/nexus start
# 访问下面的地址,IP换成服务器的IP地址http://IP:8081/nexus/
默认用户名:admin,默认密码:admin123至此,Nexus已安装完成,接下来是Nexus的配置Nexus配置(登录后)一 菜单Administration/Server配置邮箱服务器地址(如果忘记密码,可以通过该邮箱找回密码)
二 给用户配置邮箱地址,方便忘记密码时找回:
三 用户修改密码:
四 仓库类型
五 设置proxy代理仓库(Apache Snapshots/Central/Codehaus Snapshots)准许远程下载
六 Maven本地库的安装与配置环境变量、setting.xml<setting>标签下:注意换掉IP为自己服务器的地址。
<profiles><profile><id>edu</id><activation><activeByDefault>false</activeByDefault><jdk>1.8</jdk></activation><repositories><!-- 私有库地址--><repository><id>nexus</id><url>http://IP:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><!--插件库地址--><pluginRepository><id>nexus</id><url>http://IP:8081/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories></profile></profiles>
