maven项目配置时私服nexus以及仓库repository的一些情况
来源:互联网 发布:a5网站源码 编辑:程序博客网 时间:2024/04/27 16:23
前几日碰到了一个项目,主要是基于一个开源项目的二次开发,
主项目的pom.xml有如下代码段
<!-- 设定除中央仓库(repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查找. --><repositories><!-- 如有Nexus私服, 取消注释并指向正确的服务器地址. <repository> <id>nexus-repos</id> <name>Team Nexus Repository</name> <url>http://localhost:8081/nexus/content/groups/public</url> </repository> --> <repository><id>central-repos</id><name>Central Repository</name><url>http://repo.maven.apache.org/maven2</url><snapshots><enabled>false</enabled></snapshots></repository><repository><id>springsource-repos</id><name>SpringSource Repository</name><url>http://repo.springsource.org/libs-milestone-local</url><snapshots><enabled>false</enabled></snapshots></repository>这里就是为了防止私服中央仓库没有找到jar的时候需要本地直接去springsource-repos引用仓库寻找。
这里可以把这里面的一些仓库repostory的url在nexus中进行设置。
1.添加proxy repository。然后设置相应的id,name,以及url。
2.然后添加需要使用到的repository到 public group中,如下
设置好之后进行刷新
查看
是否有这样的 remoxxxx。就是被阻塞了。这个时候 这个repository就要在pom.xml文件中进行配置了。
---------------------------------------------------------------------------------------------------------------------------------------
这时候要配置maven的镜像。
打开maven安装目录下的conf-----》settings.xml文件。
<mirrors> <mirror> <id>central</id> <mirrorOf>*</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </mirror>
xxx
下面还要配置一个
<profiles> <profile> <id>central-repos</id> <repositories> <repository> <id>central</id> <name>central_nexus</name> <url>http://localhost:8081/nexus/content/groups/public/</url> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> </repositories> </profile>然后要启动这个profile。
<activeProfiles> <activeProfile>central-repos</activeProfile> </activeProfiles> <!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles>这样就可以使用了。具体这个配置还是参考孔浩老师的maven配置吧。
另外记得配置用户名和密码,一般使用admin和admin123就可以了。
<server> <id>test-log-snapshot</id> <username>deployment</username> <password>deployment123</password> </server><server> <id>user-releases</id> <username>deployment</username> <password>deployment123</password> </server><server> <id>user-snapshots</id> <username>deployment</username> <password>deployment123</password> </server>
这里把上面的改成admin和admin123吧。具体忘了。。。。。╮(╯▽╰)╭
然后一直重启eclipse,update maven项目。
看下可以否。。。
- maven项目配置时私服nexus以及仓库repository的一些情况
- 搭建Nexus Repository 3.6.0-02和配置apache-maven-3.5.2和本地的local Repository以及项目的pom.xml(IDEA 打包等)
- MyEclipse 配置maven项目pom.xml设置 上传项目到nexus私服,通过中转仓库下载插件,以及nexus的配置
- nexus 配置maven仓库
- Maven仓库管理器Nexus的安装配置
- Maven仓库管理器Nexus的安装配置
- Maven仓库管理器Nexus的安装配置
- Maven本地仓库nexus的安装配置
- Nexus OSS私服仓库的安装和配置以及与Maven整合配置
- Nexus OSS私服仓库的安装和配置以及与Maven整合配置
- maven项目中pom文件配置nexus仓库
- nexus的仓库介绍,以及配置远程仓库
- nexus的仓库介绍,以及配置远程仓库
- nexus的仓库介绍,以及配置远程仓库
- nexus的仓库介绍,以及配置远程仓库
- maven配置使用nexus仓库
- nexus maven 本地仓库配置
- maven,nexus远程仓库配置
- 用Lucene索引数据库 .
- 初学两个月java程序开发的总结
- java 获得系统时间 转换成字符串
- C++11里面的Lambda表达式
- 9.0常见问题、教程汇总【20130319更新】
- maven项目配置时私服nexus以及仓库repository的一些情况
- 数据结构中单链表的实现+单链表的C语言实现源代码
- 销售订单开票信息
- html、javascript 学习小记
- Linux SSH远程文件/目录传输命令scp
- 网站布局之使用按钮的 二选一
- hdu 2047 阿牛的EOF牛肉串
- hdu 3722 (KM)
- VMware虚拟机中Linux网络配置