本文整理了Java中org.apache.maven.artifact.Artifact.getGroupId()
方法的一些代码示例,展示了Artifact.getGroupId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.getGroupId()
方法的具体详情如下:
包路径:org.apache.maven.artifact.Artifact
类名称:Artifact
方法名:getGroupId
暂无
代码示例来源:origin: org.apache.maven/maven-project
public Object getKey()
{
return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId();
}
代码示例来源:origin: org.apache.maven/maven-project
private String getRelocationKey( Artifact artifact )
{
return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion();
}
代码示例来源:origin: simpligility/android-maven-plugin
private boolean matchesTarget( Artifact found )
{
return found.getGroupId().equals( target.getGroupId() )
&& found.getArtifactId().equals( target.getArtifactId() )
&& found.getVersion().equals( target.getVersion() )
&& found.getType().equals( target.getType() )
&& classifierMatch( found.getClassifier(), target.getClassifier() )
;
}
代码示例来源:origin: apache/maven
private ModelSource createStubModelSource( Artifact artifact )
{
StringBuilder buffer = new StringBuilder( 1024 );
buffer.append( "<?xml version='1.0'?>" );
buffer.append( "<project>" );
buffer.append( "<modelVersion>4.0.0</modelVersion>" );
buffer.append( "<groupId>" ).append( artifact.getGroupId() ).append( "</groupId>" );
buffer.append( "<artifactId>" ).append( artifact.getArtifactId() ).append( "</artifactId>" );
buffer.append( "<version>" ).append( artifact.getBaseVersion() ).append( "</version>" );
buffer.append( "<packaging>" ).append( artifact.getType() ).append( "</packaging>" );
buffer.append( "</project>" );
return new StringModelSource( buffer, artifact.getId() );
}
代码示例来源:origin: apache/usergrid
/** @return Returns the full path of the original chop-runner jar file in the local maven repository */
public String getRunnerInLocalRepo() {
String path = localRepository;
Artifact chopPluginArtifact = plugin.getPluginArtifact();
path += "/" + chopPluginArtifact.getGroupId().replace( '.', '/' ) + "/chop-runner/" +
chopPluginArtifact.getVersion() + "/chop-runner-" + chopPluginArtifact.getVersion() + ".jar";
return path;
}
代码示例来源:origin: org.apache.maven/maven-artifact
protected AbstractArtifactResolutionException( String message,
Artifact artifact,
List<ArtifactRepository> remoteRepositories,
Throwable t )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), remoteRepositories, artifact.getDependencyTrail(), t );
this.artifact = artifact;
}
代码示例来源:origin: org.apache.maven/maven-artifact
public static String key( Artifact artifact )
{
return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
}
代码示例来源:origin: apache/maven
public Object getKey()
{
return "artifact " + artifact.getGroupId() + ":" + artifact.getArtifactId();
}
代码示例来源:origin: org.apache.maven/maven-project
/**
* Gets the repository conflict id of the specified artifact. Unlike the dependency conflict id, the repository
* conflict id uses the artifact file extension instead of the artifact type. Hence, the repository conflict id more
* closely reflects the identity of artifacts as perceived by a repository.
*
* @param artifact The artifact, must not be <code>null</code>.
* @return The repository conflict id, never <code>null</code>.
*/
private String getRepositoryConflictId( Artifact artifact )
{
StringBuffer buffer = new StringBuffer( 128 );
buffer.append( artifact.getGroupId() );
buffer.append( ':' ).append( artifact.getArtifactId() );
if ( artifact.getArtifactHandler() != null )
{
buffer.append( ':' ).append( artifact.getArtifactHandler().getExtension() );
}
else
{
buffer.append( ':' ).append( artifact.getType() );
}
if ( artifact.hasClassifier() )
{
buffer.append( ':' ).append( artifact.getClassifier() );
}
return buffer.toString();
}
代码示例来源:origin: apache/maven
protected AbstractArtifactResolutionException( String message,
Artifact artifact,
List<ArtifactRepository> remoteRepositories,
Throwable t )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), remoteRepositories, artifact.getDependencyTrail(), t );
this.artifact = artifact;
}
代码示例来源:origin: apache/maven
public static String key( Artifact artifact )
{
return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
}
代码示例来源:origin: apache/maven
public Object getKey()
{
return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId();
}
代码示例来源:origin: simpligility/android-maven-plugin
getLog().debug( "Generating incomplete R file for apklib: " + apklibArtifact.getGroupId()
+ ":" + apklibArtifact.getArtifactId() );
final File apklibManifest = new File( unpackDir, "AndroidManifest.xml" );
final File apklibResDir = new File( unpackDir, "res" );
final String extension = dependency.getType();
final File dependencyResDir = getUnpackedLibResourceFolder( dependency );
if ( ( extension.equals( APKLIB ) || extension.equals( AAR ) ) && dependencyResDir.exists() )
final String extension = dependency.getType();
final File dependencyAssetsDir = getUnpackedLibAssetsFolder( dependency );
if ( ( extension.equals( APKLIB ) || extension.equals( AAR ) ) )
代码示例来源:origin: org.apache.maven/maven-project
public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler )
{
super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type,
classifier, artifactHandler, parent.isOptional() );
setDependencyTrail( Collections.singletonList( parent.getId() ) );
this.parent = parent;
if ( getId().equals( parent.getId() ) )
{
throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID than its corresponding main artifact." );
}
}
代码示例来源:origin: jooby-project/jooby
@SuppressWarnings("unchecked")
private Set<Artifact> references(final MavenProject project) {
MavenProject parent = project.getParent();
if (parent != null) {
List<String> modules = parent.getModules();
if (modules != null) {
Set<Artifact> artifacts = new LinkedHashSet<Artifact>(mavenProject.getArtifacts());
String groupId = project.getGroupId();
String version = project.getVersion();
return artifacts.stream()
.filter(a -> a.getGroupId().equals(groupId) && a.getVersion().equals(version)
&& modules.contains(a.getArtifactId()))
.collect(Collectors.toSet());
}
}
return Collections.emptySet();
}
代码示例来源:origin: apache/maven
private boolean isWagonProvider( Artifact artifact )
{
if ( "org.apache.maven.wagon".equals( artifact.getGroupId() ) )
{
return artifact.getArtifactId().startsWith( "wagon-" );
}
return false;
}
代码示例来源:origin: apache/maven
public ArtifactNotFoundException( String message, Artifact artifact )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() );
}
代码示例来源:origin: jeremylong/DependencyCheck
/**
* Determines if the groupId, artifactId, and version of the Maven
* dependency and artifact match.
*
* @param d the Maven dependency
* @param a the Maven artifact
* @return true if the groupId, artifactId, and version match
*/
private static boolean artifactsMatch(org.apache.maven.model.Dependency d, Artifact a) {
return (isEqualOrNull(a.getArtifactId(), d.getArtifactId()))
&& (isEqualOrNull(a.getGroupId(), d.getGroupId()))
&& (isEqualOrNull(a.getVersion(), d.getVersion()));
}
代码示例来源:origin: apache/maven
public boolean include( Artifact artifact )
{
String id = artifact.getArtifactId();
if ( excludes.contains( id ) )
{
return false;
}
id = artifact.getGroupId() + ':' + id;
return !excludes.contains( id );
}
代码示例来源:origin: apache/maven
protected ArtifactNotFoundException( String message, Artifact artifact,
List<ArtifactRepository> remoteRepositories, Throwable cause )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact.getDependencyTrail(),
cause );
}
内容来源于网络,如有侵权,请联系作者删除!