ubuntu安装maven仓库nexus - 1
2016-05-24 11:13
597 查看
转自:http://blog.csdn.net/dengsilinming/article/details/17635191
现在简述一下在ubuntu下面安装nexus的步骤(这里默认已经安装好了JDK,JDK的安装可以参考的我另一篇文章ubuntu10.0.4安装和卸载jdk):
1. 下载nexus 下载最新版nexus(到目前为止最新版为nexus-2.7.0-05,下载地址http://www.sonatype.org/nexus/go,得到nexus-latest-bundle.tar.gz
2. 下载完成后将nexus-latest-bundle.tar.gz拷贝到/usr/local/目录下,并进入/usr/local目录
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
#:sudo cp nexus-latest-bundle.tar.gz /usr/local/
#:cd /usr/local
3. 解压nexus-latest-bundle.tar.gz,得到nexus-2.7.0-05和sonatype-work,并做一个软链接
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
tar -zxvf nexus-latest-bundle.tar.gz
ln -s nexus-2.7.0-04 nexus2
4.运行nexus
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
cd nexus2
./bin/nexus start
如果运气好会运行成功,这里之所以说运气,是因为各种原因会造成运行失败,如果成功会看到如下显示信息:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
Starting Nexus OSS....
Started Nexus OSS
如果失败会看到:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
Starting Nexus OSS...
Failed to start Nexus OSS.
引起失败的原因可能是权限问题:nexus所在的安装目录属于私有权限,它的拥有者是root用户,这时需要将nexus所在的目录分配给当前用户(Nexus不建议用root权限启动运行nexus),这里的授权就自己去看chown命令的用法了;
如果安装成功但在浏览器中访问不了(访问默认地址:http://localhost:8081/nexus),通过查看wrapper.log日志可能会看到“Unable to start java JVM:No such file or directory",此时需要将wrapper.conf文件里面的wapper.java.command=java修改成wapper.java.command=%JAVA_HOME%/bin/java(就是安装jdk所在的文件路径);
此外还有各种异常出现,这里就不再罗列,大家遇到就自己上网google吧。
下面说下我在安装后启动时遇到的问题:
1. Unable to start java JVM:No such file or directory,解决方法,修改wapper.conf配置文件里面的wapper.java.command。我开始修改成wapper.java.command={JAVA_HOME}/bin/java,但根本不起作用,看网上很我资料也说是改成那样,最后无意中看到一篇文章(具体是哪篇忘记了)说是改wapper.java.command=%JAVA_HOME%/bin/java,要用%%而不是用{}。
2.还有一个问题就是启动时报如下异常
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
/usr/local/nexus$ ./bin/nexus console
Running Nexus OSS...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Starting with arguments: [./conf/jetty.xml]
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - JVM ID: 1, JVM PID: 2594, Wrapper PID: 2592, User: linming
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Current directory: /usr/local/nexus-2.7.0-05
jvm 1 | 2013-12-31 20:07:57 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Temp directory: /usr/local/sonatype-work/nexus/tmp
jvm 1 | 2013-12-31 20:07:57 ERROR [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Failed to start
jvm 1 | java.nio.file.AccessDeniedException: /usr/local/sonatype-work/nexus/tmp
jvm 1 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:382) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createDirectory(Files.java:628) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:732) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createDirectories(Files.java:718) ~[na:1.7.0_07]
jvm 1 | at org.sonatype.nexus.bootstrap.Launcher.ensureTmpDirSanity(Launcher.java:247) ~[nexus-bootstrap-2.7.0-05.jar:2.7.0-05]
jvm 1 | at org.sonatype.nexus.bootstrap.Launcher.start(Launcher.java:95) ~[nexus-bootstrap-2.7.0-05.jar:2.7.0-05]
解决方法:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
![](https://code.csdn.net/assets/ico_fork.svg)
sudo chmod -R 777 sonatype-work/nexus
功夫不负有心人,看上去很简单的安装、启动操作,却让我费尽了脑汁(也许与我不太熟悉有关系),这里最想说的是动手、动手、最终还是得自己多动手。
在浏览器中访问:localhost:8081/nexus,OK,能成功访问,输入用户名与密码(默认的admin、admin123)就可以管理自己的maven本地仓库了
现在简述一下在ubuntu下面安装nexus的步骤(这里默认已经安装好了JDK,JDK的安装可以参考的我另一篇文章ubuntu10.0.4安装和卸载jdk):
1. 下载nexus 下载最新版nexus(到目前为止最新版为nexus-2.7.0-05,下载地址http://www.sonatype.org/nexus/go,得到nexus-latest-bundle.tar.gz
2. 下载完成后将nexus-latest-bundle.tar.gz拷贝到/usr/local/目录下,并进入/usr/local目录
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
#:sudo cp nexus-latest-bundle.tar.gz /usr/local/
#:cd /usr/local
3. 解压nexus-latest-bundle.tar.gz,得到nexus-2.7.0-05和sonatype-work,并做一个软链接
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
tar -zxvf nexus-latest-bundle.tar.gz
ln -s nexus-2.7.0-04 nexus2
4.运行nexus
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
cd nexus2
./bin/nexus start
如果运气好会运行成功,这里之所以说运气,是因为各种原因会造成运行失败,如果成功会看到如下显示信息:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
Starting Nexus OSS....
Started Nexus OSS
如果失败会看到:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
Starting Nexus OSS...
Failed to start Nexus OSS.
引起失败的原因可能是权限问题:nexus所在的安装目录属于私有权限,它的拥有者是root用户,这时需要将nexus所在的目录分配给当前用户(Nexus不建议用root权限启动运行nexus),这里的授权就自己去看chown命令的用法了;
如果安装成功但在浏览器中访问不了(访问默认地址:http://localhost:8081/nexus),通过查看wrapper.log日志可能会看到“Unable to start java JVM:No such file or directory",此时需要将wrapper.conf文件里面的wapper.java.command=java修改成wapper.java.command=%JAVA_HOME%/bin/java(就是安装jdk所在的文件路径);
此外还有各种异常出现,这里就不再罗列,大家遇到就自己上网google吧。
下面说下我在安装后启动时遇到的问题:
1. Unable to start java JVM:No such file or directory,解决方法,修改wapper.conf配置文件里面的wapper.java.command。我开始修改成wapper.java.command={JAVA_HOME}/bin/java,但根本不起作用,看网上很我资料也说是改成那样,最后无意中看到一篇文章(具体是哪篇忘记了)说是改wapper.java.command=%JAVA_HOME%/bin/java,要用%%而不是用{}。
2.还有一个问题就是启动时报如下异常
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
/usr/local/nexus$ ./bin/nexus console
Running Nexus OSS...
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Starting with arguments: [./conf/jetty.xml]
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - JVM ID: 1, JVM PID: 2594, Wrapper PID: 2592, User: linming
jvm 1 | 2013-12-31 20:07:56 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Current directory: /usr/local/nexus-2.7.0-05
jvm 1 | 2013-12-31 20:07:57 INFO [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Temp directory: /usr/local/sonatype-work/nexus/tmp
jvm 1 | 2013-12-31 20:07:57 ERROR [WrapperListener_start_runner] - org.sonatype.nexus.bootstrap.jsw.JswLauncher - Failed to start
jvm 1 | java.nio.file.AccessDeniedException: /usr/local/sonatype-work/nexus/tmp
jvm 1 | at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.7.0_07]
jvm 1 | at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:382) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createDirectory(Files.java:628) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createAndCheckIsDirectory(Files.java:732) ~[na:1.7.0_07]
jvm 1 | at java.nio.file.Files.createDirectories(Files.java:718) ~[na:1.7.0_07]
jvm 1 | at org.sonatype.nexus.bootstrap.Launcher.ensureTmpDirSanity(Launcher.java:247) ~[nexus-bootstrap-2.7.0-05.jar:2.7.0-05]
jvm 1 | at org.sonatype.nexus.bootstrap.Launcher.start(Launcher.java:95) ~[nexus-bootstrap-2.7.0-05.jar:2.7.0-05]
解决方法:
[html] view
plain copy
![](https://code.csdn.net/assets/CODE_ico.png)
sudo chmod -R 777 sonatype-work/nexus
功夫不负有心人,看上去很简单的安装、启动操作,却让我费尽了脑汁(也许与我不太熟悉有关系),这里最想说的是动手、动手、最终还是得自己多动手。
在浏览器中访问:localhost:8081/nexus,OK,能成功访问,输入用户名与密码(默认的admin、admin123)就可以管理自己的maven本地仓库了
相关文章推荐
- 136.Kth Largest Element in an Array
- Android 在非主线程中更新UI也能成功原因详解
- 文章标题
- java常用设计模式
- ASP.NET SignalR 与LayIM配合,轻松实现网站客服聊天室(七)之 图文,附件消息(2016-05-05 12:13)
- 在SQL Server中快速删除重复记录
- 将EnyimMemcached从.NET Core RC1升级至RC2
- easyui datagrid使用问题和解决办法总结
- View的绘制
- 重置:毕业礼包论文查重
- 前途漫漫,努力才是王道
- Palindrome Linked List
- Android APK瘦身/减小包体
- Golang中的测试
- CSS3弹性盒模型flex box快速入门 2016.03.16
- Online Object Tracking: A Benchmark 翻译
- iOS创建管理当前账号的单例类
- pl/sql 创建并执行oralce存储过程,并返回结果集
- HTML CSS + DIV实现整体布局
- 桥接模式(Bridge Pattern)