Maven Dependecy Scope

1. complie (default) , transitivejava

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

<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 testsql

4. test, only used int testapi

5. system,in instancespringboot

<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 springbootide

<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>
相關文章
相關標籤/搜索