nexus nexus3安装
来源:原创
时间:2024-09-18
作者:脚本小站
分类:SHELL
下载页面:注意依赖的java版本
help.sonatype.com/en/download-archives---repository-manager-3.html
java8版本:
yum install java-1.8.0-openjdk
java17版本:
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm yum install jdk-17_linux-x64_bin.rpm -y
下载nexus3-java8:
https://download.sonatype.com/nexus/3/nexus-3.70.2-01-java8-unix.tar.gz
安装:nexus不推荐以root用户运行
tar -xf nexus-3.70.2-01-java8-unix.tar.gz -C /usr/local/ ln -sv nexus-3.70.2-01/ nexus useradd -r -s /bin/false nexus chown -R nexus:nexus /usr/local/nexus /usr/local/sonatype-work/
systemd:
cat > /usr/lib/systemd/system/nexus.service <<EOF [Unit] Description=Nexus Repository Manager After=network.target [Service] Type=simple User=nexus Group=nexus ExecStart=/usr/local/nexus/bin/nexus run ExecStop=/usr/local/nexus/bin/nexus stop Restart=on-failure [Install] WantedBy=multi-user.target EOF
启动:
systemctl start nexus systemctl enable nexus
登录密码:
cat /usr/local/sonatype-work/nexus3/admin.password
使用参考以及存储配置:blob存储创建后无法删除和修改
https://blog.csdn.net/wc1695040842/article/details/102575686
修改工作目录(数据目录):把路径中带有sonatype-work字样的目录都改成如下示例。
vim /usr/local/nexus/bin/nexus.vmoptions -Xms2703m -Xmx2703m -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/data/nexus3/sonatype-work/nexus3/log/jvm.log -XX:-OmitStackTraceInFastThrow -Dkaraf.home=. -Dkaraf.base=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/java.util.logging.properties -Dkaraf.data=/data/nexus3/sonatype-work/nexus3 -Dkaraf.log=/data/nexus3/sonatype-work/nexus3/log -Djava.io.tmpdir=/data/nexus3/sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=false -Djdk.tls.ephemeralDHKeySize=2048 # # additional vmoptions needed for Java9+ # --add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module java.base=./lib/endorsed/org.apache.karaf.specs.locator-4.3.9.jar --patch-module java.xml=./lib/endorsed/org.apache.karaf.specs.java.xml-4.3.9.jar --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED --add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED
然后运行程序即可:
sudo -u nexus ./nexus run
如果在 /usr/local/nexus3/bin/nexus.rc 文件中指定了 run_as_user="nexus",则工作目录默认会在 /home/nexus。
nexus使用参考:创建仓库、上传jar包到仓库
blog.csdn.net/wc1695040842/article/details/102575686
- shell检查能否免秘钥
- shell编程,if-then、else,case,数值、字符串、文件类型比较检测,[ ],(()),[[ ]]
- shell 删除空目录
- linux的shell数组变量,给环境变量赋多个值
- shell编程,调整谦让度,调整脚本运行的优先级nice,renice
- shell账号密码登陆
- shell编程,处理用户输入,选项和参数的处理getopts,shift,常见的linux命令选项
- shell编程,定期执行脚本cron,crontab,anacron,定时任务
- shell编程,正则表达式BRE模式,ERE模式
- shell编程,以后台模式运行进程,bg、fg、jobs -l、nohup、&