本文整理了Java中org.apache.maven.artifact.Artifact.getClassifier()
方法的一些代码示例,展示了Artifact.getClassifier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.getClassifier()
方法的具体详情如下:
包路径:org.apache.maven.artifact.Artifact
类名称:Artifact
方法名:getClassifier
暂无
代码示例来源:origin: apache/maven
File getTouchfile( Artifact artifact )
{
StringBuilder sb = new StringBuilder( 128 );
sb.append( artifact.getArtifactId() );
sb.append( '-' ).append( artifact.getBaseVersion() );
if ( artifact.getClassifier() != null )
{
sb.append( '-' ).append( artifact.getClassifier() );
}
sb.append( '.' ).append( artifact.getType() ).append( LAST_UPDATE_TAG );
return new File( artifact.getFile().getParentFile(), sb.toString() );
}
代码示例来源: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: 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: 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 ArtifactNotFoundException( String message, Artifact artifact )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() );
}
代码示例来源: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 );
}
代码示例来源:origin: org.apache.maven/maven-artifact
public ArtifactNotFoundException( String message, Artifact artifact )
{
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() );
}
代码示例来源:origin: org.apache.maven/maven-artifact
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 );
}
代码示例来源:origin: apache/maven
else if ( !a.getArtifactId().equals( artifactId ) )
else if ( a.getClassifier() == null ? classifier != null : !a.getClassifier().equals( classifier ) )
代码示例来源:origin: org.apache.maven/maven-artifact
else if ( !a.getArtifactId().equals( artifactId ) )
else if ( a.getClassifier() == null ? classifier != null : !a.getClassifier().equals( classifier ) )
代码示例来源:origin: apache/maven
private static int artifactHashCode( Artifact a )
{
int result = 17;
result = 31 * result + a.getGroupId().hashCode();
result = 31 * result + a.getArtifactId().hashCode();
result = 31 * result + a.getType().hashCode();
if ( a.getVersion() != null )
{
result = 31 * result + a.getVersion().hashCode();
}
result = 31 * result + ( a.getClassifier() != null ? a.getClassifier().hashCode() : 0 );
result = 31 * result + ( a.getScope() != null ? a.getScope().hashCode() : 0 );
result = 31 * result + ( a.getDependencyFilter() != null ? a.getDependencyFilter().hashCode() : 0 );
result = 31 * result + ( a.isOptional() ? 1 : 0 );
return result;
}
代码示例来源:origin: apache/maven
public String pathOf( Artifact artifact )
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuilder path = new StringBuilder( 128 );
path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );
if ( artifact.hasClassifier() )
{
path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
}
if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
{
path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
}
return path.toString();
}
代码示例来源:origin: apache/maven
public String pathOf( Artifact artifact )
{
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
StringBuilder path = new StringBuilder( 128 );
path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR );
path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR );
path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR );
path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() );
if ( artifact.hasClassifier() )
{
path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() );
}
if ( artifactHandler.getExtension() != null && artifactHandler.getExtension().length() > 0 )
{
path.append( GROUP_SEPARATOR ).append( artifactHandler.getExtension() );
}
return path.toString();
}
代码示例来源:origin: org.apache.maven/maven-artifact
if ( result == 0 )
result = artifactId.compareTo( a.getArtifactId() );
if ( result == 0 )
if ( a.getClassifier() != null )
if ( a.getClassifier() != null )
result = classifier.compareTo( a.getClassifier() );
代码示例来源:origin: apache/maven
if ( result == 0 )
result = artifactId.compareTo( a.getArtifactId() );
if ( result == 0 )
if ( a.getClassifier() != null )
if ( a.getClassifier() != null )
result = classifier.compareTo( a.getClassifier() );
代码示例来源: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
private static String constructMessage( List<Artifact> artifacts )
{
StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "Missing:\n" );
buffer.append( "----------\n" );
int counter = 0;
for ( Artifact artifact : artifacts )
{
String message = ( ++counter ) + ") " + artifact.getId();
buffer.append( constructMissingArtifactMessage( message, " ", artifact.getGroupId(),
artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(),
artifact.getDownloadUrl(), artifact.getDependencyTrail() ) );
}
buffer.append( "----------\n" );
int size = artifacts.size();
buffer.append( size ).append( " required artifact" );
if ( size > 1 )
{
buffer.append( "s are" );
}
else
{
buffer.append( " is" );
}
buffer.append( " missing.\n\nfor artifact: " );
return buffer.toString();
}
代码示例来源:origin: org.apache.maven/maven-artifact
private static String constructMessage( List<Artifact> artifacts )
{
StringBuilder buffer = new StringBuilder( 256 );
buffer.append( "Missing:\n" );
buffer.append( "----------\n" );
int counter = 0;
for ( Artifact artifact : artifacts )
{
String message = ( ++counter ) + ") " + artifact.getId();
buffer.append( constructMissingArtifactMessage( message, " ", artifact.getGroupId(),
artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(),
artifact.getDownloadUrl(), artifact.getDependencyTrail() ) );
}
buffer.append( "----------\n" );
int size = artifacts.size();
buffer.append( size ).append( " required artifact" );
if ( size > 1 )
{
buffer.append( "s are" );
}
else
{
buffer.append( " is" );
}
buffer.append( " missing.\n\nfor artifact: " );
return buffer.toString();
}
代码示例来源:origin: org.apache.maven/maven-project
else if ( !a.getArtifactId().equals( getArtifactId() ) )
else if ( a.getClassifier() == null ? getClassifier() != null : !a.getClassifier().equals( getClassifier() ) )
代码示例来源:origin: apache/maven
@Deprecated
public List<Dependency> getTestDependencies()
{
Set<Artifact> artifacts = getArtifacts();
if ( ( artifacts == null ) || artifacts.isEmpty() )
{
return Collections.emptyList();
}
List<Dependency> list = new ArrayList<>( artifacts.size() );
for ( Artifact a : getArtifacts() )
{
Dependency dependency = new Dependency();
dependency.setArtifactId( a.getArtifactId() );
dependency.setGroupId( a.getGroupId() );
dependency.setVersion( a.getVersion() );
dependency.setScope( a.getScope() );
dependency.setType( a.getType() );
dependency.setClassifier( a.getClassifier() );
list.add( dependency );
}
return Collections.unmodifiableList( list );
}
内容来源于网络,如有侵权,请联系作者删除!