Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml14
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml83
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java3
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java4
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenExecutionContext.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java37
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java277
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java22
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java7
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java69
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java16
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java48
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ReadonlyMavenExecutionRequest.java22
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java10
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java3
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipsePluginArtifactsCache.java8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java5
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java12
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java7
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java48
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java7
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java4
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java4
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java9
33 files changed, 236 insertions, 514 deletions
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml
index 032568f0..5f362a23 100644
--- a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml
@@ -29,20 +29,24 @@
<optional>true</optional>
<exclusions>
<exclusion>
- <artifactId>maven-model</artifactId>
<groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
</exclusion>
<exclusion>
- <artifactId>maven-artifact</artifactId>
<groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-inject-plexus</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-inject-plexus</artifactId>
- <version>1.4.3</version>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.plexus</artifactId>
+ <version>0.0.0.M2a</version>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
index 82e07f97..84c79d03 100644
--- a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
@@ -23,15 +23,8 @@
<properties>
<!-- maven core version -->
- <maven.version>3.0.4</maven.version>
-
- <!-- the following MUST match <maven.version/> above. I wish I could make scope=import do this for me -->
- <sisu-guice.version>3.1.0</sisu-guice.version>
- <sisu.version>2.3.0</sisu.version>
- <aether.version>1.13.1</aether.version>
-
- <guava.version>11.0.2</guava.version>
-
+ <maven.version>3.1.1</maven.version>
+ <guava.version>14.0.1</guava.version>
<!-- below are m2e-specific addons -->
<plexus-build-api.version>0.0.7</plexus-build-api.version>
<wagon-ahc.version>1.2.1</wagon-ahc.version>
@@ -41,59 +34,27 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
- <exclusions>
- <exclusion>
- <!-- exclude aggregate OSGi bundle -->
- <artifactId>sisu-inject-plexus</artifactId>
- <groupId>org.sonatype.sisu</groupId>
- </exclusion>
- </exclusions>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>sisu-inject-plexus</artifactId>
- <groupId>org.sonatype.sisu</groupId>
- </exclusion>
- </exclusions>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>sisu-inject-plexus</artifactId>
- <groupId>org.sonatype.sisu</groupId>
- </exclusion>
- </exclusions>
+ <optional>true</optional>
</dependency>
<dependency>
- <groupId>org.sonatype.sisu.inject</groupId>
- <artifactId>guice-plexus-shim</artifactId>
- <version>${sisu.version}</version>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.plexus</artifactId>
<optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>org.sonatype.sisu</groupId>
- <artifactId>sisu-guice</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>jsr250-api</artifactId>
- <groupId>javax.annotation</groupId>
- </exclusion>
- <exclusion>
- <artifactId>cdi-api</artifactId>
- <groupId>javax.enterprise</groupId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
- <version>${sisu-guice.version}</version>
<classifier>no_aop</classifier>
<optional>true</optional>
<exclusions>
@@ -110,6 +71,7 @@
<exclusions>
<exclusion>
<!-- as of version 1.3.9 includes LGPL'ed sources, can't ship with an EPL project -->
+ <!-- http://dev.eclipse.org/ipzilla/show_bug.cgi?id=7302 -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
@@ -124,7 +86,13 @@
</dependency>
<dependency>
- <groupId>org.sonatype.aether</groupId>
+ <groupId>org.eclipse.aether</groupId>
+ <artifactId>aether-impl</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<exclusions>
<exclusion>
@@ -139,29 +107,11 @@
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-impl</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-connector-asynchttpclient</artifactId>
- <version>${aether.version}</version>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>com.ning</groupId>
- <artifactId>async-http-client</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.sonatype.maven</groupId>
<artifactId>wagon-ahc</artifactId>
<version>${wagon-ahc.version}</version>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
@@ -195,10 +145,11 @@
<_exportcontents>
META-INF.plexus;-noimport:=true,
+ META-INF.sisu;-noimport:=true,
org.apache.maven.*,
org.codehaus.plexus.*,
org.sonatype.plexus.*,
- org.sonatype.aether.*,
+ org.eclipse.aether.*,
com.google.inject.*,
com.google.common.*,
javax.inject.*,
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
index 086033b1..9db8d3e1 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/MavenPropertyTester.java
@@ -11,6 +11,7 @@
package org.eclipse.m2e.core.ui.internal.actions;
+import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -19,8 +20,6 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.sonatype.aether.graph.DependencyNode;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
index baea2876..1d77e9dc 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/actions/SelectionUtil.java
@@ -247,8 +247,8 @@ public class SelectionUtil {
if(element instanceof Artifact) {
return new ArtifactKey(((Artifact) element));
- } else if(element instanceof org.sonatype.aether.graph.DependencyNode) {
- org.sonatype.aether.artifact.Artifact artifact = ((org.sonatype.aether.graph.DependencyNode) element)
+ } else if(element instanceof org.eclipse.aether.graph.DependencyNode) {
+ org.eclipse.aether.artifact.Artifact artifact = ((org.eclipse.aether.graph.DependencyNode) element)
.getDependency().getArtifact();
return new ArtifactKey(artifact);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
index 2652f4ad..c706e09c 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
@@ -36,7 +36,7 @@ public class ArtifactKey implements Serializable {
this(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), null);
}
- public ArtifactKey(org.sonatype.aether.artifact.Artifact a) {
+ public ArtifactKey(org.eclipse.aether.artifact.Artifact a) {
this(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), null);
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenExecutionContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenExecutionContext.java
index f2a887f7..118a21d7 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenExecutionContext.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenExecutionContext.java
@@ -11,6 +11,7 @@
package org.eclipse.m2e.core.embedder;
+import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -20,8 +21,6 @@ import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.sonatype.aether.RepositorySystemSession;
-
import org.eclipse.m2e.core.project.IMavenProjectRegistry;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
index 8bddcd5a..ad28c50d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
@@ -35,6 +35,21 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.ArtifactTypeRegistry;
+import org.eclipse.aether.collection.CollectRequest;
+import org.eclipse.aether.collection.DependencyCollectionException;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.util.filter.ScopeDependencyFilter;
+import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
+import org.eclipse.aether.util.graph.transformer.ConflictResolver;
+import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver;
+import org.eclipse.aether.util.graph.transformer.JavaScopeSelector;
+import org.eclipse.aether.util.graph.transformer.NearestVersionSelector;
+import org.eclipse.aether.util.graph.transformer.SimpleOptionalitySelector;
+import org.eclipse.aether.util.graph.visitor.CloningDependencyVisitor;
+import org.eclipse.aether.util.graph.visitor.FilteringDependencyVisitor;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -48,19 +63,6 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.project.MavenProject;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.artifact.ArtifactTypeRegistry;
-import org.sonatype.aether.collection.CollectRequest;
-import org.sonatype.aether.collection.DependencyCollectionException;
-import org.sonatype.aether.collection.DependencyGraphTransformer;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.util.DefaultRepositorySystemSession;
-import org.sonatype.aether.util.filter.ScopeDependencyFilter;
-import org.sonatype.aether.util.graph.CloningDependencyVisitor;
-import org.sonatype.aether.util.graph.FilteringDependencyVisitor;
-import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
-import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
-
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.Messages;
@@ -193,9 +195,14 @@ public class MavenModelManager {
throws CoreException {
DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(repositorySession);
- DependencyGraphTransformer transformer = new ChainedDependencyGraphTransformer(new JavaEffectiveScopeCalculator(),
- new NearestVersionConflictResolver());
+ //
+ // Taken from MavenRepositorySystemSession.newSession()
+ //
+ ConflictResolver transformer = new ConflictResolver(new NearestVersionSelector(), new JavaScopeSelector(),
+ new SimpleOptionalitySelector(), new JavaScopeDeriver());
session.setDependencyGraphTransformer(transformer);
+ session.setConfigProperty(ConflictResolver.CONFIG_PROP_VERBOSE, Boolean.toString(true));
+ session.setConfigProperty(DependencyManagerUtils.CONFIG_PROP_VERBOSE, true);
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java
deleted file mode 100644
index ee8bc365..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.embedder;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.sonatype.aether.RepositoryException;
-import org.sonatype.aether.collection.DependencyGraphTransformationContext;
-import org.sonatype.aether.collection.DependencyGraphTransformer;
-import org.sonatype.aether.collection.UnsolvableVersionConflictException;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.util.graph.DefaultDependencyNode;
-import org.sonatype.aether.util.graph.transformer.ConflictIdSorter;
-import org.sonatype.aether.util.graph.transformer.TransformationContextKeys;
-import org.sonatype.aether.version.Version;
-import org.sonatype.aether.version.VersionConstraint;
-
-
-class NearestVersionConflictResolver implements DependencyGraphTransformer {
-
- public DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context)
- throws RepositoryException {
- List<?> sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
- if(sortedConflictIds == null) {
- ConflictIdSorter sorter = new ConflictIdSorter();
- sorter.transformGraph(node, context);
-
- sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
- }
-
- Map<?, ?> conflictIds = (Map<?, ?>) context.get(TransformationContextKeys.CONFLICT_IDS);
- if(conflictIds == null) {
- throw new RepositoryException("conflict groups have not been identified");
- }
-
- Map<DependencyNode, Integer> depths = new IdentityHashMap<DependencyNode, Integer>(conflictIds.size());
- for(Object key : sortedConflictIds) {
- ConflictGroup group = new ConflictGroup(key);
- depths.clear();
- selectVersion(node, null, 0, depths, group, conflictIds);
- pruneNonSelectedVersions(group, conflictIds);
- }
-
- return node;
- }
-
- private void selectVersion(DependencyNode node, DependencyNode parent, int depth,
- Map<DependencyNode, Integer> depths, ConflictGroup group, Map<?, ?> conflictIds) throws RepositoryException {
- Integer smallestDepth = depths.get(node);
- if(smallestDepth == null || smallestDepth.intValue() > depth) {
- depths.put(node, Integer.valueOf(depth));
- } else {
- return;
- }
-
- Object key = conflictIds.get(node);
- if(group.key.equals(key)) {
- Position pos = new Position(parent, depth);
-
- if(parent != null) {
- group.positions.add(pos);
- }
-
- VersionConstraint constraint = node.getVersionConstraint();
-
- boolean backtrack = false;
- boolean hardConstraint = !constraint.getRanges().isEmpty();
-
- if(hardConstraint) {
- if(group.constraints.add(constraint)) {
- if(group.version != null && !constraint.containsVersion(group.version)) {
- backtrack = true;
- }
- }
- }
-
- if(isAcceptable(group, node.getVersion())) {
- group.candidates.put(node, pos);
-
- if(backtrack) {
- backtrack(group);
- } else if(group.version == null || isNearer(pos, node.getVersion(), group.position, group.version)) {
- group.winner = node;
- group.version = node.getVersion();
- group.position = pos;
- }
- } else {
- if(backtrack) {
- backtrack(group);
- }
- return;
- }
- }
-
- depth++ ;
-
- for(DependencyNode child : node.getChildren()) {
- selectVersion(child, node, depth, depths, group, conflictIds);
- }
- }
-
- private boolean isAcceptable(ConflictGroup group, Version version) {
- for(VersionConstraint constraint : group.constraints) {
- if(!constraint.containsVersion(version)) {
- return false;
- }
- }
- return true;
- }
-
- private void backtrack(ConflictGroup group) throws UnsolvableVersionConflictException {
- group.winner = null;
- group.version = null;
-
- for(Iterator<Map.Entry<DependencyNode, Position>> it = group.candidates.entrySet().iterator(); it.hasNext();) {
- Map.Entry<DependencyNode, Position> entry = it.next();
-
- Version version = entry.getKey().getVersion();
- Position pos = entry.getValue();
-
- if(!isAcceptable(group, version)) {
- it.remove();
- } else if(group.version == null || isNearer(pos, version, group.position, group.version)) {
- group.winner = entry.getKey();
- group.version = version;
- group.position = pos;
- }
- }
-
- if(group.version == null) {
- throw newFailure(group);
- }
- }
-
- private UnsolvableVersionConflictException newFailure(ConflictGroup group) {
- Collection<String> versions = new LinkedHashSet<String>();
- for(VersionConstraint constraint : group.constraints) {
- versions.add(constraint.toString());
- }
- return new UnsolvableVersionConflictException(group.key, versions);
- }
-
- private boolean isNearer(Position pos1, Version ver1, Position pos2, Version ver2) {
- if(pos1.depth < pos2.depth) {
- return true;
- } else if(pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo(ver2) > 0) {
- return true;
- }
- return false;
- }
-
- private void pruneNonSelectedVersions(ConflictGroup group, Map<?, ?> conflictIds) {
- for(Position pos : group.positions) {
- ConflictNode conflictNode = null;
-
- for(ListIterator<DependencyNode> it = pos.parent.getChildren().listIterator(); it.hasNext();) {
- DependencyNode child = it.next();
-
- Object key = conflictIds.get(child);
-
- if(group.key.equals(key)) {
- if(!group.pruned && group.position.depth == pos.depth && group.version.equals(child.getVersion())) {
- group.pruned = true;
- } else if(pos.equals(group.position)) {
- it.remove();
- } else if(conflictNode == null) {
- conflictNode = new ConflictNode(child, group.winner);
- it.set(conflictNode);
- } else {
- it.remove();
-
- if(conflictNode.getVersion().compareTo(child.getVersion()) < 0) {
- conflictNode.setDependency(child.getDependency());
- conflictNode.setVersion(child.getVersion());
- conflictNode.setVersionConstraint(child.getVersionConstraint());
- conflictNode.setPremanagedVersion(child.getPremanagedVersion());
- conflictNode.setRelocations(child.getRelocations());
- }
- }
- }
- }
- }
- }
-
- static final class ConflictGroup {
-
- final Object key;
-
- final Collection<VersionConstraint> constraints = new HashSet<VersionConstraint>();
-
- final Map<DependencyNode, Position> candidates = new IdentityHashMap<DependencyNode, Position>(32);
-
- DependencyNode winner;
-
- Version version;
-
- Position position;
-
- final Collection<Position> positions = new LinkedHashSet<Position>();
-
- boolean pruned;
-
- public ConflictGroup(Object key) {
- this.key = key;
- this.position = new Position(null, Integer.MAX_VALUE);
- }
-
- @Override
- public String toString() {
- return key + " > " + version; //$NON-NLS-1$
- }
-
- }
-
- static final class Position {
-
- final DependencyNode parent;
-
- final int depth;
-
- final int hash;
-
- public Position(DependencyNode parent, int depth) {
- this.parent = parent;
- this.depth = depth;
- hash = 31 * System.identityHashCode(parent) + depth;
- }
-
- @Override
- public boolean equals(Object obj) {
- if(this == obj) {
- return true;
- } else if(!(obj instanceof Position)) {
- return false;
- }
- Position that = (Position) obj;
- return this.parent == that.parent && this.depth == that.depth;
- }
-
- @Override
- public int hashCode() {
- return hash;
- }
-
- @Override
- public String toString() {
- return depth + " > " + parent; //$NON-NLS-1$
- }
-
- }
-
- static final class ConflictNode extends DefaultDependencyNode {
-
- public ConflictNode(DependencyNode node, DependencyNode related) {
- super(node);
- setAliases(Collections.singletonList(related.getDependency().getArtifact()));
- }
- }
-
-}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
index 1301ca91..6455198c 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java
@@ -18,9 +18,14 @@ import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
import org.osgi.framework.Constants;
import org.osgi.framework.Version;
+import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.inject.AbstractModule;
+import com.google.inject.Module;
+
+import org.eclipse.aether.RepositorySystem;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -31,6 +36,7 @@ import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.MutablePlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.classworlds.ClassWorld;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -48,8 +54,6 @@ import org.apache.maven.index.NexusIndexer;
import org.apache.maven.index.updater.IndexUpdater;
import org.apache.maven.plugin.LegacySupport;
-import org.sonatype.aether.RepositorySystem;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.IMavenExecutionContext;
@@ -174,10 +178,18 @@ public class MavenPluginActivator extends Plugin {
this.mavenConfiguration = new MavenConfigurationImpl();
- ClassLoader cl = MavenPlugin.class.getClassLoader();
- ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(new ClassWorld("plexus.core", cl)) //$NON-NLS-1$
+ final ClassLoader cl = MavenPlugin.class.getClassLoader();
+ final ContainerConfiguration cc = new DefaultContainerConfiguration() //
+ .setClassWorld(new ClassWorld("plexus.core", cl)) //$NON-NLS-1$
+ .setClassPathScanning(PlexusConstants.SCANNING_INDEX) //
+ .setAutoWiring(true) //
.setName("plexus"); //$NON-NLS-1$
- this.plexus = new DefaultPlexusContainer(cc);
+ final Module logginModule = new AbstractModule() {
+ protected void configure() {
+ bind(ILoggerFactory.class).toInstance(LoggerFactory.getILoggerFactory());
+ }
+ };
+ this.plexus = new DefaultPlexusContainer(cc, logginModule);
File stateLocationDir = getStateLocation().toFile();
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java
index 336de8ef..010cf9b6 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceDeltaScanner.java
@@ -51,6 +51,7 @@ public class ResourceDeltaScanner extends AbstractScanner {
public void scan() {
try {
setupDefaultFilters();
+ setupMatchPatterns();
scanDelta();
} catch(CoreException e) {
// TODO Auto-generated catch block
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java
index 479735ce..034c0af4 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java
@@ -52,6 +52,7 @@ public class ResourceScanner extends AbstractScanner {
public void scan() {
try {
setupDefaultFilters();
+ setupMatchPatterns();
scanResource();
} catch(CoreException e) {
// TODO Auto-generated catch block
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java
index 3fc952e1..b875985f 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java
@@ -11,13 +11,12 @@
package org.eclipse.m2e.core.internal.embedder;
+import org.eclipse.aether.transfer.TransferCancelledException;
+import org.eclipse.aether.transfer.TransferEvent;
+import org.eclipse.aether.transfer.TransferListener;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.sonatype.aether.transfer.TransferCancelledException;
-import org.sonatype.aether.transfer.TransferEvent;
-import org.sonatype.aether.transfer.TransferListener;
-
/**
* ArtifactTransferListenerAdapter
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java
index 223e1b6a..f8a61f45 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java
@@ -11,7 +11,7 @@
package org.eclipse.m2e.core.internal.embedder;
-import org.sonatype.aether.RepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
public interface ContextRepositorySystemSession extends RepositorySystemSession {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java
index 840e1938..63671e2d 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java
@@ -13,28 +13,30 @@ package org.eclipse.m2e.core.internal.embedder;
import java.util.Map;
+import org.eclipse.aether.RepositoryCache;
+import org.eclipse.aether.RepositoryListener;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.SessionData;
+import org.eclipse.aether.artifact.ArtifactTypeRegistry;
+import org.eclipse.aether.collection.DependencyGraphTransformer;
+import org.eclipse.aether.collection.DependencyManager;
+import org.eclipse.aether.collection.DependencySelector;
+import org.eclipse.aether.collection.DependencyTraverser;
+import org.eclipse.aether.repository.AuthenticationSelector;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.LocalRepositoryManager;
+import org.eclipse.aether.repository.MirrorSelector;
+import org.eclipse.aether.repository.ProxySelector;
+import org.eclipse.aether.repository.WorkspaceReader;
+import org.eclipse.aether.resolution.ArtifactDescriptorPolicy;
+import org.eclipse.aether.resolution.ResolutionErrorPolicy;
+import org.eclipse.aether.transfer.TransferListener;
+
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.apache.maven.plugin.LegacySupport;
-import org.sonatype.aether.RepositoryCache;
-import org.sonatype.aether.RepositoryListener;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.SessionData;
-import org.sonatype.aether.artifact.ArtifactTypeRegistry;
-import org.sonatype.aether.collection.DependencyGraphTransformer;
-import org.sonatype.aether.collection.DependencyManager;
-import org.sonatype.aether.collection.DependencySelector;
-import org.sonatype.aether.collection.DependencyTraverser;
-import org.sonatype.aether.repository.AuthenticationSelector;
-import org.sonatype.aether.repository.LocalRepository;
-import org.sonatype.aether.repository.LocalRepositoryManager;
-import org.sonatype.aether.repository.MirrorSelector;
-import org.sonatype.aether.repository.ProxySelector;
-import org.sonatype.aether.repository.WorkspaceReader;
-import org.sonatype.aether.transfer.TransferListener;
-
@Component(role = ContextRepositorySystemSession.class)
public class ContextRepositorySystemSessionImpl implements ContextRepositorySystemSession {
@@ -130,24 +132,31 @@ public class ContextRepositorySystemSessionImpl implements ContextRepositorySyst
return getSession().getWorkspaceReader();
}
- public boolean isIgnoreInvalidArtifactDescriptor() {
- return getSession().isIgnoreInvalidArtifactDescriptor();
- }
-
- public boolean isIgnoreMissingArtifactDescriptor() {
- return getSession().isIgnoreMissingArtifactDescriptor();
+ /* (non-Javadoc)
+ * @see org.eclipse.aether.RepositorySystemSession#isOffline()
+ */
+ public boolean isOffline() {
+ return getSession().isOffline();
}
- public boolean isNotFoundCachingEnabled() {
- return getSession().isNotFoundCachingEnabled();
+ /* (non-Javadoc)
+ * @see org.eclipse.aether.RepositorySystemSession#isIgnoreArtifactDescriptorRepositories()
+ */
+ public boolean isIgnoreArtifactDescriptorRepositories() {
+ return getSession().isIgnoreArtifactDescriptorRepositories();
}
- public boolean isOffline() {
- return getSession().isOffline();
+ /* (non-Javadoc)
+ * @see org.eclipse.aether.RepositorySystemSession#getResolutionErrorPolicy()
+ */
+ public ResolutionErrorPolicy getResolutionErrorPolicy() {
+ return getSession().getResolutionErrorPolicy();
}
- public boolean isTransferErrorCachingEnabled() {
- return getSession().isTransferErrorCachingEnabled();
+ /* (non-Javadoc)
+ * @see org.eclipse.aether.RepositorySystemSession#getArtifactDescriptorPolicy()
+ */
+ public ArtifactDescriptorPolicy getArtifactDescriptorPolicy() {
+ return getSession().getArtifactDescriptorPolicy();
}
-
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java
index 7eeaa05a..fdfb6367 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java
@@ -11,12 +11,13 @@
package org.eclipse.m2e.core.internal.embedder;
+import org.eclipse.aether.RepositoryListener;
+
import org.apache.maven.classrealm.ClassRealmManagerDelegate;
import org.apache.maven.plugin.PluginArtifactsCache;
import org.apache.maven.plugin.internal.PluginDependenciesResolver;
import org.apache.maven.project.artifact.MavenMetadataCache;
-import org.sonatype.aether.RepositoryListener;
import org.sonatype.plexus.build.incremental.BuildContext;
import org.eclipse.m2e.core.internal.project.EclipseMavenMetadataCache;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
index 3cc5c2b9..90808233 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseRepositoryListener.java
@@ -13,12 +13,12 @@ package org.eclipse.m2e.core.internal.embedder;
import java.io.File;
-import org.codehaus.plexus.component.annotations.Component;
+import org.eclipse.aether.AbstractRepositoryListener;
+import org.eclipse.aether.RepositoryEvent;
+import org.eclipse.aether.RepositoryListener;
+import org.eclipse.aether.artifact.Artifact;
-import org.sonatype.aether.AbstractRepositoryListener;
-import org.sonatype.aether.RepositoryEvent;
-import org.sonatype.aether.RepositoryListener;
-import org.sonatype.aether.artifact.Artifact;
+import org.codehaus.plexus.component.annotations.Component;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java
index 45d2709c..0da1b177 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/FilterRepositorySystemSession.java
@@ -11,9 +11,9 @@
package org.eclipse.m2e.core.internal.embedder;
-import org.sonatype.aether.SessionData;
-import org.sonatype.aether.transfer.TransferListener;
-import org.sonatype.aether.util.DefaultRepositorySystemSession;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.SessionData;
+import org.eclipse.aether.transfer.TransferListener;
/**
@@ -21,12 +21,14 @@ import org.sonatype.aether.util.DefaultRepositorySystemSession;
*
* @since 1.4
*/
-class FilterRepositorySystemSession extends org.sonatype.aether.util.FilterRepositorySystemSession {
+class FilterRepositorySystemSession extends org.eclipse.aether.AbstractForwardingRepositorySystemSession {
private final String updatePolicy;
+ private final DefaultRepositorySystemSession session;
+
public FilterRepositorySystemSession(DefaultRepositorySystemSession session, String updatePolicy) {
- super(session);
+ this.session = session;
this.updatePolicy = updatePolicy;
}
@@ -48,7 +50,7 @@ class FilterRepositorySystemSession extends org.sonatype.aether.util.FilterRepos
return origSessionData;
}
- private DefaultRepositorySystemSession getSession() {
- return (DefaultRepositorySystemSession) this.session;
+ protected DefaultRepositorySystemSession getSession() {
+ return this.session;
}
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
index 95dc5637..8b4f99ad 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExecutionContext.java
@@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+import org.eclipse.aether.transfer.TransferListener;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -34,8 +35,6 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.properties.internal.EnvironmentUtils;
-import org.sonatype.aether.transfer.TransferListener;
-
import org.eclipse.m2e.core.embedder.ICallable;
import org.eclipse.m2e.core.embedder.IMavenExecutionContext;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
index 81dc71ca..54afaba3 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
@@ -31,9 +31,21 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.inject.AbstractModule;
+import com.google.inject.Module;
+
+import org.eclipse.aether.ConfigurationProperties;
+import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.resolution.ArtifactRequest;
+import org.eclipse.aether.resolution.ArtifactResolutionException;
+import org.eclipse.aether.resolution.ArtifactResult;
+import org.eclipse.aether.transfer.ArtifactNotFoundException;
+import org.eclipse.aether.transfer.TransferListener;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -46,6 +58,7 @@ import org.codehaus.plexus.ContainerConfiguration;
import org.codehaus.plexus.DefaultContainerConfiguration;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.MutablePlexusContainer;
+import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
import org.codehaus.plexus.classworlds.ClassWorld;
@@ -82,15 +95,14 @@ import org.apache.maven.lifecycle.internal.DependencyContext;
import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator;
import org.apache.maven.lifecycle.internal.MojoExecutor;
import org.apache.maven.model.ConfigurationContainer;
-import org.apache.maven.model.InputLocation;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Profile;
import org.apache.maven.model.Repository;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuildingRequest;
-import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.model.building.ModelProblemCollector;
+import org.apache.maven.model.building.ModelProblemCollectorRequest;
import org.apache.maven.model.interpolation.ModelInterpolator;
import org.apache.maven.model.io.ModelReader;
import org.apache.maven.model.io.ModelWriter;
@@ -140,15 +152,6 @@ import org.apache.maven.settings.crypto.SettingsDecryptionResult;
import org.apache.maven.settings.io.SettingsWriter;
import org.apache.maven.wagon.proxy.ProxyInfo;
-import org.sonatype.aether.ConfigurationProperties;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.resolution.ArtifactRequest;
-import org.sonatype.aether.resolution.ArtifactResolutionException;
-import org.sonatype.aether.resolution.ArtifactResult;
-import org.sonatype.aether.transfer.ArtifactNotFoundException;
-import org.sonatype.aether.transfer.TransferListener;
-import org.sonatype.aether.util.DefaultRepositorySystemSession;
-
import org.eclipse.m2e.core.embedder.ICallable;
import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
import org.eclipse.m2e.core.embedder.IMaven;
@@ -727,7 +730,7 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
return context().execute(new ICallable<Artifact>() {
public Artifact call(IMavenExecutionContext context, IProgressMonitor monitor) throws CoreException {
- org.sonatype.aether.RepositorySystem repoSystem = lookup(org.sonatype.aether.RepositorySystem.class);
+ org.eclipse.aether.RepositorySystem repoSystem = lookup(org.eclipse.aether.RepositorySystem.class);
ArtifactRequest request = new ArtifactRequest();
request.setArtifact(RepositoryUtils.toArtifact(artifact));
@@ -1272,12 +1275,18 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
}
private static DefaultPlexusContainer newPlexusContainer() throws PlexusContainerException {
- ContainerConfiguration mavenCoreCC = new DefaultContainerConfiguration().setClassWorld(
- new ClassWorld(MAVEN_CORE_REALM_ID, ClassWorld.class.getClassLoader())).setName("mavenCore"); //$NON-NLS-1$
-
- mavenCoreCC.setAutoWiring(true);
-
- return new DefaultPlexusContainer(mavenCoreCC, new ExtensionModule());
+ final ContainerConfiguration mavenCoreCC = new DefaultContainerConfiguration() //
+ .setClassWorld(new ClassWorld(MAVEN_CORE_REALM_ID, ClassWorld.class.getClassLoader())) //
+ .setClassPathScanning(PlexusConstants.SCANNING_INDEX) //
+ .setAutoWiring(true) //
+ .setName("mavenCore"); //$NON-NLS-1$
+
+ final Module logginModule = new AbstractModule() {
+ protected void configure() {
+ bind(ILoggerFactory.class).toInstance(LoggerFactory.getILoggerFactory());
+ }
+ };
+ return new DefaultPlexusContainer(mavenCoreCC, logginModule, new ExtensionModule());
}
public synchronized void disposeContainer() {
@@ -1298,7 +1307,8 @@ public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
ModelBuildingRequest request = new DefaultModelBuildingRequest();
request.setUserProperties(project.getProperties());
ModelProblemCollector problems = new ModelProblemCollector() {
- public void add(ModelProblem.Severity severity, String message, InputLocation location, Exception cause) {
+ @Override
+ public void add(ModelProblemCollectorRequest req) {
}
};
lookup(ModelInterpolator.class).interpolateModel(model, project.getBasedir(), request, problems);
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ReadonlyMavenExecutionRequest.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ReadonlyMavenExecutionRequest.java
index 6319bee6..8b50e5a5 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ReadonlyMavenExecutionRequest.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ReadonlyMavenExecutionRequest.java
@@ -17,6 +17,10 @@ import java.util.Date;
import java.util.List;
import java.util.Properties;
+import org.eclipse.aether.RepositoryCache;
+import org.eclipse.aether.repository.WorkspaceReader;
+import org.eclipse.aether.transfer.TransferListener;
+
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.ExecutionListener;
import org.apache.maven.execution.MavenExecutionRequest;
@@ -26,10 +30,6 @@ import org.apache.maven.settings.Mirror;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Server;
-import org.sonatype.aether.RepositoryCache;
-import org.sonatype.aether.repository.WorkspaceReader;
-import org.sonatype.aether.transfer.TransferListener;
-
/**
* Read-only MavenExecutionRequest that throws IllegalStateException from all modifiers.
@@ -435,4 +435,18 @@ class ReadonlyMavenExecutionRequest implements MavenExecutionRequest {
return request.getProjectBuildingRequest();
}
+ /* (non-Javadoc)
+ * @see org.apache.maven.execution.MavenExecutionRequest#isUseLegacyLocalRepository()
+ */
+ public boolean isUseLegacyLocalRepository() {
+ return request.isUseLegacyLocalRepository();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.maven.execution.MavenExecutionRequest#setUseLegacyLocalRepository(boolean)
+ */
+ public MavenExecutionRequest setUseLegacyLocalRepository(boolean useLegacyRepository) {
+ return request.setUseLegacyLocalRepository(useLegacyRepository);
+ }
+
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
index 243c31aa..f997f4e2 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/ArtifactNotFoundProblemInfo.java
@@ -11,12 +11,11 @@
package org.eclipse.m2e.core.internal.markers;
+import org.eclipse.aether.artifact.Artifact;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.osgi.util.NLS;
-import org.sonatype.aether.artifact.Artifact;
-
import org.eclipse.m2e.core.internal.IMavenConstants;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java
index 2fd6a25a..12844432 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/MavenMarkerManager.java
@@ -62,7 +62,7 @@ public class MavenMarkerManager implements IMavenMarkerManager {
if(resolutionResult != null) {
allProblems
.addAll(toMavenProblemInfos(pomResource, defaultSourceLocation, resolutionResult.getCollectionErrors()));
- for(org.sonatype.aether.graph.Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
+ for(org.eclipse.aether.graph.Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
List<Exception> exceptions = resolutionResult.getResolutionErrors(dependency);
if(exceptions != null && exceptions.size() > 0) {
SourceLocation sourceLocation = SourceLocationHelper.findLocation(mavenProject, dependency);
@@ -190,8 +190,8 @@ public class MavenMarkerManager implements IMavenMarkerManager {
}
for(Throwable ex : exceptions) {
- if(ex instanceof org.sonatype.aether.transfer.ArtifactNotFoundException) {
- org.sonatype.aether.transfer.ArtifactNotFoundException artifactNotFoundException = (org.sonatype.aether.transfer.ArtifactNotFoundException) ex;
+ if(ex instanceof org.eclipse.aether.transfer.ArtifactNotFoundException) {
+ org.eclipse.aether.transfer.ArtifactNotFoundException artifactNotFoundException = (org.eclipse.aether.transfer.ArtifactNotFoundException) ex;
ArtifactNotFoundProblemInfo problem = new ArtifactNotFoundProblemInfo(artifactNotFoundException.getArtifact(),
mavenConfiguration.isOffline(), location);
result.add(problem);
@@ -252,7 +252,7 @@ public class MavenMarkerManager implements IMavenMarkerManager {
Set<Artifact> artifacts = mavenProject.getArtifacts();
all_artifacts_loop: for(Artifact mavenArtifact : artifacts) {
if(!mavenArtifact.isResolved()) {
- org.sonatype.aether.artifact.Artifact artifact = RepositoryUtils.toArtifact(mavenArtifact);
+ org.eclipse.aether.artifact.Artifact artifact = RepositoryUtils.toArtifact(mavenArtifact);
for(MavenProblemInfo problem : knownProblems) {
if(problem instanceof ArtifactNotFoundProblemInfo) {
ArtifactNotFoundProblemInfo artifactNotFoundProblemInfo = (ArtifactNotFoundProblemInfo) problem;
@@ -311,7 +311,7 @@ public class MavenMarkerManager implements IMavenMarkerManager {
MarkerUtils.decorateMarker(marker);
}
- private static boolean equals(org.sonatype.aether.artifact.Artifact a1, org.sonatype.aether.artifact.Artifact a2) {
+ private static boolean equals(org.eclipse.aether.artifact.Artifact a1, org.eclipse.aether.artifact.Artifact a2) {
if(a1 == a2) {
return true;
}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java
index 5d9135df..0b7962a5 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/markers/SourceLocationHelper.java
@@ -13,6 +13,7 @@ package org.eclipse.m2e.core.internal.markers;
import java.io.File;
+import org.eclipse.aether.graph.Dependency;
import org.eclipse.core.resources.IResource;
import org.apache.maven.model.InputLocation;
@@ -21,8 +22,6 @@ import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.project.MavenProject;
-import org.sonatype.aether.graph.Dependency;
-
import org.eclipse.m2e.core.project.configurator.MojoExecutionKey;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
index ec2fa928..a07321ae 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenConfigurationImpl.java
@@ -17,6 +17,7 @@ import org.osgi.service.prefs.BackingStoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.eclipse.aether.repository.RepositoryPolicy;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.ListenerList;
@@ -31,8 +32,6 @@ import org.eclipse.core.runtime.preferences.IPreferenceFilter;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.sonatype.aether.repository.RepositoryPolicy;
-
import org.eclipse.m2e.core.embedder.IMavenConfiguration;
import org.eclipse.m2e.core.embedder.IMavenConfigurationChangeListener;
import org.eclipse.m2e.core.embedder.MavenConfigurationChangeEvent;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipsePluginArtifactsCache.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipsePluginArtifactsCache.java
index 2612679e..643bed31 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipsePluginArtifactsCache.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipsePluginArtifactsCache.java
@@ -13,13 +13,13 @@ package org.eclipse.m2e.core.internal.project;
import javax.inject.Singleton;
+import org.eclipse.aether.RepositoryCache;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.RepositoryPolicy;
+
import org.apache.maven.plugin.DefaultPluginArtifactsCache;
import org.apache.maven.plugin.PluginResolutionException;
-import org.sonatype.aether.RepositoryCache;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.repository.RepositoryPolicy;
-
import org.eclipse.m2e.core.internal.embedder.MavenExecutionContext;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java
index 20aeb1ae..059e100b 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java
@@ -16,6 +16,7 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.eclipse.aether.graph.Dependency;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -26,8 +27,6 @@ import org.apache.maven.project.DependencyResolutionResult;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingRequest;
-import org.sonatype.aether.graph.Dependency;
-
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.internal.markers.IMavenMarkerManager;
@@ -91,7 +90,7 @@ public class DefaultMavenDependencyResolver extends AbstractMavenDependencyResol
DependencyResolutionResult resolutionResult = mavenResult.getDependencyResolutionResult();
if(resolutionResult != null && resolutionResult.getUnresolvedDependencies() != null) {
for(Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
- org.sonatype.aether.artifact.Artifact artifact = dependency.getArtifact();
+ org.eclipse.aether.artifact.Artifact artifact = dependency.getArtifact();
ArtifactKey dependencyKey = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(),
artifact.getVersion(), null);
requirements.add(MavenRequiredCapability.createMavenArtifact(dependencyKey, dependency.getScope(),
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java
index db507922..e1933f66 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java
@@ -13,6 +13,12 @@ package org.eclipse.m2e.core.internal.project.registry;
import java.util.List;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.DependencyFilter;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.repository.RemoteRepository;
+
import org.codehaus.plexus.component.annotations.Component;
import org.apache.maven.model.Plugin;
@@ -20,12 +26,6 @@ import org.apache.maven.plugin.PluginResolutionException;
import org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver;
import org.apache.maven.plugin.internal.PluginDependenciesResolver;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.graph.DependencyFilter;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.repository.RemoteRepository;
-
@Component(role = PluginDependenciesResolver.class)
public class EclipsePluginDependenciesResolver extends DefaultPluginDependenciesResolver {
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java
index 8d09e624..f934d9a0 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java
@@ -15,6 +15,9 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.repository.WorkspaceReader;
+import org.eclipse.aether.repository.WorkspaceRepository;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -23,10 +26,6 @@ import org.eclipse.core.runtime.IPath;
import org.apache.maven.repository.LocalArtifactRepository;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.repository.WorkspaceReader;
-import org.sonatype.aether.repository.WorkspaceRepository;
-
import org.eclipse.m2e.core.embedder.ArtifactKey;
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
index c6445050..fff7c689 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
@@ -20,6 +20,10 @@ import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
+import org.eclipse.aether.util.graph.transformer.ConflictResolver;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -81,9 +85,6 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.project.MavenProject;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.graph.DependencyVisitor;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.internal.IMavenConstants;
@@ -303,7 +304,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
for(Iterator<?> it = selection.iterator(); it.hasNext();) {
Object o = it.next();
if(o instanceof DependencyNode) {
- org.sonatype.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
OpenPomAction.openEditor(a.getGroupId(), a.getArtifactId(), a.getVersion(), null);
}
}
@@ -612,7 +613,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
if(!matcher.isEmpty()) {
for(DependencyNode node : dependencyNodes) {
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
if(matcher.isMatchingArtifact(a.getGroupId(), a.getGroupId())) {
treeViewer.reveal(node);
break;
@@ -637,7 +638,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
} else if(element instanceof DependencyNode) {
DependencyNode node = (DependencyNode) element;
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
return true;
}
@@ -646,7 +647,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
protected boolean foundMatch = false;
public boolean visitEnter(DependencyNode node) {
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
foundMatch = true;
return false;
@@ -768,7 +769,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
public Color getBackground(Object element) {
if(matcher != null && !matcher.isEmpty() && element instanceof DependencyNode) {
- org.sonatype.aether.artifact.Artifact a = ((DependencyNode) element).getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = ((DependencyNode) element).getDependency().getArtifact();
if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
return searchHighlightColor;
}
@@ -783,12 +784,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
if(element instanceof DependencyNode) {
DependencyNode node = (DependencyNode) element;
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
-
- org.sonatype.aether.artifact.Artifact c = null;
- if(!node.getAliases().isEmpty()) {
- c = node.getAliases().iterator().next();
- }
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
StringBuilder label = new StringBuilder(128);
@@ -800,15 +796,15 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
label.append(a.getBaseVersion());
- if(node.getPremanagedVersion() != null && !node.getPremanagedVersion().equals(a.getBaseVersion())) {
- label.append(" (managed from ").append(node.getPremanagedVersion()).append(")");
+ String premanagedVersion = DependencyManagerUtils.getPremanagedVersion(node);
+
+ if(premanagedVersion != null && !premanagedVersion.equals(a.getBaseVersion())) {
+ label.append(" (managed from ").append(premanagedVersion).append(")");
}
- if(c != null) {
- String version = c.getBaseVersion();
- if(!a.getBaseVersion().equals(version)) {
- label.append(" (omitted for conflict with ").append(version).append(")");
- }
+ DependencyNode winner = (DependencyNode) node.getData().get(ConflictResolver.NODE_DATA_WINNER);
+ if(winner != null) {
+ label.append(" (omitted for conflict with ").append(winner.getArtifact().getVersion()).append(")");
}
if(a.getClassifier().length() > 0) {
@@ -817,8 +813,10 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
label.append(" [").append(node.getDependency().getScope()).append("]");
- if(node.getPremanagedScope() != null) {
- label.append(" (from ").append(node.getPremanagedScope()).append(")");
+ String premanagedScope = DependencyManagerUtils.getPremanagedScope(node);
+
+ if(premanagedScope != null) {
+ label.append(" (from ").append(premanagedScope).append(")");
}
return label.toString();
@@ -830,7 +828,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
public Image getImage(Object element) {
if(element instanceof DependencyNode) {
DependencyNode node = (DependencyNode) element;
- org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = node.getDependency().getArtifact();
IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
@@ -985,7 +983,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
@Override
protected void addArtifactKey(Object o) {
if(o instanceof DependencyNode) {
- org.sonatype.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
+ org.eclipse.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
artifactKeys.add(getKey(a.getGroupId(), a.getArtifactId()));
}
}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index c7935aad..90d98556 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -23,6 +23,7 @@ import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -93,8 +94,6 @@ import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.project.MavenProject;
-import org.sonatype.aether.graph.DependencyNode;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.internal.IMavenConstants;
@@ -144,7 +143,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
private List<MavenPomEditorPage> mavenpomEditorPages = new ArrayList<MavenPomEditorPage>();
- private Map<String, org.sonatype.aether.graph.DependencyNode> rootNodes = new HashMap<String, org.sonatype.aether.graph.DependencyNode>();
+ private Map<String, org.eclipse.aether.graph.DependencyNode> rootNodes = new HashMap<String, org.eclipse.aether.graph.DependencyNode>();
IDOMModel structuredModel;
@@ -690,7 +689,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
}
}
- public synchronized org.sonatype.aether.graph.DependencyNode readDependencyTree(boolean force, String classpath,
+ public synchronized org.eclipse.aether.graph.DependencyNode readDependencyTree(boolean force, String classpath,
IProgressMonitor monitor) throws CoreException {
if(force || !rootNodes.containsKey(classpath)) {
monitor.setTaskName(Messages.MavenPomEditor_task_reading);
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java
index 91aaaf2b..9a27bb23 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/dependencyset/DependencySetAction.java
@@ -66,9 +66,9 @@ public class DependencySetAction implements IActionDelegate {
file = getFileFromEditor();
keys.add(new ArtifactKey((Artifact) selected));
- } else*/if(selected instanceof org.sonatype.aether.graph.DependencyNode) {
+ } else*/if(selected instanceof org.eclipse.aether.graph.DependencyNode) {
file = getFileFromEditor();
- org.sonatype.aether.graph.DependencyNode selected2 = (org.sonatype.aether.graph.DependencyNode) selected;
+ org.eclipse.aether.graph.DependencyNode selected2 = (org.eclipse.aether.graph.DependencyNode) selected;
if(selected2.getData().get("LEVEL") == null) {
keys.add(new ArtifactKey(selected2.getDependency().getArtifact()));
}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java
index f409996a..980ad1ff 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java
@@ -85,9 +85,9 @@ public class DependencyExcludeAction implements IActionDelegate {
if(selected instanceof Artifact) {
file = getFileFromEditor();
keys.add(new ArtifactKey((Artifact) selected));
- } else if(selected instanceof org.sonatype.aether.graph.DependencyNode) {
+ } else if(selected instanceof org.eclipse.aether.graph.DependencyNode) {
file = getFileFromEditor();
- keys.add(new ArtifactKey(((org.sonatype.aether.graph.DependencyNode) selected).getDependency().getArtifact()));
+ keys.add(new ArtifactKey(((org.eclipse.aether.graph.DependencyNode) selected).getDependency().getArtifact()));
} else if(selected instanceof RequiredProjectWrapper) {
RequiredProjectWrapper w = (RequiredProjectWrapper) selected;
file = getFileFromProject(w.getParentClassPathContainer().getJavaProject());
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
index a7045baf..b939d31b 100644
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeArtifactRefactoring.java
@@ -20,6 +20,10 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.DependencyVisitor;
+import org.eclipse.aether.util.artifact.JavaScopes;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -38,11 +42,6 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.model.Exclusion;
import org.apache.maven.project.MavenProject;
-import org.sonatype.aether.artifact.Artifact;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.graph.DependencyVisitor;
-import org.sonatype.aether.util.artifact.JavaScopes;
-
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.embedder.ICallable;

Back to the top