基于nexus搭建本地仓库的步骤:
1、下载nexus,启动nexus,在nexus目录\bin\jsw\windows-x86-32目录下启动nexus,或者安装nexus服务。
2、可以在nexus目录下的conf目录下修改nexus.properties修改一些参数,比如启动端口,nexus的工作目录等
3、在maven的setting.xml中的profiles下添加如下配置:
<profile>
<id>nexus-public</id>
<repositories>
<repository>
<id>nexus</id>
<url>http://localhost:9090/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
4、激活profile,添加如下配置:
<activeProfiles>
<activeProfile>nexus-public</activeProfile>
</activeProfiles>
这样就ok了,当你在pom.xml文件添加依赖时,首先会去nexus中找,如果没有的话再去maven 中心仓库中下载,关于nexus的使用,大家自己可以上网找找资料学习一下。但是这样还会有一个问题,如果有人在完成这个项目之后给大家共享,就还需要以下步骤了:
1、在setting.xml文件中添加:
<!-- 构建发布是需要登录 -->
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
2、在pom.xml中添加:
<!-- 构件发布管理 -->
<distributionManagement>
<!-- 代表release构件 -->
<repository>
<!-- 需要与setting.xml中的server中的id对应 -->
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<!-- 发布的目标url -->
<url>http://localhost:9090/nexus/content/repositories/releases/</url>
</repository>
<!-- 代表snapshots构件 -->
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus snapshots Repository</name>
<url>http://localhost:9090/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
这样就ok了,以上就是所有的maven的知识,其实我没有讲好,是因为我是在一天一口气写了这三篇文章,随后我会把这三篇文件优化一下,尤其是第二篇文章,我觉得太不详细了,有点简陋,里面的各个元素代表什么作用也没给大家讲,但是这方面的资料网上已经很多了,但是关于模块化的东西比较少。
分享到:
相关推荐
nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库nexus 搭建 maven仓库
使用nexus可以方便的搭建本地仓库,避免连接远程仓库带来的速度慢的烦恼
提供了基于Nexus搭建Maven私服所需要的一切资源和个人经验,搭建后可maven deploy 上传自己的jar包。别人如何在自己的maven项目中引用我将单独再上传一份。
Windows 下Nexus搭建Maven私服 Windows 下Nexus搭建Maven私服
Maven Nexus 私服搭建 从零开始,资源下载、安装指导、开发配置说明
Maven本地仓库搭建工具nexus-2.11.4-01-bundle.zip
自己摸索中搭建的本地maven服务器,很好用,很方便团队开发jar包的管理
关于使用Nexus搭建Maven私服的开发文档。新手了解一下。
maven3+nexus2搭建本地和私有仓库详细步骤 ,有图有真相,希望对你有帮助
Nexus搭建Maven私服 +maven安装步骤
使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。使用Nexus搭建Maven私有仓库详细讲解。
Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问
使用nexus 可以搭建maven私服,如何使用nexus搭建maven 本地服务器呢?
maven使用及Nexus搭建Maven私服
nexus maven 私服搭建,附带搭建教程。
Maven私服Nexus搭建详细配置介绍,需要修改settings.xml、pom.xml等文件的参数
构建java的nexus私人仓库和maven的搭建,方便本地团队的仓库管理。
使用Nexus搭建Maven私有仓库
nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建nexus maven私服搭建