快捷搜索:  汽车  科技

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)四 仓库类型三 用户修改密码: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七 启动nexus/root/nexus/nexus-2.11.2-03/bin/nexus start八 验证# 访问下面的地址,IP换成服务器的IP地址 http://IP:8081/nexus/九 登录默认用户名:admin,默认密码:admin123至此,Nexus已安装完成,接下来是Nexus的配置Nexus配置(

一 前提

已经安装好JDK8并配置好环境。可以参考:手把手教你Windows安装JDK8与环境配置

二 上传nexus

上传nexus-2.11.2-03-bundle.tar.gz到/usr/local/src/目录

三 解压

cd /root/ mkdir nexus tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus cd nexus四 配置文件

编辑Nexus的nexus.properties文件,配置端口和work目录信息(保留默认)

cd nexus-2.11.2-03 ls cd conf vi nexus.properties # Jetty section application-port=8081 application-host=0.0.0.0 nexus-webapp=${bundleBasedir}/nexus nexus-webapp-context-path=/nexus # Nexus section nexus-work=${bundleBasedir}/../sonatype-work/nexus runtime=${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七 启动nexus

/root/nexus/nexus-2.11.2-03/bin/nexus start八 验证

# 访问下面的地址,IP换成服务器的IP地址 http://IP:8081/nexus/九 登录

默认用户名:admin,默认密码:admin123
至此,Nexus已安装完成,接下来是Nexus的配置

Nexus配置(登录后)
一 菜单Administration/Server配置邮箱服务器地址(如果忘记密码,可以通过该邮箱找回密码)

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)(1)

二 给用户配置邮箱地址,方便忘记密码时找回:

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)(2)

三 用户修改密码:

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)(3)

四 仓库类型

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)(4)

五 设置proxy代理仓库(Apache Snapshots/Central/Codehaus Snapshots)准许远程下载

maven 镜像和仓库设置(Maven私有库和本地库的安装与配置)(5)

六 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>

猜您喜欢: