1. 程式人生 > >[maven]scope之test

[maven]scope之test

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

<scope>test</scope>

maven在編譯的時候,src/main/java下是不引用<scope>test</scope>的jar,而編譯src/test/java下的測試這會引用<scope>test</scope>的jar