本文整理了Java中org.sonatype.aether.artifact.Artifact.getGroupId()
方法的一些代码示例,展示了Artifact.getGroupId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.getGroupId()
方法的具体详情如下:
包路径:org.sonatype.aether.artifact.Artifact
类名称:Artifact
方法名:getGroupId
[英]Gets the group identifier of this artifact, for example "org.apache.maven".
[中]获取此工件的组标识符,例如“org.apache.maven”。
代码示例来源:origin: apache/zeppelin
private List<File> loadFromMvn(String artifact, Collection<String> excludes)
throws RepositoryException {
Collection<String> allExclusions = new LinkedList<>();
allExclusions.addAll(excludes);
allExclusions.addAll(Arrays.asList(exclusions));
List<ArtifactResult> listOfArtifact;
listOfArtifact = getArtifactsWithDep(artifact, allExclusions);
Iterator<ArtifactResult> it = listOfArtifact.iterator();
while (it.hasNext()) {
Artifact a = it.next().getArtifact();
String gav = a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion();
for (String exclude : allExclusions) {
if (gav.startsWith(exclude)) {
it.remove();
break;
}
}
}
List<File> files = new LinkedList<>();
for (ArtifactResult artifactResult : listOfArtifact) {
files.add(artifactResult.getArtifact().getFile());
logger.debug("load {}", artifactResult.getArtifact().getFile().getAbsolutePath());
}
return files;
}
代码示例来源:origin: org.eclipse.proviso/proviso-spi
public String getGroupId()
{
return delegate.getGroupId();
}
代码示例来源:origin: sonatype/sonatype-aether
public Key( Artifact artifact )
{
this.artifact = artifact;
int hash = 17;
hash = hash * 31 + artifact.getGroupId().hashCode();
hash = hash * 31 + artifact.getArtifactId().hashCode();
hashCode = hash;
}
代码示例来源:origin: org.sonatype.sisu.assembler/sisu-assembler
static String pathOf( final Artifact artifact )
{
final StringBuilder path = new StringBuilder( 128 );
path.append( artifact.getGroupId().replace( '.', '/' ) ).append( '/' );
path.append( artifact.getArtifactId() ).append( '/' );
path.append( artifact.getBaseVersion() ).append( '/' );
path.append( nameOf( artifact ) );
return path.toString();
}
代码示例来源:origin: org.jvnet.hudson/hudson-maven-embedder
private String getConflictId( Artifact artifact )
{
StringBuilder buffer = new StringBuilder( 128 );
buffer.append( artifact.getGroupId() );
buffer.append( ':' ).append( artifact.getArtifactId() );
buffer.append( ':' ).append( artifact.getExtension() );
if ( artifact.getClassifier().length() > 0 )
{
buffer.append( ':' ).append( artifact.getClassifier() );
}
return buffer.toString();
}
代码示例来源:origin: sonatype/sonatype-aether
@Override
public int hashCode()
{
int hash = 17;
hash = hash * 31 + artifact.getArtifactId().hashCode();
hash = hash * 31 + artifact.getGroupId().hashCode();
hash = hash * 31 + artifact.getClassifier().hashCode();
hash = hash * 31 + artifact.getExtension().hashCode();
return hash;
}
代码示例来源:origin: de.smartics.properties/smartics-properties-resource-maven
@Override
public boolean accept(final DependencyNode node,
final List<DependencyNode> parents)
{
final Dependency dependency = node.getDependency();
if (dependency == null)
{
return false;
}
final String groupId = dependency.getArtifact().getGroupId();
final boolean accept = groupId.startsWith(prefix);
return accept;
}
代码示例来源:origin: org.apache.maven.mae.components/mae-project-tools
/**
* {@inheritDoc}
*
* @see org.apache.maven.mae.project.session.ProjectToolsSession#getReactorProject(org.sonatype.aether.artifact.Artifact)
*/
@Override
public MavenProject getReactorProject( final Artifact artifact )
{
final String id = key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion() );
return reactorProjects.get( id );
}
代码示例来源:origin: org.jvnet.hudson/hudson-maven-embedder
public File findArtifact( Artifact artifact )
{
String projectKey = artifact.getGroupId() + ':' + artifact.getArtifactId() + ':' + artifact.getVersion();
MavenProject project = projectsByGAV.get( projectKey );
if ( project != null )
{
return find( project, artifact );
}
return null;
}
代码示例来源:origin: org.sonatype.aether/aether-test-util
public String getPathForLocalArtifact( Artifact artifact )
{
String artifactId = artifact.getArtifactId();
String groupId = artifact.getGroupId();
String extension = artifact.getExtension();
String version = artifact.getVersion();
String classifier = artifact.getClassifier();
String path =
String.format( "%s/%s/%s/%s-%s-%s%s.%s", groupId, artifactId, version, groupId, artifactId, version,
classifier, extension );
return path;
}
代码示例来源:origin: sap-production/xcode-maven-plugin
private DefaultArtifact getSideArtifact(final org.sonatype.aether.artifact.Artifact mainArtifact,
final String classifier,
String type)
{
return new DefaultArtifact(mainArtifact.getGroupId(), mainArtifact.getArtifactId(), classifier,
type, mainArtifact.getVersion());
}
}
代码示例来源:origin: sonatype/sonatype-aether
@Override
public String toString()
{
return artifact.getGroupId() + ':' + artifact.getArtifactId() + ':' + artifact.getClassifier() + ':'
+ artifact.getExtension();
}
代码示例来源:origin: sonatype/sonatype-aether
public String getPathForLocalArtifact( Artifact artifact )
{
String artifactId = artifact.getArtifactId();
String groupId = artifact.getGroupId();
String extension = artifact.getExtension();
String version = artifact.getVersion();
String classifier = artifact.getClassifier();
String path =
String.format( "%s/%s/%s/%s-%s-%s%s.%s", groupId, artifactId, version, groupId, artifactId, version,
classifier, extension );
return path;
}
代码示例来源:origin: org.sonatype.aether/aether-impl
private String getId( Artifact a )
{
return a.getGroupId() + ':' + a.getArtifactId() + ':' + a.getClassifier() + ':' + a.getExtension();
}
代码示例来源:origin: io.fabric8.fab/fab-core
@Override
public boolean matches(Dependency dependencyTree) {
Artifact artifact = dependencyTree.getArtifact();
String groupId = artifact.getGroupId();
String artifactId = artifact.getArtifactId();
return groupFilter.matches(groupId) && artifactFilter.matches(artifactId);
}
代码示例来源:origin: org.fusesource.fabric.fab/fab-core
@Override
public boolean matches(Dependency dependencyTree) {
Artifact artifact = dependencyTree.getArtifact();
String groupId = artifact.getGroupId();
String artifactId = artifact.getArtifactId();
return groupFilter.matches(groupId) && artifactFilter.matches(artifactId);
}
代码示例来源:origin: org.fusesource.fabric.fab/fabric-fab-core
public static DependencyId newInstance(Artifact artifact) {
return new DependencyId(artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), artifact.getExtension());
}
代码示例来源:origin: io.takari.m2e.workspace/org.eclipse.m2e.workspace.cli
public File findArtifact(org.sonatype.aether.artifact.Artifact artifact) {
return WorkspaceState2.getInstance().findArtifact(artifact.getGroupId(), artifact.getArtifactId(),
artifact.getExtension(), artifact.getClassifier(), artifact.getBaseVersion());
}
代码示例来源:origin: org.daisy.pipeline/pax-exam-helper
private MavenBundle(Artifact artifact, boolean forceVersionAsInProject) {
groupId(artifact.getGroupId());
artifactId(artifact.getArtifactId());
type(artifact.getExtension());
classifier(artifact.getClassifier());
if (!forceVersionAsInProject)
version(artifact.getVersion());
}
代码示例来源:origin: com.simpligility.org.apache.maven.shared/maven-dependency-tree
private Artifact getDependencyArtifact( Dependency dep )
{
org.sonatype.aether.artifact.Artifact artifact = dep.getArtifact();
return factory.createDependencyArtifact( artifact.getGroupId(), artifact.getArtifactId(),
VersionRange.createFromVersion( artifact.getVersion() ),
artifact.getProperty( "type", artifact.getExtension() ),
artifact.getClassifier(), dep.getScope(), dep.isOptional() );
}
内容来源于网络,如有侵权,请联系作者删除!