您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
搭建maven私服(centos7.9)
发布时间:2022-10-08 21:48:56编辑:雪饮阅读()
Jdk环境:
配置:
[root@localhost nexus-2.11.2-03]# tail /etc/profile -n 4
export JAVA_HOME="/maven/jdk1.8.0_221"
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin/
export PATH
生效:
source /etc/profile
私服搭建:
修改运行账户
nexus-2.11.2-03-bundle.tar.gz解压后的nexus脚本的运行用户修改为所用的系统运行账号,如root:
[root@localhost maven]# cat /maven/nexus/nexus-2.11.2-03/bin/nexus | grep RUN_AS_USER
RUN_AS_USER=root
if [ "X$RUN_AS_USER" != "X" ]
if [ "`$IDEXE -u -n`" != "$RUN_AS_USER" ]
# If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be
RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
RUN_AS_GROUP=$RUN_AS_USER
chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
su - $RUN_AS_USER -c "\"$REALPATH\" $2"
if [ ! "`$IDEXE -u -n`" = "$RUN_AS_USER" ]
echo "If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script."
启动/重启nexus服务
[root@localhost maven]# /maven/nexus/nexus-2.11.2-03/bin/nexus restart
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
Stopping Nexus OSS...
Stopped Nexus OSS.
Starting Nexus OSS...
Started Nexus OSS.
服务访问
服务默认访问端口为8081:
[root@localhost maven]# cat /maven/nexus/nexus-2.11.2-03/conf/nexus.properties | grep application-port
application-port=8081
浏览器访问如:
http://192.168.31.80:8081/nexus/
关键字词:maven,私服,centos7.9