@Override protected ProjectVersionRef cloneTarget( final ProjectVersionRef target ) { return new SimpleProjectVersionRef( target ); }
@Override public ArtifactRef asJarArtifact() { return asArtifactRef( "jar", null ); }
@Override public SimpleProjectVersionRef asProjectVersionRef() { return SimpleProjectVersionRef.class.equals( getClass() ) ? this : new SimpleProjectVersionRef( getGroupId(), getArtifactId(), getVersionSpecRaw(), getVersionStringRaw() ); }
@Override public GAVDependencyTree getDependencyTreeOfGAV(GAV gav) throws CommunicationException, FindGAVDependencyException { if (!aproxConnector.doesGAVExistInPublicRepo(gav)) { throw new FindGAVDependencyException("Could not find: " + gav + " in public repo of Aprox"); } try { SimpleProjectVersionRef rootRef = new SimpleProjectVersionRef(gav.getGroupId(), gav.getArtifactId(), gav.getVersion()); SingleGraphRequest r = new SingleGraphRequest(); r.setWorkspaceId("export-" + rootRef.toString()); r.setSource("group:" + config.getConfig().getAproxGroupPublic()); r.setPatcherIds(DepgraphPatcherConstants.ALL_PATCHERS); r.setResolve(true); r.setGraph(cartographer.newGraphDescription().withRoots(rootRef).withPreset("requires") .build()); GraphExport export = cartographer.graph(r); if (export == null) { log.warn("Analysis of the Dependency Tree of GAV: " + gav + " failed!"); return new GAVDependencyTree(gav); } if (export.getRelationships() == null) return new GAVDependencyTree(gav); else return generateGAVDependencyTree(export, gav); } catch (ClientHttpException | ConfigurationParseException | CartoClientException e) { throw new RepositoryException("Error while trying to communicate with Cartographer", e); } }
final ProjectVersionRef declaring = SimpleProjectVersionRef.parse( decl ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt );
@Override public boolean equals( final Object obj ) { if ( this == obj ) { return true; } if ( !super.equals( obj ) ) { return false; } if ( !(obj instanceof ArtifactRef) ) { return false; } final ArtifactRef other = (ArtifactRef) obj; return artifactFieldsEqual( other ); }
final ProjectVersionRef declaring = SimpleProjectVersionRef.parse( decl ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt ); final ProjectVersionRef target = SimpleProjectVersionRef.parse( tgt );
public static ProjectVersionRef projectVersion( final String groupId, final String artifactId, final String version ) throws InvalidVersionSpecificationException { return new SimpleProjectVersionRef( groupId, artifactId, version ); }
@Override public ArtifactRef asPomArtifact() { return asArtifactRef( "pom", null ); }
@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 ); }
@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()); }
public ProjectVersionRef getProjectId() { return new SimpleProjectVersionRef( getGroupId(), getArtifactId(), getVersion() ); }