Browse files

Classifiers not considered correctly in dependency resolution - FORGE…

…-526
  • Loading branch information...
1 parent ad62f6d commit 198beddfabe2abfb4adcdbc4c2f2c0b87db40969 @xandrox committed Apr 21, 2012
View
5 maven-api/src/main/java/org/jboss/forge/maven/dependencies/MavenDependencyAdapter.java
@@ -50,7 +50,7 @@ public MavenDependencyAdapter(final org.apache.maven.model.Dependency dep)
this.setArtifactId(clone.getArtifactId());
this.setGroupId(clone.getGroupId());
- this.setClassifier(clone.getClassifier());
+ this.setClassifier("".equals(clone.getClassifier()) ? null : clone.getClassifier());
@xandrox
Owner
xandrox added a note Apr 21, 2012

Classifier is blank if not set. This causes comparison probs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
this.setExclusions(clone.getExclusions());
this.setOptional(clone.isOptional());
this.setScope(clone.getScope());
@@ -70,6 +70,7 @@ public MavenDependencyAdapter(final Dependency dep)
this.setVersion(dep.getVersion());
this.setScope(dep.getScopeType());
this.setType(dep.getPackagingType());
+ this.setClassifier(dep.getClassifier());
for (Dependency exclusion : dep.getExcludedDependencies())
{
@@ -89,7 +90,7 @@ public MavenDependencyAdapter(final org.sonatype.aether.graph.Dependency dep)
this.setArtifactId(dep.getArtifact().getArtifactId());
this.setGroupId(dep.getArtifact().getGroupId());
- this.setClassifier(dep.getArtifact().getClassifier());
+ this.setClassifier("".equals(dep.getArtifact().getClassifier()) ? null : dep.getArtifact().getClassifier());
this.setExclusions(dep.getExclusions());
this.setOptional(dep.isOptional());
this.setScope(dep.getScope());
View
3 shell-api/src/main/java/org/jboss/forge/project/dependencies/DependencyBuilder.java
@@ -78,7 +78,8 @@ else if ((l == null) || (r == null))
}
return !(l.getArtifactId() != null ? !l.getArtifactId().equals(r.getArtifactId()) : r.getArtifactId() != null) &&
@xandrox
Owner
xandrox added a note Apr 21, 2012

Artifacts are only equals with the same classifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
- !(l.getGroupId() != null ? !l.getGroupId().equals(r.getGroupId()) : r.getGroupId() != null);
+ !(l.getGroupId() != null ? !l.getGroupId().equals(r.getGroupId()) : r.getGroupId() != null) &&
+ !(l.getClassifier() != null ? !l.getClassifier().equals(r.getClassifier()) : r.getClassifier() != null);
}

0 comments on commit 198bedd

Please sign in to comment.