@Override protected ProjectVersionRef cloneTarget( final ProjectVersionRef target ) { return new SimpleProjectVersionRef( target ); }
@Override public SimpleProjectVersionRef newRef( final String groupId, final String artifactId, final SingleVersion version ) { return new SimpleProjectVersionRef( groupId, artifactId, version ); }
public static ProjectVersionRef projectVersion( final String groupId, final String artifactId, final String version ) throws InvalidVersionSpecificationException { return new SimpleProjectVersionRef( groupId, artifactId, version ); }
@Override protected ProjectVersionRef cloneTarget( final ProjectVersionRef target ) { return new SimpleProjectVersionRef( target ); }
@Override protected ProjectVersionRef cloneTarget( final ProjectVersionRef target ) { return new SimpleProjectVersionRef( target ); }
@Override public T detach() { return (T) new SimpleProjectVersionRef( this ); } }
@Override protected ProjectVersionRef cloneTarget( final ProjectVersionRef target ) { return new SimpleProjectVersionRef( target ); }
private ProjectVersionRef buildRootToGAV(String executionRootName, String executionRootVersion) { String[] splittedName = executionRootName.split(":"); if(splittedName.length != 2) { throw new IllegalArgumentException("Execution root '" + executionRootName + "' doesn't seem to be maven G:A."); } return new SimpleProjectVersionRef( splittedName[0], splittedName.length < 2 ? null : splittedName[1], executionRootVersion); }
public static ProjectVersionRef parse( final String gav ) { final String[] parts = gav.split( ":" ); if ( parts.length < 3 || isEmpty( parts[0] ) || isEmpty( parts[1] ) || isEmpty( parts[2] ) ) { throw new InvalidRefException( "ProjectVersionRef must contain non-empty groupId, artifactId, AND version. (Given: '" + gav + "')" ); } return new SimpleProjectVersionRef( parts[0], parts[1], parts[2] ); }
public static ProjectVersionRef projectVersion( final String src ) { final String[] parts = src.split( ":" ); if ( parts.length != 3 ) { throw new IllegalArgumentException( "Invalid: '" + src + "'. Must contain exactly three fields separated by ':'" ); } try { return new SimpleProjectVersionRef( parts[0], parts[1], parts[2] ); } catch ( final InvalidVersionSpecificationException e ) { throw new IllegalArgumentException( "Invalid: '" + src + "'. Version: '" + parts[2] + "' is invalid: " + e.getMessage(), e ); } }
@Deprecated public String pomFor( final String groupId, final String artifactId, final String version, final String workspaceId, final Map<String, String[]> params, final PomRequest config ) throws AproxWorkflowException { final ProjectVersionRef pvr = new SimpleProjectVersionRef( groupId, artifactId, version ); config.setOutput( pvr ); return pomFor( config ); }
private ProjectVersionRef buildRootToGAV(BuildRecordRest build) { String[] splittedName = build.getExecutionRootName().split(":"); if(splittedName.length != 2) throw new IllegalArgumentException("Execution root '"+build.getExecutionRootName()+"' doesnt seem to be maven G:A."); return new SimpleProjectVersionRef( splittedName[0], splittedName.length < 2 ? null : splittedName[1], build.getExecutionRootVersion()); }
@Override public SimpleProjectVersionRef asProjectVersionRef() { return SimpleProjectVersionRef.class.equals( getClass() ) ? this : new SimpleProjectVersionRef( getGroupId(), getArtifactId(), getVersionSpecRaw(), getVersionStringRaw() ); }
public ProjectVersionRef getProjectId() { return new SimpleProjectVersionRef( getGroupId(), getArtifactId(), getVersion() ); }
private ProjectVersionRef mavenArtifactToGAV(MavenBuiltArtifact mba) { return new SimpleProjectVersionRef(mba.getGroupId(), mba.getArtifactId(), mba.getVersion()); } }
public ProjectVersionRef getKey() { return new SimpleProjectVersionRef( getGroupId(), getArtifactId(), getVersion() ); }
private ProjectVersionRef mavenBuildToGAV(MavenBuild mb) { return new SimpleProjectVersionRef(mb.getGroupId(), mb.getArtifactId(), mb.getVersion()); }
@Deprecated public File tree( final String groupId, final String artifactId, final String version, final String workspaceId, final DependencyScope scope, final Map<String, String[]> params ) throws AproxWorkflowException { final ProjectVersionRef ref = new SimpleProjectVersionRef( groupId, artifactId, version ); final Map<String, Object> parsed = presetParamParser.parse( params ); if ( !parsed.containsKey( CommonPresetParameters.SCOPE ) ) { parsed.put( CommonPresetParameters.SCOPE, scope == null ? DependencyScope.runtime : scope ); } final ProjectRelationshipFilter filter = requestAdvisor.createRelationshipFilter( params, parsed ); final RepositoryContentRequest dto = new RepositoryContentRequest(); dto.setWorkspaceId( workspaceId ); final GraphDescription desc = new GraphDescription( filter, null, ref ); dto.setGraphComposition( new GraphComposition( GraphCalculationType.ADD, Collections.singletonList( desc ) ) ); return tree( dto ); }
public void unlockOnFileErrorEvent( @Observes final FileErrorEvent evt ) { final String path = evt.getTransfer() .getPath(); try { final ArtifactPathInfo info = ArtifactPathInfo.parse( path ); // logger.info( "Unlocking {} due to file download error.", info ); if ( info != null ) { final ProjectVersionRef ref = new SimpleProjectVersionRef( info.getGroupId(), info.getArtifactId(), info.getVersion() ); delegate.notifyOfGraph( ref ); } } catch ( final InvalidVersionSpecificationException e ) { logger.error( String.format( "Cannot parse version for path: '%s'. Failed to unlock waiting threads. Reason: %s", path, e.getMessage() ), e ); } }
public AbstractSimpleProjectRelationship( final ProjectRelationship<R, T> relationship ) { this.sources.addAll( relationship.getSources() ); this.declaring = new SimpleProjectVersionRef( relationship.getDeclaring() ); this.pomLocation = relationship.getPomLocation(); this.index = relationship.getIndex(); this.managed = relationship.isManaged(); this.inherited = relationship.isInherited(); this.mixin = relationship.isMixin(); this.type = relationship.getType(); this.target = cloneTarget( relationship.getTarget() ); }