nexus war 包 在Tomcat 下的安装方式

下载war包地址:

https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.14.8-01.war

nexus默认用户名和密码

用户名:admin

密码:admin123

直接将 war 包拷贝到Tomcat webapps 目录下,启动Tomcat

问题:

  1. 如果出现nexus 启动不了的问题:检测 tomcat/logs# vi localhost.2018-08-09.log 文件
  2. 如果出现如下所示情况:一般是文件目录权限问题 参考 https://blog.csdn.net/z395624865/article/details/40019781

java.lang.IllegalStateException: Nexus work directory already in use: /root/sonatype-work/nexus
at com.google.common.base.Preconditions.checkState(Preconditions.java:200)
at org.sonatype.nexus.webapp.WebappBootstrap.contextInitialized(WebappBootstrap.java:117)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:985)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

为目录添加权限 chmod -R 777 sonatype-work 后重启Tomcat

如果还有问题,可尝试如下方法

在解压之后的nexus项目里找到WEB-INF\classes目录下的logback.xml文件打开,在<configuration>标签里<root>标签之后添加如下配置:
<logger name=”org.apache.catalina” level=”INFO”></logger>
<contextListener class=”ch.qos.logback.classic.jul.LevelChangePropagator”>
<resetJUL>true</resetJUL>
</contextListener>
然后重启Tomcat服务器,正常

https://blog.csdn.net/se134789836178/article/details/81265342