Maven Category Description of scope label record

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.6</version>
<scope>test</scope>
</dependency>

scope defines the class package in the use phase of the project. Project phases include: compile, run, test and release .

compile: default scope to compile, expressed as the current dependence involved in the project of compiling, testing and operation phases, are strong dependence. When you package it, it will reach the bag to go.

test: the dependency is only involved in testing-related content, including compilation and execution of test cases, such as qualitative Junit.

runtime: rely only involved the use of run cycle. Such interfaces are typically implemented library separate libraries, such as libraries JDBC, when compiling the relevant interface dependent only upon the specific operational only require specific MySQL, Oracle, etc. data driver . Such drivers are for runtime libraries.

provided: the dependency in the packaging process, did not need to go, this is provided by the operating environment, such as tomcat or base class library and so on, in fact, can participate in the dependency cycle compile, test, and operation, and compile equivalent. The difference is that the packing stage exclude operation.

system: use provided with the same, except that the dependency is not extracted from the warehouse maven, but are obtained from a local file system, which will be a reference to the attribute extraction systemPath dependent.

import: This is a version of the maven2.0.9 property, import only be used dependencyManagement and single maven can solve the succession problem, import dependence is not actually involved in the transitive dependencies limit.

Guess you like

Origin www.cnblogs.com/54hsh/p/12554461.html