`

Maven Nexus

阅读更多
写道
<settings>
     <proxies>
         <proxy>
             <id>normal</id>
             <active>true</active>
             <protocol>http</protocol>
             <username>deployment</username>
             <password>deploy</password>
             <host>localhost:8081/nexus</host>
             <port>80</port>
             <nonProxyHosts>localhost:8081/nexus</nonProxyHosts>
         </proxy>
     </proxies>

     <mirrors>
         <mirror>
             <!--This is used to direct the public snapshots repo in the
             profile below over to a different nexus group -->
             <id>nexus-public-snapshots</id>
             <mirrorOf>public-snapshots</mirrorOf>
             <url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
         </mirror>
         <mirror>
             <!--This sends everything else to /public -->
             <id>nexus</id>
             <mirrorOf>*</mirrorOf>
             <url>http://localhost:8081/nexus/content/groups/public</url>
         </mirror>
     </mirrors>

     <profiles>
         <profile>
             <id>development</id>
             <repositories>
                 <repository>
                      <id>central</id>
                      <url>http://central</url>
                      <releases><enabled>true</enabled></releases>
                      <snapshots><enabled>true</enabled></snapshots>
                      </repository>
               </repositories>
               <pluginRepositories>
                    <pluginRepository>
                         <id>central</id>
                         <url>http://central</url>
                         <releases><enabled>true</enabled></releases>
                         <snapshots><enabled>true</enabled></snapshots>
                    </pluginRepository>
               </pluginRepositories>
         </profile>
          <profile>
          <!--this profile will allow snapshots to be searched when activated-->
               <id>public-snapshots</id>
               <repositories>
                    <repository>
                         <id>public-snapshots</id>
                         <url>http://public-snapshots</url>
                         <releases><enabled>false</enabled></releases>
                         <snapshots><enabled>true</enabled></snapshots>
                    </repository>
               </repositories>
               <pluginRepositories>
                    <pluginRepository>
                         <id>public-snapshots</id>
                         <url>http://public-snapshots</url>
                         <releases><enabled>false</enabled></releases>
                         <snapshots><enabled>true</enabled></snapshots>
                    </pluginRepository>
               </pluginRepositories>
          </profile>
     </profiles>
     <activeProfiles>
          <activeProfile>development</activeProfile>
     </activeProfiles>
</settings>

settings.xml中的proxies/proxy节点配置的是部署服务器访问属性,deployment/deploy对应的是部署用户名和密 码;mirrors/mirror配置的是maven访问仓库的地址,这里使用的是Nexus提供的群组概念,将多个仓库组成一个public- group的方式进行访问;profiles/profile则主要用来描述仓库部署的访问配置。

 

Nexus 是Sonatype推出的强大Maven仓库管理器产品,要比以前TSS 上介绍的Artifactory 要好使用的多,也是一个拆箱即用的Java App,内嵌Jetty容器和Java Wrapper做Windows服务,安装简单到解压然后双击install即可。

 

默认安装后的访问路径为http://localhost:8081/nexus/ , 管理员登录为admin/admin123

 

登录后最重要的事情就是打开远程索引下载,操作为选 择菜单Administrator->Repositories,然后在右边打开的列表中依次选择type字段为proxy的记录,在下方的编辑区 中修改"Download Remote Indexes"值为true,再从这三个仓库上点右键选择"Re-Index",Re-Index后,Nexus会从后台去官方地址下载仓库索引文件,大概20M大小,根据网速快慢下载相应时间后选择仓库时会以树形目 录的方式显示仓库内容。

 

  1. 从浏览器里打开访问地址后,通过"Artifact Search"菜单可以进行构件搜索。
  2. 对于一些特殊的构件,比如sqlserver2005的jdbc驱动,你可以通过管理员登录然后从第三方上传构件
  3. 提供仓库组的概念,对于远程代理仓库和本地宿主仓库,还有第三方仓库,全部创建为一个public-group,然后通过访问组就可以访问所有的仓库构件了,这就是所谓的分散存储,统一访问
  4. 和Maven结合也很简单,首先是要配置Maven,打开$user$/.m2/下的settings.xml(没有的话创建一个),然后拷贝以下内容到文件中
<mirror>
     <id>Nexus</id>
     <name>Nexus Public Mirror</name>
     <url>http://localhost:8081/nexus/content/groups/public</url>
     <mirrorOf>central</mirrorOf>
</mirror>
分享到:
评论

相关推荐

    Maven Nexus 私服搭建

    Maven Nexus 私服搭建 从零开始,资源下载、安装指导、开发配置说明

    maven nexus 配置

    maven nexus 配置,简要介绍如何配置nexus。。。。。。

    maven nexus 安装包.zip

    nexus-2.14.5-02-bundle.zip nexus-3.19.1-01-unix.tar.gz nexus-3.19.1-01-win64.zip 包含以上三种安装包,需要可自行下载。

    Maven nexus 安装包

    Maven nexus 安装包

    maven nexus使用说明

    自己写的一份关于maven + nexus仓库管理的使用手记 包括了nexus的基本使用及nexus权限管理等

    maven nexus-2.11 bundle

    安装自己的maven服务器,解压后进入\nexus-2.1.2-bundle\nexus-2.1.2\bin\jsw\,根据操作系统类型选择文件夹,选择是windows-x86-64文件夹,双击console-nexus.bat运行。游览器中输入http://127.0.0.1:8081/nexus/,...

    maven nexus私服配置

    详细介绍了nexus私服的配置及安装方法

    Maven nexus 私服 搭建

    Maven nexus搭建,配截图,从建立到调用

    maven nexus-2.11.3-01-bundle.zip

    直接解压,并请搜索搭建资料,比如百度:maven nexus 私服搭建

    lugin-repository(maven nexus-2.11插件)

    maven nexus-2.11插件,由于cdsn只能上传小于70MB的文件,所以拆分了

    maven nexus私服构件示例

    包含了一个父maven项目和及个子项目,可以作为搭建nexus私服的测试代码

    maven nexus 总结

    maven nexus 的相关项目中的总结

    maven nexus 安装包.rar

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问。利用Nexus你可以只在一个地方就能够完全控制访问 和部署在你所维护仓库中的每个Artifact。Nexus是一套“开箱即用”的系统不...

    Maven Nexus配置

    目 录 Maven Nexus配置 1.配置nexus 1 2.管理仓库 2 3. 管理组 2 4. 配置maven 3 5.部署构件至Nexus 4 6.Nexus监听端口 5 7.Maven Profiles 5

    maven-nexus

    nexus是对maven仓库进行管理的软件,使用起来十分方便。 Nexus提供了两种安装方式,一种是内嵌Jetty的bundle,只要你有JRE就能直接运行。第二种方式是WAR,你只须简单的将其发布到web容器中即可使用。 注意:这个...

    maven+nexus完整手册

    maven私服搭建,nexus,详细讲述搭建过程,包含示例代码

    maven Nexus私服

    windows版maven Nexus2.14私服服务器,亲试是可以的使用的。。。。。。。。。。。。。

    maven私服搭建-nexus的部署

    maven maven私服 nexus 私服

    maven nexus

    Nexus提供了两种安装方式,一种是内嵌Jetty的bundle,只要你有JRE就能直接运行。第二种方式是WAR,你只须简单的将其发布到web容器中即可使用。 这里是bundle nexus-2.4.0-09版本,安装完成之后在地址栏输入...

Global site tag (gtag.js) - Google Analytics