Maven course project management tool-Maven 3-7 Maven dependency range: 2 stars

Source: Internet
Author: User

This section describes the dependency scope of Maven:

In the scope of the Pom. xml dependency label. In eclipse, there are compiling paths, Maven paths for compiling, running, and testing.

 

1. Scope is test, which is the test path. Most of them are JUnit jar packages.

2. the scope is compile, which is the default level and is effective during compilation and testing.

3. scope is provided, which is valid during compilation and testing.

4. the scope is runtime, which is effective during running and testing (for example, implementation of the JDBC driver)

5. the scope is system, which is consistent with compile, but has poor portability capability. The referenced java_home (environment variable) cannot work normally after the computer is changed.

6. scope is import. It is only used in dependencymanager to import the dependency configuration from other pom.

 

What you understand:

Maven compilation requires a jar package, a jar package for running, and a jar package for testing.

 

Scope is test:

<Dependency> <groupid> JUnit </groupid> <! -- Here is the package name --> <artifactid> JUnit </artifactid> <! -- Here is the project name --> <version> 4.1.0 </version> <! -- Maven version --> <scope> test </scope> </dependency>

 

Scope is import:

<dependency>        <groupId>maven</groupId>        <artifactId>A</artifactId>        <version>1.0</version>        <type>pom</type>        <scope>import</scope>      </dependency>

 

 

 

Introduction to the dependency mechanism on the official Maven Website:

Http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

Maven course project management tool-Maven 3-7 Maven dependency range: 2 stars

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.