static Artifact coordinateToMavenArtifact(final Coordinate dep) { Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getClassifier(), dep.getPackaging() == null ? "jar" : dep.getPackaging(), dep.getVersion()); return artifact; }
public static CoordinateBuilder create(Coordinate c) { CoordinateBuilder builder = create(); builder.setGroupId(c.getGroupId()).setArtifactId(c.getArtifactId()); builder.setClassifier(c.getClassifier()).setPackaging(c.getPackaging()).setVersion(c.getVersion()); return builder; }
public MavenDependencyAdapter(final Dependency dep) { if (dep == null) { throw new IllegalArgumentException("Dependency must not be null."); } this.setArtifactId(dep.getCoordinate().getArtifactId()); this.setGroupId(dep.getCoordinate().getGroupId()); this.setVersion(dep.getCoordinate().getVersion()); this.setScope(dep.getScopeType()); this.setType(dep.getCoordinate().getPackaging()); this.setClassifier(dep.getCoordinate().getClassifier()); this.setSystemPath(dep.getCoordinate().getSystemPath()); if (dep.getExcludedCoordinates() != null) { for (Coordinate exclusion : dep.getExcludedCoordinates()) { Exclusion temp = new Exclusion(); temp.setArtifactId(exclusion.getArtifactId()); temp.setGroupId(exclusion.getGroupId()); this.getExclusions().add(temp); } } }