Refine search
public String toString() { return "project information for " + artifact.getArtifactId() + " " + artifact.getVersion(); }
private String getRelocationKey( Artifact artifact ) { return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion(); }
/** @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; }
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." ); } }
public static String key( Artifact artifact ) { return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); }
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." ); } }
public String toString() { return "project information for " + artifact.getArtifactId() + " " + artifact.getVersion(); }
public static String key( Artifact artifact ) { return key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); }
public static Artifact toArtifact( org.apache.maven.artifact.Artifact artifact ) { if ( artifact == null ) { return null; } String version = artifact.getVersion(); if ( version == null && artifact.getVersionRange() != null ) { version = artifact.getVersionRange().toString(); } Map<String, String> props = null; if ( org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) { String localPath = ( artifact.getFile() != null ) ? artifact.getFile().getPath() : ""; props = Collections.singletonMap( ArtifactProperties.LOCAL_PATH, localPath ); } Artifact result = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(), artifact.getArtifactHandler().getExtension(), version, props, newArtifactType( artifact.getType(), artifact.getArtifactHandler() ) ); result = result.setFile( artifact.getFile() ); 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(); }
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() ) ; }
range = VersionRange.createFromVersion( artifact.getVersion() ); DefaultArtifact clone = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), range.cloneOf(), artifact.getScope(), artifact.getType(), artifact.getClassifier(), artifact.getArtifactHandler(), artifact.isOptional() ); clone.setRelease( artifact.isRelease() ); clone.setResolvedVersion( artifact.getVersion() ); clone.setResolved( artifact.isResolved() ); clone.setFile( artifact.getFile() ); if ( artifact.getVersion() != null )
throw new MojoExecutionException( "Cannot locate artifact file of " + artifact.getArtifactId() ); FileUtils.getFileNames( targetFolderFile, artifact.getArtifactId() + "-*.jar", null, false ); existing.get( 0 ).split( "(" + artifact.getArtifactId() + "-)" )[1].split( "(.jar)" )[0]; DefaultArtifactVersion existingVersion = new DefaultArtifactVersion( version ); DefaultArtifactVersion artifactVersion = new DefaultArtifactVersion( artifact.getVersion() );
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; }
range = VersionRange.createFromVersion( artifact.getVersion() ); DefaultArtifact clone = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), range.cloneOf(), artifact.getScope(), artifact.getType(), artifact.getClassifier(), artifact.getArtifactHandler(), artifact.isOptional() ); clone.setRelease( artifact.isRelease() ); clone.setResolvedVersion( artifact.getVersion() ); clone.setResolved( artifact.isResolved() ); clone.setFile( artifact.getFile() ); if ( artifact.getVersion() != null )
if ( artifact.getVersion() == null ) + artifact.getArtifactId(), 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; }
if ( !removeVersion ) versionString = "-" + artifact.getVersion(); destFileName = artifact.getArtifactId() + versionString + classifierString + "." + artifact.getArtifactHandler().getExtension();
@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(); }
/** * 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())); }