org.apache.ivy.core.module.id.ArtifactRevisionId Java Examples

The following examples show how to use org.apache.ivy.core.module.id.ArtifactRevisionId. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NameSpaceHelperTest.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
@Test
public void testTransformArtifactWithExtraAttributes() {
    Artifact artifact = new DefaultArtifact(ArtifactRevisionId.newInstance(
        ModuleRevisionId.parse("org.apache#test;1.0"), "test", "jar", "jar",
        Collections.singletonMap("m:qualifier", "sources")), new Date(), null, false);

    MRIDTransformationRule r = new MRIDTransformationRule();
    r.addSrc(new MRIDRule("org.apache", "test", null));
    r.addDest(new MRIDRule("apache", "test", null));

    Artifact transformed = NameSpaceHelper.transform(artifact, r);
    assertEquals("apache#test;1.0", transformed.getModuleRevisionId().toString());
    assertEquals(Collections.singletonMap("m:qualifier", "sources"),
        transformed.getQualifiedExtraAttributes());
}
 
Example #2
Source File: IvyPublish.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public ArtifactRevisionId getId() {
    return null;
}
 
Example #3
Source File: MDArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public ArtifactRevisionId getId() {
    // do not cache the result because the resolvedModuleRevisionId can change!
    return ArtifactRevisionId.newInstance(md.getResolvedModuleRevisionId(), name, type, ext,
        extraAttributes);
}
 
Example #4
Source File: DefaultArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public static Artifact cloneWithAnotherTypeAndExt(Artifact artifact, String newType,
        String newExt) {
    return new DefaultArtifact(ArtifactRevisionId.newInstance(artifact.getModuleRevisionId(),
        artifact.getName(), newType, newExt, artifact.getQualifiedExtraAttributes()),
            artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata());
}
 
Example #5
Source File: DefaultArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public static Artifact cloneWithAnotherName(Artifact artifact, String name) {
    return new DefaultArtifact(ArtifactRevisionId.newInstance(artifact.getModuleRevisionId(),
        name, artifact.getType(), artifact.getExt(), artifact.getQualifiedExtraAttributes()),
            artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata());
}
 
Example #6
Source File: DefaultArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public static Artifact cloneWithAnotherMrid(Artifact artifact, ModuleRevisionId mrid) {
    return new DefaultArtifact(ArtifactRevisionId.newInstance(mrid, artifact.getName(),
        artifact.getType(), artifact.getExt(), artifact.getQualifiedExtraAttributes()),
            artifact.getPublicationDate(), artifact.getUrl(), artifact.isMetadata());
}
 
Example #7
Source File: DefaultArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public DefaultArtifact(ModuleRevisionId mrid, Date publicationDate, String name, String type,
        String ext, URL url, Map<String, String> extraAttributes) {
    this(ArtifactRevisionId.newInstance(mrid, name, type, ext, extraAttributes),
            publicationDate, url, false);
}
 
Example #8
Source File: DefaultArtifact.java    From ant-ivy with Apache License 2.0 4 votes vote down vote up
public ArtifactRevisionId getId() {
    return arid;
}
 
Example #9
Source File: Artifact.java    From ant-ivy with Apache License 2.0 2 votes vote down vote up
/**
 * Return the specific identifier of this artifact.
 *
 * @return the id of the artifact
 */
ArtifactRevisionId getId();