您的位置:首页 > 运维架构 > Linux

CentOS安装nexus

2016-04-19 22:18 357 查看
1, Nexus 下载Nexus 官方下载, 最新版下载: nexus-2.4.0-09-bundle.tar.gzNexus war下载: nexus-2.4.0-09.war
nexus有两种安装实现方式,一种是war包的方式,将它直接放在例如tomcat下就可以启用的,还有一种源码的方式,做为一个运维还是喜欢源码方式的说哈。开始吧。。。

2, Nexus 安装 解压tar.gz文件: #cd /home/tools#tar zxvf nexus-2.4.0-09-bundle.tar.gz
移动目录#mv nexus-2.4.0-09 /usr/local/nexus
3, Nexus 启动nexus启动是在bin目录下,首先看一下启动/关闭/重启等命令, 输入命令:#cd /usr/local/nexus/bin#./nexus出现如下选项:

[root@test01 bin]# ./nexusUsage: ./nexus { console | start | stop | restart | status | dump }
启动nexus:#./nexus start

关闭nexus: #./nexus stop

4, Nexus 验证启动nexus后,在本机浏览器输入地址: http://localhost:8081/nexus


出现上述页面,说明配置nexus成功!
点击右上角“Log in”, 输入用户名和密码(默认用户名:admin 密码: admin123)登录

5.设置1.点击左侧 Repositories将所有Type 是 proxy 的 configuration配置选项中的 Download Remote Index 配置改为 True 如果需要代理将配置最下面的Override Http Proxy Setting 勾上并填写代理服务器地址和端口,最后保存设置2.然后在列表中分别右键点击 ReIndex3、添加自己的jar到nexus  选中 3rd party , Artifact Upload 标签  GAV Definition 选择GAV Parameters  填写 Group Artifact version packaging  然后选择jar包 上传提交即可。

nexus私服linux搭建问题
2、这时候提示:****************************************
WARNING – NOT RECOMMENDED TO RUN AS ROOT
****************************************
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.
大概意思就是要在环境配置export RUN_AS_USER=root,临时配置在命令行下输入:export RUN_AS_USER=root然后执行,就不会再提示了
./nexus start
3、也可以在系统里面永久配置vi /etc/profile 加入export RUN_AS_USER=root
三、启动之后查看日志(日志路径:nexus/logs)报:wrapper | Reloading Wrapper configuration...
wrapper | Launching a JVM...
wrapper | JVM exited while loading the application.
jvm 5 | Exception in thread "main" java.lang.UnsupportedClassVersionError: org/sonatype/nexus/bootstrap/jsw/JswLauncher : Unsupported major.minor version 51.0
jvm 5 | at java.lang.ClassLoader.defineClass1(Native Method)
jvm 5 | at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
jvm 5 | at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
jvm 5 | at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
jvm 5 | at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
jvm 5 | at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
jvm 5 | at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
jvm 5 | at java.security.AccessController.doPrivileged(Native Method)
jvm 5 | at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
jvm 5 | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
jvm 5 | at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
jvm 5 | Could not find the main class: org.sonatype.nexus.bootstrap.jsw.JswLauncher. Program will exit.
wrapper | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
wrapper | There may be a configuration problem: please check the logs.
wrapper | <-- Wrapper Stopped
网上解释是要JAVA7才行。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: