TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Apache Maven

Maven dependency management in Eclipse

Introduction

Maven dependency management is easy in Eclipse IDE. One of the important features of Maven is dependency management. It handles the dependencies and their conflicts automatically under the cover.

Maven dependency management

You need to define all the required dependencies for the project explicitly in the POM.xml file. This information is read and maven decides which jars to load from the repositories automatically.

When a library X depends on another library Y ( X -> Y). Let’s say if the library Y is dependent on Z(Y -> Z ). We say that X is transitively dependent on library Z( X -> Z).

Dependency Properties

Each dependency we specify has several properties. To view the properties of a dependency, select it in the POM editor and click on Properties… button.

Group ID, Artifact ID, Version,Type,Scope,Optional or not etc.

Type can have values like a jar, war, ear, maven-plugin, etc.
The scope is like compile, runtime, provided, test, system, etc.

 

Dependency Properties

 

Dependency Hierarchy

 

Dependency Hierarchy

You can use the Maven POM editor to have a look at the dependency hierarchy tree. Maven has several features to control the transitive dependencies.

To manage your transitive dependency exclusions you can use the dependency hierarchy tree. You can exclude any transitive dependency artifact using the exclude option in the POM editor.

 

Dependency Hierarchy tree Eclipse

 

You can see that some artifact versions are omitted. This is due to dependency conflicts. Maven uses dependency mediation to determine what dependency artifact to be used when multiple versions are encountered.

You can find all the resolved dependencies on the right side pane of the dependency tree as shown above.

Related Posts

Maven Download Verification Win11

Apache Maven /

Download Maven on Windows 11

Invalid Target Java Error

Apache Maven /

Fix Fatal Error compiling: Invalid target release in Maven Project

Maven Project from archetype

Apache Maven /

Create Maven Project from Archetype in NetBeans

Create New Project

Apache Maven /

Create a Maven Project skip archetype

Maven Download Button

Apache Maven /

Install Maven on Ubuntu Linux

‹ Maven Dependencies, Plugins and Repositories› Specify Java version in a Maven Project.

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version