maven仓库私服配置

私服访问地址:[[http://192.168.1.252:9080/nexus/content/groups/public/ 地址]]

1. 打开eclipse/myeclipse的maven插件:
点菜单 Window ---> Preferences,找到maven插件,点开User Settings配置项,找到使用的settings.xml文件位置,用UltraEdit或其他XML编辑器打开该文件

2. 修改settings.xml配置:
2.1 文件开头的localRepository节点,设置本地maven仓库路径,如

            <localRepository>D:/MavenRepository</localRepository>

 

2.2  文件结尾的profiles节点,设置远程maven仓库路径,如:
      <profiles>
          .........其他profile配置......
          <profile>     
              <id>remote_repo1_Profiel</id>
              <repositories>
                    <repository>     
                       <id>repo1-maven-central</id>     
                       <name>repo1 maven</name>     
                       <url>http://repo1.maven.org/maven2/</url>     
                       <releases>     
                            <enabled>true</enabled>     
                       </releases>     
                       <snapshots>     
                            <enabled>false</enabled>     
                       </snapshots>    
                   </repository>
                   <repository>     
                       <id>repository-apache</id>     
                       <name>repository apache maven</name>     
                       <url>https://repository.apache.org/content/groups/public/</url>     
                       <releases>     
                            <enabled>true</enabled>     
                       </releases>     
                       <snapshots>     
                            <enabled>false</enabled>     
                       </snapshots>    
                   </repository>
              </repositories> 
          </profile>

          <profile>     
              <id>jsecodeProfiel</id>
              <repositories>
                    <repository>     
                       <id>jsecode-maven-central</id>     
                       <name>jsecode maven</name>     
                       <url>http://192.168.1.252:9080/nexus/content/groups/public/</url>     
                       <releases>     
                            <enabled>true</enabled>     
                       </releases>     
                       <snapshots>     
                            <enabled>false</enabled>     
                       </snapshots>    
                   </repository>
              </repositories> 
           </profile>
      </profiles>

       <activeProfiles>
            <activeProfile>jsecodeProfiel</activeProfile>
       </activeProfiles>

上面配置了两个profile,第一个profile唯一性ID为remote_repo1_Profiel,主要配置的是maven远程服务器的仓库地址;第二个profile唯一性ID为jsecodeProfiel,主要配置为公司的maven仓库地址。
文档最后设置的activeProfiles节点,指定激活并使用哪些jsecodeProfiel,这里激活公司的maven仓库,该仓库默认配置了remote_repo1_Profiel,所以可以不激活remote_repo1_Profiel。

posted @   三驾马车  阅读(21549)  评论(0编辑  收藏  举报
编辑推荐:
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
阅读排行:
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
点击右上角即可分享
微信分享提示