@Override public String pathOf( Artifact artifact ) { return userLocalArtifactRepository.pathOf( artifact ); }
@Override public String pathOf( Artifact artifact ) { return localRepository.pathOf( artifact ); }
@Override public void putArtifact( File source, Artifact artifact, ArtifactRepository deploymentRepository, TransferListener downloadMonitor ) throws TransferFailedException { putRemoteFile( deploymentRepository, source, deploymentRepository.pathOf( artifact ), downloadMonitor ); }
public String getPathForRemoteArtifact( Artifact artifact, RemoteRepository repository, String context ) { return delegate.pathOf( RepositoryUtils.toArtifact( artifact ) ); }
public void updateVersion( String version, ArtifactRepository localRepository ) { setResolvedVersion( version ); setFile( new File( localRepository.getBasedir(), localRepository.pathOf( this ) ) ); }
public void updateVersion( String version, ArtifactRepository localRepository ) { setResolvedVersion( version ); setFile( new File( localRepository.getBasedir(), localRepository.pathOf( this ) ) ); }
private File getLocalMavenRepoFile(MavenSession session, File source) { ArtifactRepository localRepo = session.getLocalRepository(); if (localRepo == null) { log.warn("No local repo found so not adding any extra watches in the local repository"); return null; } Artifact artifact = getArtifactFromJar(source); if (artifact != null) { try { return new File(localRepo.getBasedir(), localRepo.pathOf(artifact)); } catch (InvalidArtifactRTException e) { log.warn("Cannot get the local repository path for %s in base dir %s : %s", artifact, localRepo.getBasedir(), e.getMessage()); } } return null; }
throws TransferFailedException, ResourceDoesNotExistException String remotePath = repository.pathOf( artifact );
public String pathOf( Artifact artifact ) { return artifactRepository.pathOf( artifact ); } public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
public String pathOf( Artifact artifact ) { return artifactRepository.pathOf( artifact ); } public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
/** * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist * (yet). * * @param artifact The artifact whose local repo path should be determined, must not be <code>null</code>. * @return The absolute path to the artifact when installed, never <code>null</code>. */ private File getLocalRepoFile( Artifact artifact ) { String path = localRepository.pathOf( artifact ); return new File( localRepository.getBasedir(), path ); }
/** * Gets the path of the specified artifact within the local repository. Note that the returned path need not exist * (yet). * * @param artifact The artifact whose local repo path should be determined, must not be <code>null</code>. * @return The absolute path to the artifact when installed, never <code>null</code>. */ protected File getLocalRepoFile( Artifact artifact ) { String path = localRepository.pathOf( artifact ); return new File( localRepository.getBasedir(), path ); }
private String classpath(List<URL> dependencies) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < dependencies.size(); i++) { URL s = dependencies.get(i); sb.append(s.getPath()).append(File.pathSeparatorChar); } final Artifact artifact =artifactFactory.createArtifact("fr.inria.spirals","npefix", HARDCODED_NPEFIX_VERSION, null, "jar"); File file = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifact)); sb.append(file.getAbsoluteFile()); System.out.println(sb); return sb.toString(); }
protected File resolve(ArtifactInfo a, String type, String classifier) throws AbstractArtifactResolutionException { Artifact artifact = af.createArtifactWithClassifier(a.groupId, a.artifactId, a.version, type, classifier); if (!new File(localRepo, local.pathOf(artifact)).isFile()) { System.err.println("Downloading " + artifact); } try { ar.resolve(artifact, remoteRepositories, local); } catch (RuntimeException e) { throw new ArtifactResolutionException(e.getMessage(), artifact); } return artifact.getFile(); }
private List<URL> getAstorClasspath() { List<URL> classpath = new ArrayList<>(); Artifact artifactPom = artifactFactory.createArtifact("org.inria.sacha.automaticRepair","astor", HARDCODED_ASTOR_VERSION, null, "pom"); Artifact artifactJar = artifactFactory.createArtifact("org.inria.sacha.automaticRepair","astor", HARDCODED_ASTOR_VERSION, null, "jar"); File filePom = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactPom)); File fileJar = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactJar)); classpath.addAll(getClassPathFromPom(filePom, fileJar)); return classpath; }
private List<URL> getNopolClasspath() { List<URL> classpath = new ArrayList<>(); Artifact artifactPom = artifactFactory.createArtifact("fr.inria.gforge.spirals","nopol", HARDCODED_NOPOL_VERSION, null, "pom"); Artifact artifactJar = artifactFactory.createArtifact("fr.inria.gforge.spirals","nopol", HARDCODED_NOPOL_VERSION, null, "jar"); File filePom = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactPom)); File fileJar = new File(localRepository.getBasedir() + "/" + localRepository.pathOf(artifactJar)); classpath.addAll(getClassPathFromPom(filePom, fileJar)); return classpath; }
public String getArtifactRelativeRepositoryPath(Artifact artifact) { // embedder.setLocalRepositoryDirectory(FileUtil.toFile(getRepositoryRoot())); String toRet = getEmbedder().getLocalRepository().pathOf(artifact); return toRet; }
/** * @param repository maven repository * @param artifact maven artifact * @return file URI pointing to artifact in repository */ public static URI getArtifactURI( ArtifactRepository repository, Artifact artifact ) { String baseDir = repository.getBasedir(); String artifactPath = repository.pathOf( artifact ); return toFileURI( baseDir + '/' + artifactPath ); }
private File getDirectorRepositoryZip(ArtifactRepository localMavenRepository) { // this artifact is a dependency of the Mojo, so we expect it in the local Maven repo Artifact artifact = repositorySystem.createArtifact("org.eclipse.tycho", "tycho-standalone-p2-director", TychoVersion.getTychoVersion(), "eclipse-repository"); return new File(localMavenRepository.getBasedir(), localMavenRepository.pathOf(artifact)); } }