Refine search
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() ); }
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() ) ; }
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; }
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; }
public ArtifactNotFoundException( String message, Artifact artifact ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() ); }
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 ); }
public ArtifactNotFoundException( String message, Artifact artifact ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() ); }
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 ); }
else if ( !a.getArtifactId().equals( artifactId ) ) else if ( a.getClassifier() == null ? classifier != null : !a.getClassifier().equals( classifier ) )
else if ( !a.getArtifactId().equals( artifactId ) ) else if ( a.getClassifier() == null ? classifier != null : !a.getClassifier().equals( classifier ) )
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; }
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(); }
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(); }
if ( result == 0 ) result = artifactId.compareTo( a.getArtifactId() ); if ( result == 0 ) if ( a.getClassifier() != null ) if ( a.getClassifier() != null ) result = classifier.compareTo( a.getClassifier() );
if ( result == 0 ) result = artifactId.compareTo( a.getArtifactId() ); if ( result == 0 ) if ( a.getClassifier() != null ) if ( a.getClassifier() != null ) result = classifier.compareTo( a.getClassifier() );
/** * 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(); }
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(); }
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(); }
else if ( !a.getArtifactId().equals( getArtifactId() ) ) else if ( a.getClassifier() == null ? getClassifier() != null : !a.getClassifier().equals( getClassifier() ) )
@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 ); }