public static Artifact newIvyArtifact(ModuleRevisionId mrid, Date pubDate) { return new DefaultArtifact(mrid, pubDate, "ivy", "ivy", "xml", true); }
public Artifact getOriginalMetadataArtifact(Artifact moduleArtifact) { return DefaultArtifact.cloneWithAnotherType(moduleArtifact, moduleArtifact.getType() + ".original"); }
public static Artifact cloneWithAnotherExt(Artifact artifact, String newExt) { return cloneWithAnotherTypeAndExt(artifact, artifact.getType(), newExt); }
public Artifact getMetadataArtifact() { if (metadataArtifact == null) { metadataArtifact = DefaultArtifact.newIvyArtifact(resolvedRevId, resolvedPublicationDate); } return metadataArtifact; }
defaultMrids.add(mrid); } else { Artifact metadataArtifact = DefaultArtifact.newIvyArtifact(mrid, pubdate); MetadataArtifactDownloadReport madr = new MetadataArtifactDownloadReport( String type = attributes.getValue("type"); String ext = attributes.getValue("ext"); Artifact artifact = new DefaultArtifact(mrid, pubdate, artifactName, type, ext, ExtendableItemHelper.getExtraAttributes(attributes, "extra-")); ArtifactDownloadReport aReport = new ArtifactDownloadReport(artifact);
public Artifact getMetadataArtifact(ModuleRevisionId mrid, Resource res) { return DefaultArtifact.newPomArtifact(mrid, new Date(res.getLastModified())); }
public Artifact getMetadataArtifact(ModuleRevisionId mrid, Resource res) { return DefaultArtifact.newIvyArtifact(mrid, new Date(res.getLastModified())); }
private ResolvedResource findSnapshotDescriptor(DependencyDescriptor dd, ResolveData data, ModuleRevisionId mrid) { String rev = findSnapshotVersion(mrid); if (rev != null) { // here it would be nice to be able to store the resolved snapshot version, to avoid // having to follow the same process to download artifacts Message.verbose("[" + rev + "] " + mrid); // replace the revision token in file name with the resolved revision String pattern = getWholePattern().replaceFirst("\\-\\[revision\\]", "-" + rev); return findResourceUsingPattern(mrid, pattern, DefaultArtifact.newPomArtifact(mrid, data.getDate()), getRMDParser(dd, data), data.getDate()); } return null; }
private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) { return new DefaultArtifact(mrid, new Date(), "metadata", "metadata", "ivy", true); }
public Artifact getMetadataArtifact(ModuleRevisionId mrid, Resource res) { return DefaultArtifact.newIvyArtifact(mrid, new Date(res.getLastModified())); }
public static Artifact cloneWithAnotherType(Artifact artifact, String newType) { return cloneWithAnotherTypeAndExt(artifact, newType, artifact.getExt()); }
public ResolvedResource findIvyFileRef(DependencyDescriptor dd, ResolveData data) { if (isM2compatible() && isUsepoms()) { ModuleRevisionId mrid = dd.getDependencyRevisionId(); mrid = convertM2IdForResourceSearch(mrid); ResolvedResource rres = null; if (dd.getDependencyRevisionId().getRevision().endsWith("SNAPSHOT")) { rres = findSnapshotDescriptor(dd, data, mrid); if (rres != null) { return rres; } } rres = findResourceUsingPatterns(mrid, getIvyPatterns(), DefaultArtifact.newPomArtifact(mrid, data.getDate()), getRMDParser(dd, data), data.getDate()); return rres; } else { return null; } }
public static String substitute(String pattern, ModuleRevisionId moduleRevision, String artifact, String type, String ext) { return substitute(pattern, moduleRevision, new DefaultArtifact(moduleRevision, null, artifact, type, ext)); }
private ArtifactOrigin getDefaultMetadataArtifactOrigin(ModuleRevisionId mrid) { // it's important to say the origin is not local to make sure it won't ever be used for // anything else than original token return new ArtifactOrigin(DefaultArtifact.newIvyArtifact(mrid, null), false, getIvyFileInCache(mrid).getPath()); }
protected void putChecksum(Artifact artifact, File src, String dest, boolean overwrite, String algorithm) throws IOException { File csFile = File.createTempFile("ivytemp", algorithm); try { FileUtil.copy(new ByteArrayInputStream(ChecksumHelper.computeAsString(src, algorithm) .getBytes()), csFile, null); repository.put( DefaultArtifact.cloneWithAnotherTypeAndExt(artifact, algorithm, artifact.getExt() + "." + algorithm), csFile, dest + "." + algorithm, overwrite); } finally { csFile.delete(); } }
public static Artifact newPomArtifact(ModuleRevisionId mrid, Date pubDate) { return new DefaultArtifact(mrid, pubDate, mrid.getName(), "pom", "pom", true); }
private boolean isDependencyModuleExcluded(DependencyDescriptor dd, String rootModuleConf, ModuleRevisionId dependencyRevisionId, String conf) { Artifact a = DefaultArtifact.newIvyArtifact(dependencyRevisionId, null); if (isRoot()) { // no callers, but maybe some exclude Boolean exclude = doesExclude(md, rootModuleConf, new String[] {rootModuleConf}, dd, a, new Stack()); return exclude == null ? false : exclude.booleanValue(); } return callers.doesCallersExclude(rootModuleConf, a); }
protected void putSignature(Artifact artifact, File src, String dest, boolean overwrite) throws IOException { SignatureGenerator gen = getSettings().getSignatureGenerator(signerName); if (gen == null) { throw new IllegalArgumentException("Couldn't sign the artifacts! " + "Unknown signer name: '" + signerName + "'"); } File tempFile = File.createTempFile("ivytemp", gen.getExtension()); try { gen.sign(src, tempFile); repository.put( DefaultArtifact.cloneWithAnotherTypeAndExt(artifact, gen.getExtension(), artifact.getExt() + "." + gen.getExtension()), tempFile, dest + "." + gen.getExtension(), overwrite); } finally { tempFile.delete(); } }
public static DefaultArtifact buildArtifact(ModuleRevisionId mrid, URI baseUri, URI uri, String type, String ext, String packaging) { DefaultArtifact artifact; if ("ivy".equals(uri.getScheme())) { artifact = decodeIvyURI(uri); } else { if (!uri.isAbsolute()) { uri = baseUri.resolve(uri); } Map<String, String> extraAtt = new HashMap<String, String>(); if (packaging != null) { extraAtt.put("packaging", packaging); } try { artifact = new DefaultArtifact(mrid, null, mrid.getName(), type, ext, new URL( uri.toString()), extraAtt); } catch (MalformedURLException e) { throw new RuntimeException("Unable to make the uri into the url", e); } } return artifact; }
public File getIvyFileInCache(ModuleRevisionId mrid) { String file = IvyPatternHelper.substitute(getIvyPattern(), DefaultArtifact.newIvyArtifact(mrid, null)); return new File(getRepositoryCacheRoot(), file); }