public Object getKey() { return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId(); }
private String getRelocationKey( Artifact artifact ) { return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion(); }
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() ) ; }
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() ); }
/** @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; }
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 static String key( Artifact artifact ) { return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); }
public Object getKey() { return "artifact " + artifact.getGroupId() + ":" + artifact.getArtifactId(); }
/** * 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(); }
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 static String key( Artifact artifact ) { return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); }
public Object getKey() { return "project " + artifact.getGroupId() + ":" + artifact.getArtifactId(); }
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 ) ) )
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." ); } }
@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(); }
private boolean isWagonProvider( Artifact artifact ) { if ( "org.apache.maven.wagon".equals( artifact.getGroupId() ) ) { return artifact.getArtifactId().startsWith( "wagon-" ); } return false; }
public ArtifactNotFoundException( String message, Artifact artifact ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() ); }
/** * 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())); }
public boolean include( Artifact artifact ) { String id = artifact.getArtifactId(); if ( excludes.contains( id ) ) { return false; } id = artifact.getGroupId() + ':' + id; return !excludes.contains( id ); }
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 ); }