本文整理汇总了Java中org.apache.ivy.core.module.id.ModuleRevisionId.getRevision方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleRevisionId.getRevision方法的具体用法?Java ModuleRevisionId.getRevision怎么用?Java ModuleRevisionId.getRevision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.id.ModuleRevisionId
的用法示例。
在下文中一共展示了ModuleRevisionId.getRevision方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findUniqueSnapshotVersion
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
private TimestampedModuleSource findUniqueSnapshotVersion(ModuleRevisionId moduleRevisionId) {
ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(moduleRevisionId);
ModuleVersionArtifactIdentifier artifactId = new DefaultModuleVersionArtifactIdentifier(moduleVersionIdentifier, moduleVersionIdentifier.getName(), "pom", "pom");
DefaultModuleVersionArtifactMetaData pomArtifact = new DefaultModuleVersionArtifactMetaData(artifactId);
String metadataLocation = toResourcePattern(getWholePattern()).toModuleVersionPath(pomArtifact) + "/maven-metadata.xml";
MavenMetadata mavenMetadata = parseMavenMetadata(metadataLocation);
if (mavenMetadata.timestamp != null) {
// we have found a timestamp, so this is a snapshot unique version
String rev = moduleRevisionId.getRevision();
rev = rev.substring(0, rev.length() - "SNAPSHOT".length());
rev = rev + mavenMetadata.timestamp + "-" + mavenMetadata.buildNumber;
return new TimestampedModuleSource(rev);
}
return null;
}
示例2: ivy2aether
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
private static org.fedoraproject.xmvn.artifact.Artifact ivy2aether( ModuleRevisionId revision, String extension )
{
String groupId = revision.getOrganisation();
String artifactId = revision.getName();
String classifier = revision.getExtraAttribute( "classifier" );
String version = revision.getRevision();
return new org.fedoraproject.xmvn.artifact.DefaultArtifact( groupId, artifactId, extension, classifier,
version );
}
示例3: SvnPublishTransaction
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
/**
* Constructs a new instance of this class.
*
* @param svnDAO The subversion DAO to use.
* @param mrid The ivy Module Revision ID.
* @param commitRepository The repository to use for commits.
* @param ivyRepositoryRootURL The root of the Ivy repository in Subversion.
* @throws SVNException If an error occurs setting the commit repository to its root.
*/
public SvnPublishTransaction(SvnDao svnDAO, ModuleRevisionId mrid, SVNRepository commitRepository,
SVNURL ivyRepositoryRootURL) throws SVNException {
this.svnDAO = svnDAO;
this.revision = mrid.getRevision();
setCommitRepository(commitRepository);
this.ivyRepositoryRootURL = ivyRepositoryRootURL;
StringBuilder comment = new StringBuilder();
comment.append("Ivy publishing ").append(mrid.getOrganisation()).append("#");
comment.append(mrid.getName()).append(";").append(mrid.getRevision());
this.commitMessage = comment.toString();
}
示例4: newId
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
public static ModuleVersionIdentifier newId(ModuleRevisionId moduleRevisionId) {
return new DefaultModuleVersionIdentifier(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
}
示例5: DefaultDependencyMetaData
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
public DefaultDependencyMetaData(DependencyDescriptor dependencyDescriptor) {
this.dependencyDescriptor = dependencyDescriptor;
ModuleRevisionId dependencyRevisionId = dependencyDescriptor.getDependencyRevisionId();
requested = new DefaultModuleVersionSelector(dependencyRevisionId.getOrganisation(), dependencyRevisionId.getName(), dependencyRevisionId.getRevision());
}
示例6: printInfoTag
import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
private static void printInfoTag(ModuleDescriptor md, SimpleXmlWriter writer) throws IOException {
ModuleRevisionId moduleRevisionId = md.getModuleRevisionId();
writer.startElement("info");
writer.attribute("organisation", moduleRevisionId.getOrganisation());
writer.attribute("module", moduleRevisionId.getName());
ModuleRevisionId resolvedModuleRevisionId = md.getResolvedModuleRevisionId();
String branch = resolvedModuleRevisionId.getBranch();
if (branch != null) {
writer.attribute("branch", branch);
}
String revision = resolvedModuleRevisionId.getRevision();
if (revision != null) {
writer.attribute("revision", revision);
}
writer.attribute("status", md.getStatus());
SimpleDateFormat ivyDateFormat = new SimpleDateFormat(IVY_DATE_PATTERN);
writer.attribute("publication", ivyDateFormat.format(md.getResolvedPublicationDate()));
if (md.isDefault()) {
writer.attribute("default", "true");
}
if (md instanceof DefaultModuleDescriptor) {
DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
if (dmd.getNamespace() != null && !dmd.getNamespace().getName().equals("system")) {
writer.attribute("namespace", dmd.getNamespace().getName());
}
}
if (!md.getExtraAttributes().isEmpty()) {
printExtraAttributes(md, writer);
}
ExtendsDescriptor[] parents = md.getInheritedDescriptors();
if (parents.length != 0) {
throw new UnsupportedOperationException("Extends descriptors not supported.");
}
License[] licenses = md.getLicenses();
for (int i = 0; i < licenses.length; i++) {
License license = licenses[i];
writer.startElement("license");
if (license.getName() != null) {
writer.attribute("name", license.getName());
}
if (license.getUrl() != null) {
writer.attribute("url", license.getUrl());
}
writer.endElement();
}
if (md.getHomePage() != null || md.getDescription() != null) {
writer.startElement("description");
if (md.getHomePage() != null) {
writer.attribute("homepage", md.getHomePage());
}
if (md.getDescription() != null && md.getDescription().trim().length() > 0) {
writer.characters(md.getDescription());
}
writer.endElement();
}
for (Iterator it = md.getExtraInfo().entrySet().iterator(); it.hasNext();) {
Map.Entry extraDescr = (Map.Entry) it.next();
if (extraDescr.getValue() == null || ((String) extraDescr.getValue()).length() == 0) {
continue;
}
writer.startElement(extraDescr.getKey().toString());
writer.characters(extraDescr.getValue().toString());
writer.endElement();
}
writer.endElement();
}