跳至主要内容

nexus configuration


nexus是个很好的maven仓库管理器,官方网站为http://nexus.sonatype.org/
安装nexus到tomcat:
1) 下载nexus-webapp-1.6.0.war
2) 解压nexus-webapp-1.6.0.war到tomcat安装目录下的webapps子目录下,并更名为"nexus"
3) 修改nexus的工作目录:编辑文件“webapps/nexus/WEB-INF/plexus.properties”,修改nexus-work的值为希望的工作目录,默认为nexus-work=${user.home}/sonatype-work/nexus,其中${user.home}为你当前用户的工作目录。
4) 配置maven使用nexus:编辑文件“ ${user.home}/.m2/settings.xml”,修改为如下配置:

 
   
     
      nexus
      *
      http://localhost:8081/nexus/content/groups/public
   

 

 
   
      nexus
     
     
     
       
          central
          http://central
          true
          true
       

     

    
       
          central
          http://central
          true
          true
       

     

   

 

 
   
    nexus
 

其中“http://localhost:8081/nexus”的访问路径,视你的实际部署情况可能端口并不一样,注意修改。
5) 启动tomcat,通过http://localhost:8081/nexus即可访问nexus的界面,默认的管理员帐号为admin,密码为admin123。

如何将自己项目的jar发布到nexus仓库:
1) 编辑文件“ ${user.home}/.m2/settings.xml”,增加如下配置:

......
   
    nexus-releases 
    admin 
    **** 
 
 
   
    nexus-snapshots 
    admin 
    **** 
 

......

其中username为nexus的管理员帐号,password为对应的访问密码。
2) 配置项目的POM.xml文件,增加如下配置:

......
  
  
      
       nexus-releases 
       public 
       http://localhost:8081/nexus/content/repositories/releases
    
 
      
       nexus-snapshots 
       Snapshots 
       http://localhost:8081/nexus/content/repositories/snapshots
    

  

......

其中“http://localhost:8081/nexus”视实际的部署情况修改,id的值要与${user.home}/.m2/settings.xml的配置一致。
3) 进入项目目录执行mvn deploy就可将构件发布到nexus服务器中。


转载自http://rongjih.blog.163.com/blog/static/33574461201042102046529/

评论

此博客中的热门博文

Python学习笔记20100117

映射list   Dictionary 是用{}. list 是一那个[]. turple是用() 当你定义过dictionary后,你可以使用d.keys(), d.values(),d.items()将定义后的时候分别显示出来 当然可以将list里的值加减乘除,也可以如一般的定义直接重新复制这个list. 链接与分割字符串的 li=";", join(li) 则显示的就是 分隔符为;的数 如果使用li=li.split(";")则将刚刚;的分隔符删除,而split里也可定义域,如li.split(";",1)   自省 <---这是啥 之前在使用的时候发觉有些书本上的模块不能调用,很多是py脚本定义过的函数。 下载该脚本s,然后上传至指定位置。 >>>import sys >>>sys.path >>>sys.path.append("绝对位置")然后就能调用这些脚本和参数了。 删除 >>>sys.path.pop() 定义一个参数是 def info(test, test1=10.test2=12): info是函数名,test是必备参数,因为没有定义值,test1和test2是可选参数,定义了初始值   以上是外部函数的调用,下面转到内部函数 内部函数有type,str,dir及其他   ---type 返回任意字符的类型,模块也可以。types模块 >>> type(1) <type 'int'> >>> li=[] >>> type(li) <type 'list'> >>> import odbchelper >>> type(odbchelper) <type 'module'> >>> type(sys) <type 'module'> >>> import types ...

Setagaya park

  We visited Setagaya Park (世田谷区) yesterday. This park reminds us when we in Europe, which has a fancy fountain in the middle, and free entrance. People just laid down on the grass, enjoy the day time they can waste. people who have kids together,  play all different kinds of sports. you really can't image whether you are in Europe or  Japan. I would prefer to use a Bus instead of the metro, the metro is fast, but you only can see the dark, light, people sit or stand as Sardine, without any emotion. but on the bus, you can see the traffic, the shop, everything on the road. When we on our way to the park, we stop by a good chocolate shop named " craft chocolate works ",  this is a very good place to have ice cream, you probably can choose half & half, you can enjoy the feeling when you smell the chocolate smell and eat with it.  or you can enjoy beer or cake in "globe antiques (ザ グローブアン ティ ークス) .   also, we checked the Blue Bottle Coffee Sangenjaya ...