@Override public String toString() { return getFile() + " (" + ( isAvailable() ? "available" : "unavailable" ) + ")"; }
@Override public String toString() { return getFile() + " (" + ( isAvailable() ? "available" : "unavailable" ) + ")"; }
private boolean isLocallyInstalled( LocalArtifactResult lar, VersionResult vr ) { if ( lar.isAvailable() ) { return true; } if ( lar.getFile() != null ) { if ( vr.getRepository() instanceof LocalRepository ) { // resolution of (snapshot) version found locally installed artifact return true; } else if ( vr.getRepository() == null && lar.getRequest().getRepositories().isEmpty() ) { // resolution of version range found locally installed artifact return true; } } return false; }
private boolean isLocallyInstalled( LocalArtifactResult lar, VersionResult vr ) { if ( lar.isAvailable() ) { return true; } if ( lar.getFile() != null ) { if ( vr.getRepository() instanceof LocalRepository ) { // resolution of (snapshot) version found locally installed artifact return true; } else if ( vr.getRepository() == null && lar.getRequest().getRepositories().isEmpty() ) { // resolution of version range found locally installed artifact return true; } } return false; }
if (localResult.getFile() != null && localResult.getRepository() != null) { getLog().info("Purging: " + dependency + " from remote repository: " + localResult.getRepository() + "."); File deleteTarget = new File(localRepositoryManager.getRepository().getBasedir(), localRepositoryManager.getPathForLocalArtifact(dependency.getArtifact()));
@Override public ArtifactSpec resolve(ArtifactSpec spec) { if (spec.file == null) { final DefaultArtifact artifact = new DefaultArtifact(spec.groupId(), spec.artifactId(), spec.classifier(), spec.type(), spec.version()); final LocalArtifactResult localResult = this.session.getLocalRepositoryManager() .find(this.session, new LocalArtifactRequest(artifact, this.remoteRepositories, null)); if (localResult.isAvailable()) { spec.file = localResult.getFile(); } else { try { final ArtifactResult result = resolver.resolveArtifact(this.session, new ArtifactRequest(artifact, this.remoteRepositories, null)); if (result.isResolved()) { spec.file = result.getArtifact().getFile(); } } catch (ArtifactResolutionException e) { System.err.println("ERR " + e); e.printStackTrace(); } } } return spec.file != null ? spec : null; }
artifact = artifact.setFile( getFile( session, artifact, local.getFile() ) ); result.setArtifact( artifact ); artifactResolved( session, trace, artifact, result.getRepository(), null ); else if ( local.getFile() != null ) LOGGER.debug( "Verifying availability of {} from {}", local.getFile(), repos );
artifact = artifact.setFile( getFile( session, artifact, local.getFile() ) ); result.setArtifact( artifact ); artifactResolved( session, trace, artifact, result.getRepository(), null ); else if ( local.getFile() != null ) logger.debug( "Verifying availability of " + local.getFile() + " from " + repos );