Maven dependency management is integrated with Eclipse JDT using "Maven Dependencies" classpath container. The classpath container contains a dependency list computed by Maven based on project's pom.xml.
Because Eclipse only allow to have single classpath for the entire project, the "Maven Dependencies" classpath container represent Maven's "test" scope, which is required to compile tests. However "Maven Dependencies" container is not being used to construct "runtime" and "test" classpath then using "Java Application" or "JUnit" launch configurations in Eclipse. A special classpath provider is contributed to those launch configurations and it uses appropriate Maven classpath scope.
You can force refresh of Maven Dependencies container and force downloading of artifact snapshots (regardless of the Maven repository refresh policy) using accordingly "Update Depdencies" and "Update Snapshots" actions from the Maven popup menu on selected project or pom.xml.
"Update Project Configuration" action can be used to refresh or recreate Eclipse project configuration based on content of Maven pom.xml, e.g. when changes in pom.xml affects project structure (folders settings, plugins that dynamically add folders or have other configuration).
Dependencies are resolved from Eclipse Workspace or from the local Maven repository:
- If referenced dependency is not available from the local repository it is automatically downloaded from remote repositories specified in pom.xml and Maven's settings.xml that can be specified in Maven Settings.
- If Eclipse Workspace have Maven projects with exact matching for the required dependencies (including groupId, artifactId and version), these projects will be used instead of the jars from Maven repository. If exact match is not found, Maven repositories will be used for such dependency.
Dependency resolution and other Maven settings can be configured from the Maven page in project properties dialog:
- Active Maven Profiles
If specified, dependencies from these profiles will be picked up.
- Goals to invoke after project clean
Default - process-test-resources
- Goals to invoke on resource changes
Default - process-resources resources:testResources
- Resolve dependencies from Workspace projects
Allow to disable resolving dependencies from Eclipse workspace
- Include modules
When enabled, dependencies from all nested modules are added to the "Maven Dependencies" container and source folders from nested modules are added to the current project build path when running "Update Sources" action.
