Maven私服Nexus配置教程
来源:互联网 发布:java反射讲四有变公有 编辑:程序博客网 时间:2024/05/22 01:38
Nexus私服原理图
下载地址是http://www.sonatype.org/nexus/go。默认端口8081。
Nexus常用功能(这里介绍):
1、指定私服的中央地址
2、将自己的Maven项目指定到私服地址
3、从私服下载中央库的项目索引
4、从私服仓库下载依赖组件
5、将第三方项目jar上传到私服供其他项目组使用。
如何使用:
下载最新版nexus,目前是2.12,解压缩后,进入nexus-2.12.0-01\bin\jsw\(根据你的os系统, 选择相应的文件夹,我的是windows64位,所以进入如下界面:
开启Nexus服务后访问url地址http://localhost:8081/nexus/(推荐使用自己的ip地址),之后登录系统,用户名密码分别是:admin/admin123.
点击左侧菜单栏的Repositories按钮。
hosted 类型的仓库,内部项目的发布仓库
releases 内部的模块中release模块的发布仓库
snapshots 发布内部的SNAPSHOT模块的仓库
3rd party 第三方依赖的仓库,这个数据通常是由内部人员自行下载之后发布上去
proxy 类型的仓库,从远程中央仓库中寻找数据的仓库
group 类型的仓库,组仓库用来方便我们开发人员进行设置的仓库
maven项目索引
下载Maven项目索引,项目索引是为了使用者能够在私服站点查找开发所需的jar依赖,选择central,在底下的configuration里选择自动下载。
保存后后台会运行一个任务,点击菜单栏的ScheduledTasks选项即可看到有个任务在RUNNING。
下载完成后,Maven索引就可以使用了,在搜索栏输入要搜索的项,就可以查到相关的信息。例如struts
就可以检索出它的相关信息,复制右下角的pom依赖,就知道怎么配置依赖信息。
如何使用
1、单独一个项目使用这个私服仓库,先在项目pom中配置相关私服信息:
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexus</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
这样只有本项目在私服下载组件,这个Maven项目构建的时候会从私服下载相关依赖。当然这个配置仅仅是在此项目中生效,对于其他项目还是不起作用。
2、如果相对Maven的其他项目也生效的话。需要修改全局的settings.xml文件。
<?xml version="1.0" encoding="UTF-8"?>
<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>D:\00Coding\apache-maven\public_repo</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<id>central</id>
<name>central</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>central</activeProfile>
</activeProfiles>
</settings>
之后所有本机的Maven项目就在私服下载组件。(这样比较好)
宿主库——3rd party
假如我们下载了Oracle的驱动程序jar包想给其他项目组使用,就需要上传该jar包。选中宿主库——3rd party,之后选择Artifact Upload上传至宿主空间。
最后点击上传。先写到这里,要码代码了
- Maven私服Nexus配置教程
- maven 配置nexus私服
- 配置maven私服nexus
- maven私服nexus配置
- nexus配置maven私服
- 配置maven私服nexus
- Maven 私服 Nexus 界面配置
- 安装配置maven私服--nexus
- maven+nexus+Linux配置Maven私服
- windows下maven私服nexus安装教程
- centos下 Maven 私服nexus 搭建教程
- Maven Nexus 详细教程
- maven 下载nexus私服jar配置
- Maven私服--Nexus的本地xml配置
- 用nexus搭建maven私服 配置
- maven私服nexus的安装、配置、使用
- 搭建Maven私服,并配置Nexus环境
- centos 下 nexus 私服 以及maven配置
- 关于ocx控件的跨语言使用
- 镶嵌数据集的基本操作
- 使用命名空间:别名/导入
- 利用CocoaHTTPServer实现wifi局域网传输文件到iphone
- RPC框架几行代码就够了
- Maven私服Nexus配置教程
- HDOJ 2033 人见人爱A+B
- 使用ssh正向连接、反向连接、做socks proxy的方法
- HTTP POST GET 本质区别详解
- 二进制漏洞挖掘技术实战
- 用python解决ldap的Size limit exceeded问题!
- Zend Studio 使用 Xdebug 断点调试
- VS2010关于error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- Solr 搭建搜索服务器