public DefaultResolvedArtifact( ResolvedDependency resolvedDependency, Artifact artifact, Factory<File> artifactSource) { this.resolvedDependency = resolvedDependency; // Unpack the stuff that we're interested from the artifact and discard. The artifact instance // drags in a whole pile of stuff that // we don't want to retain references to. this.name = artifact.getName(); this.type = artifact.getType(); this.ext = artifact.getExt(); this.extraAttributes = new HashMap<String, String>(artifact.getQualifiedExtraAttributes()); this.artifactSource = artifactSource; }
@Test public void init() { assertSame(testPom, artifactPom.getPom()); assertEquals(expectedArtifact, artifactPom.getArtifact()); assertEquals(expectedFile, artifactPom.getArtifactFile()); checkPom( expectedArtifact.getModuleRevisionId().getOrganisation(), expectedArtifact.getName(), expectedArtifact.getType(), expectedArtifact.getModuleRevisionId().getRevision(), expectedArtifact.getExtraAttribute(DependencyManager.CLASSIFIER)); }
@Test public void initWithCustomPomSettings() { testPom.setArtifactId(expectedArtifact.getName() + "X"); testPom.setGroupId(expectedArtifact.getModuleRevisionId().getOrganisation() + "X"); testPom.setVersion(expectedArtifact.getModuleRevisionId().getRevision() + "X"); testPom.setPackaging(expectedArtifact.getType() + "X"); testPom.setClassifier(expectedArtifact.getExtraAttribute(DependencyManager.CLASSIFIER) + "X"); artifactPom = new DefaultArtifactPom(testPom, expectedArtifact, expectedFile); assertEquals(expectedArtifact, artifactPom.getArtifact()); assertEquals(expectedFile, artifactPom.getArtifactFile()); checkPom( testPom.getGroupId(), testPom.getArtifactId(), testPom.getPackaging(), testPom.getVersion(), testPom.getClassifier()); }
private boolean isIgnorable(Artifact artifact) { return artifact.getType().equals("ivy"); }