Maven Dependecy Scope

1. complie (default) , transitive

2. provided ,container,no transtive,in instance :

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <!--container provided no  transmit -->
    <scope>provided</scope>
</dependency>

3. runtime,userd in run and test

4. test, only used int test

5. system,in instance

<dependencies>
  <dependency>
   <groupId>javax.sql</groupId>
   <artifactId>jdbc-stdext</artifactId>
   <version>2.0</version>
   <scope>system</scope>
   <systemPath>${java.home}/lib/rt.jar</systemPath>
  </dependency>
</dependencies>

6. import use other project pom,only used in dependencyManagement,in instance :used in springboot

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.3.3.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

 

posted @ 2016-04-21 11:09  luneng-gcc  阅读(386)  评论(0编辑  收藏  举报