maven

1.maven 是开发者在开发项目时用来管理jar包的工具。

2.maven的相关知识

(1)maven的本地资源库,一般默认在本地计算机的.m2文件中。

(2)在一个项目中,maven会先检查项目中的pom文件,以确定哪些文件是需要依赖下载的。首先会从本地的.m2文件下的资源库中下载,如果没有找到没到,会到中央资源库中国寻找,然后进行下载,maven的中央资源库地址为 http://repo1.maven.org/maven2/

(3)maven远程资源库

    在一个项目中,如果在本地资源库或者中央资源库都为找到资源,则会到远程资源库中下载文件。但是该资源库只适用于java.net资源库。

<dependency>
        <groupId>org.jvnet.localizer</groupId>
        <artifactId>localizer</artifactId>
        <version>1.8</version>
</dependency>
(4).maven中的<dependency>的三个子节点都是必填字段

(5)如果存在父模块,则需要添加

 <parent>
<groupId>com.hanshows.esl</groupId>
<artifactId>shopweb</artifactId>
<version>1.7.0-rc3</version>
</parent>


(6)如果在父模块中已经声明了版本号<veersion>

  1. <dependencyManagement>  
  2.     <dependencies>  
  3.         <dependency>  
  4.             <groupId>junit</groupId>  
  5.             <artifactId>junit</artifactId>  
  6.             <version>4.9</version>  
  7.             <scope>test</scope>  
  8.         </dependency>  
  9.     </dependencies>  
  10. </dependencyManagement>  


则在子模块中不需要在写版本号<version>

  1. <dependencies>  
  2.     <dependency>  
  3.         <groupId>junit</groupId>  
  4.         <artifactId>junit</artifactId>  
  5.     </dependency>  
  6. </dependencies>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值