Maven私有库和本地库的安装与配置[通俗易懂]

Maven私有库和本地库的安装与配置[通俗易懂]一 前提已经安装好JDK8并配置好环境。可以参考:手把手教你Windows安装JDK8与环境配置二 上传nexus上传nexus-2.11.2-

大家好,欢迎来到IT知识分享网。

一 前提

已经安装好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

IT知识分享网

四 配置文件

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

IT知识分享网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端口

IT知识分享网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私有库和本地库的安装与配置[通俗易懂]

三 用户修改密码:

Maven私有库和本地库的安装与配置[通俗易懂]

四 仓库类型

Maven私有库和本地库的安装与配置[通俗易懂]

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

Maven私有库和本地库的安装与配置[通俗易懂]

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>

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/6895.html

(0)
上一篇 2023-01-03 09:55
下一篇 2023-01-03 09:55

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

关注微信