if (c == null) { throw new IllegalArgumentException("Cannot add artifact '" + artifact.getId().getArtifactId().getShortDescription() + "' to configuration '" + conf + "' of module " + revId + " because this configuration doesn't exist!");
/** * Creates the unique prefix key that will reference the artifact within the properties. * * @param artifact * the artifact to create the unique key from. Cannot be null. * @return the unique prefix key as a string. */ private String getPrefixKey(Artifact artifact) { // use the hashcode as a uuid for the artifact (fingers crossed) int hashCode = artifact.getId().hashCode(); // use just some visual cue return "artifact:" + artifact.getName() + "#" + artifact.getType() + "#" + artifact.getExt() + "#" + hashCode; }
Boolean doesExclude(ModuleDescriptor md, String rootModuleConf, String[] moduleConfs, DependencyDescriptor dd, Artifact artifact, Stack callersStack) { // artifact is excluded if it match any of the exclude pattern for this dependency... if (dd != null) { if (dd.doesExclude(moduleConfs, artifact.getId().getArtifactId())) { return Boolean.TRUE; } } if (md.doesExclude(moduleConfs, artifact.getId().getArtifactId())) { return Boolean.TRUE; } // ... or if it is excluded by all its callers IvyNode c = getData().getNode(md.getModuleRevisionId()); if (c != null) { if (callersStack.contains(c.getId())) { // a circular dependency, we cannot be conclusive here return null; } return Boolean.valueOf(c.doesCallersExclude(rootModuleConf, artifact, callersStack)); } else { return Boolean.FALSE; } }
Artifact[] arts = md.getArtifacts(confs[i]); for (int j = 0; j < arts.length; j++) { allArtifacts.put(arts[j].getId().getArtifactId(), arts[j]);
private void unpackArtifact(Artifact artifact, ArtifactDownloadReport adr, CacheDownloadOptions options) { Artifact unpacked = packagingManager.getUnpackedArtifact(artifact); if (unpacked == null) { // nothing to unpack return; } File archiveFile = getArchiveFileInCache(unpacked, null, false); if (archiveFile.exists() && !options.isForce()) { adr.setUnpackedLocalFile(archiveFile); } else { Message.info("\tUnpacking " + artifact.getId()); try { packagingManager.unpackArtifact(artifact, adr.getLocalFile(), archiveFile); adr.setUnpackedLocalFile(archiveFile); } catch (Exception e) { Message.debug(e); adr.setDownloadStatus(DownloadStatus.FAILED); adr.setDownloadDetails("The packed artifact " + artifact.getId() + " could not be unpacked (" + e.getMessage() + ")"); } } }
conflictsConfMap.put(destinations[j], conflictsConf); if (conflicts.add(artifact.getId())) { conflictsReports.add(adr); conflictsConf.add(conf);
public ResolvedResource findArtifactRef(Artifact artifact, Date date) { ensureConfigured(getSettings()); ModuleRevisionId mrid = artifact.getModuleRevisionId(); if (isM2compatible()) { mrid = convertM2IdForResourceSearch(mrid); } ResolvedResource rres = null; if (artifact.getId().getRevision().endsWith("SNAPSHOT") && isM2compatible()) { rres = findSnapshotArtifact(artifact, date, mrid); if (rres != null) { return rres; } } return findResourceUsingPatterns(mrid, getArtifactPatterns(), artifact, getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date); }