File: 01-maven3-compatibility.patch

package info (click to toggle)
maven-dependency-tree 2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 580 kB
  • ctags: 615
  • sloc: java: 3,685; xml: 450; sh: 11; makefile: 5
file content (61 lines) | stat: -rw-r--r-- 2,692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: Fix the compatibility with Maven 3.1
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java
+++ b/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java
@@ -40,8 +40,8 @@
 import org.apache.maven.shared.dependency.graph.DependencyNode;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.version.VersionConstraint;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.version.VersionConstraint;
 
 /**
  * Wrapper around Maven 3 dependency resolver.
@@ -101,7 +101,7 @@
 
     private Artifact getDependencyArtifact( Dependency dep )
     {
-        org.sonatype.aether.artifact.Artifact artifact = dep.getArtifact();
+        org.eclipse.aether.artifact.Artifact artifact = dep.getArtifact();
 
         return factory.createDependencyArtifact( artifact.getGroupId(), artifact.getArtifactId(),
                                                  VersionRange.createFromVersion( artifact.getVersion() ),
@@ -109,7 +109,7 @@
                                                  artifact.getClassifier(), dep.getScope(), dep.isOptional() );
     }
 
-    private DependencyNode buildDependencyNode( DependencyNode parent, org.sonatype.aether.graph.DependencyNode node,
+    private DependencyNode buildDependencyNode( DependencyNode parent, org.eclipse.aether.graph.DependencyNode node,
                                                 Artifact artifact, ArtifactFilter filter )
     {
         DefaultDependencyNode current =
@@ -117,7 +117,7 @@
                                        getVersionSelectedFromRange( node.getVersionConstraint() ) );
 
         List<DependencyNode> nodes = new ArrayList<DependencyNode>( node.getChildren().size() );
-        for ( org.sonatype.aether.graph.DependencyNode child : node.getChildren() )
+        for ( org.eclipse.aether.graph.DependencyNode child : node.getChildren() )
         {
             Artifact childArtifact = getDependencyArtifact( child.getDependency() );
 
@@ -139,16 +139,6 @@
             return null;
         }
 
-        StringBuilder sb = new StringBuilder();
-        for ( org.sonatype.aether.version.VersionRange range : constraint.getRanges() )
-        {
-            if ( sb.length() > 0 )
-            {
-                sb.append( ',' );
-            }
-            sb.append( range );
-        }
-
-        return sb.toString();
+        return constraint.getRange().toString();
     }
 }