欢迎使用普元产品知识库,本知识库包含普元应用开发平台EOSPlatform,流程平台BPS,企业服务总线ESB,微服务平台Microservice,运维管理平台Devops,数据集成平台DI
欢迎使用普元文档库
PRIMETON INFORMATION TECHNOLOGIES, LTD.
普元信息技术 股份 有限公司
Nexus私服搭建指南
No part of this document may be reproduced, stored in any electronic retrieval system, or transmitted in any form or by any means, mechanical, photocopying, recording, otherwise, without the written permission of the copyright owner.
文档修订记录
序号 | 版本号 | 修订日期 | 修订概述 | 修订人 | 审批人 | 备注 |
1 | 0.5 | 2016.11.28 | 创建文档 | 董晨程 |
| 初稿 |
2 | 1.0 | 2016.12.1 | 评审并修改 | 董晨程 | 郝炎峰,李小飞,赵二龙,王伟龙,王磊 | 终审 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
目录
6 .1 出现“wrapper | OpenSCManager failed - 拒绝访问。 (0x5)”。
本文详细叙述了Nexus的安装和EOS仓库的部署,为想要使用Nexus搭建Maven私服并部署EOS相关仓库的用户提供帮助。
使用EOS Platform,并且需要搭建maven私服的用户。
(已经安装Nexus的用户,可以跳过安装部分,直接阅读“4.EOS仓库部署”部分。)
本文档适应于EOS Platfo r m 7.6开发版和Nexus2.14版。
JDK:1.7及以上版本,并配置相关环境变量。
首先,我们需要从官网上下载Nexus安装包。
Nexus2.14下载地址:
https://www.sonatype.com/download-oss-sonatype
下载nexus-2.14.1-01-bundle.zip后解压至某一目录,路径中最好不要带中文名称及空格,解压后目录清单如下:
解压后,进入安装目录下nexus-2.14.1-01\bin\目录:
使用管理员权限打开cmd,在当前文件夹下执行以下命令安装服务:
nexus install |
有两种启动方式:
1.使用管理员权限打开cmd在当前文件 夹下执行以下命令:
nexus start |
2.右键电脑-->管理-->服务-->nexus-->启动。(可设置为手动启动。)
默认地址为: http://localhost:8081/nexus/ ,访问后显示如下内容,则说明启动成功:
JDK:1.7及以上版本,并配置相关环境变量。
首先,我们需要从官网上下载Nexus安装包。
Nexus2.14下载地址:
https://www.sonatype.com/download-oss-sonatype
下载nexus-2.14.1-01-bundle.tar.gz并解压即可:
#cd /home/tools #tar zxvf nexus-2.4.0-09-bundle.tar.gz #mv nexus-2.4.0-09 /usr/local/nexus |
使用命令启动:
#cd /usr/local/nexus/bin #./nexus start #./nexus stop |
默认地址为: http://localhost:8081/nexus/ ,访问后显示如下内容,则说明启动成功:
用户已经安装了Nexus2.14,并获得了普元离线编译包storage-eosplatform76.zip。
点击右上角Log in,默认账户密码为:admin/admin123。
Nexus 的仓库分为4类:
由上仓库分类,我们可以新建一个hosted仓库以供使用。
点击Add,选择hosted仓库:
填入ID和name:
点击Save。
进入安装目录下\sonatype-work\nexus\storage\,这里保存的是Nexus所有仓库的信息和jar包,进入我们新建的仓库test:
然后将storage-eosplatform76.zip解压到安装目录下\sonatype-work\nexus\storage\test\文件夹下:
在浏览器中,选择新建的仓库,点击Browse Storage,并点击刷新,可以看到所需jar包已经导入:
打开maven安装目录,在conf文件夹下setting.xml文件,进行如下配置:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>E:\test</localRepository>
<profiles> <profile> <id>myNexus</id> <repositories> <repository> <id>test</id> <url>http://localhost:8081/nexus/content/repositories/test/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>test</id> <url>http://localhost:8081/nexus/content/repositories/test/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <activeProfile>myNexus</activeProfile> </activeProfiles> </settings>
|
1.localRepository为本地maven存储库地址。
2.profile下ID与activeProfiles中对应。
3.repository和pluginRepository中,ID与我们新建的仓库ID对应,url与Nexus生成的仓库地址对应。
配置完成后maven在获取jar包时,就会从新建仓库中获取。
打开EOS Studio-->窗口-->首选项-->maven-->User Settings,配置setting.xml地址,并点击Update Settings 和 Reindex ,确定。
新建一个EOS项目,右键-->转换为Maven工程:
确定没有报错:
项目上右键-->运行方式-->maven build,执行 clean package 命令:
BUILD SUCCESS即为成功。
打开本地maven库,可以看到从Nexus上得到的jar包:
需要使用管理员权限cmd执行命令。
打开管理员权限cmd方法为:点击开始菜单,在搜索框中输入“cmd”,在搜索结果“命令提示符”上右键,以管理员身份运行。
在安装目录下\nexus-2.14.1-01\conf\nexus.properties配置文件中修改。