星空网 > 软件开发 > Java

maven私服搭建

一、软件安装

  地址:http://www.sonatype.org/nexus/thank-you-for-downloading/?dl=tgz

  解压:

     maven私服搭建

      启动:

     >> nexus start

  打开:http://192.9.104.17:8081/nexus/#welcome

     maven私服搭建

   点击右上角,使用admin/admin123(默认管理员)登陆。

   管理操作面板(修改代码库、镜像、用户权限管理等):

     maven私服搭建

     

二、系统配置

  默认的nexus 配置的镜像是无法使用的,需要我们把它设置为可行的,重新构建索引。

            maven私服搭建

  重新构建索引:

    maven私服搭建

  需要修改的仓库有三处:Central、Apache Snapshots、Codehaus Snapshots

  另外,releases和snapshots两处的可以自动部署属性必须勾上,如下图:

    maven私服搭建

  当然,你也可以通过界面来上传jar包。

    maven私服搭建

三、maven环境配置

  1、确保你的环境中已经部署和正确配置了maven环境,具体如果安装maven不在此教程范畴之内。

  2、到你当前登录的用户下的.m2目录下,创建一个setting.

    

<?

     主要注意修改:servers和mirrors两处,如本例所示:

  servers:

  

 <servers>  <!-- server   | Specifies the authentication information to use when connecting to a particular server, identified by   | a unique name within the system (referred to by the 'id' attribute below).   |   | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are   |    used together.   |  <server>   <id>deploymentRepo</id>   <username>repouser</username>   <password>repopwd</password>  </server>  -->    <!-- Another sample, using keys to authenticate.  <server>   <id>siteServer</id>   <privateKey>/path/to/private/key</privateKey>   <passphrase>optional; leave empty if not used.</passphrase>  </server>  -->	 <server>   <id>snapshots</id>   <username>likehua</username>   <password>likehua</password>  </server>  <server>   <id>releases</id>   <username>likehua</username>   <password>likehua</password>  </server>	<server>		<id>tomcat-remote-deploy</id>		<username>tomcat</username>		<password>tomcat123</password>	</server> </servers>

   注意此处的用户名和密码,是你nexus上创建的用户名,一般付给部署的权限。

  另外就是镜像地址的配置:

       

 1  <mirrors> 2   <!-- mirror 3    | Specifies a repository mirror site to use instead of a given repository. The repository that 4    | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used 5   | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. 6    | 7   <mirror> 8    <id>mirrorId</id> 9    <mirrorOf>repositoryId</mirrorOf>10    <name>Human Readable Name for this Mirror.</name>11    <url>http://my.repository.com/repo/path</url>12   </mirror>13   -->14    <mirror>15     <id>nexus</id>16     <mirrorOf>*</mirrorOf>17     <name>A Local Nexus Server</name>18     <url>http://192.9.104.17:8081/nexus/content/groups/public/</url>19   </mirror>20  </mirrors>

     ok,maven私服搭建配置完成。




原标题:maven私服搭建

关键词:maven

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊危险品审核(测试):https://www.ikjzd.com/w/1573
旺集海外仓(007EX海外仓):https://www.ikjzd.com/w/1573152124620759041
101·时代青年计划:https://www.ikjzd.com/w/1573152126625292289
10club:https://www.ikjzd.com/w/1573152127225421825
$10 and under(10美元及以下包邮):https://www.ikjzd.com/w/1573152127804235778
双12:https://www.ikjzd.com/w/1573152128362078210
品牌出海新机遇,玩转“新兴”与“王牌”主题沙龙成功举办!:https://www.kjdsnews.com/a/1836370.html
每月资讯 | CBD为您带来最新行业动态:https://www.kjdsnews.com/a/1836371.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流