Maven Dependency Range

Source: Internet
Author: User

First look at the configuration maven relies on

<dependencies>       <dependency>             <groupId>....</groupId>             <artifactId> ......</artifactid>             <version>........</version>             <type>......</type>             <scope>....</scope>             <optional>...</optional>             <exclusions>                  .....             </exclusions>        </dependency>  ....... </dependencies>  
Of

groupId,artifactid , and version: the basic coordinates of dependency (coordinates are not descriptive, and all know)

Type: The default value is the jar (known to be available). Very little to ignore)

Scope: The range of dependencies (this is important. The following continue to speak)

Optional: Whether tag dependency is optional

exclusions: exclusion of transitive dependencies


Range of dependencies:

To be blunt is to control dependence and compile classpath, test classpath, execute classpath relationship.

Dependent range Parameters:

Compile: Compilation dependency range, for compiling, testing, execution of three kinds of classpath are effective. The dependency scope is used by default.

test: test-dependent range, only valid for test classpath. Only need to compile test code and perform test, eg:junit

provided: The dependency range has been provided and is only valid for compilation and test Classpath. Only needed when compiling and testing the project. Eg:servlet-api

runtime: The execution time dependent range. Only valid for test and execution classpath. It's only necessary to perform tests or execute projects, EG:JDBC

System: The range of systems dependencies. (So far I have not been practical, ignoring the good)

It is cool to have a picture to see:


Maven Dependency Range

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.