diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/bazel/repository/MavenDownloader.java | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/MavenDownloader.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/MavenDownloader.java index 4b473c2e8b..5732f8e1fb 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/MavenDownloader.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/MavenDownloader.java @@ -48,37 +48,16 @@ import org.eclipse.aether.resolution.ArtifactResult; */ public class MavenDownloader extends HttpDownloader { - @Nullable - private String name; - @Nullable - private Path outputDirectory; - public MavenDownloader(RepositoryCache repositoryCache) { super(repositoryCache); } /** - * Returns the name for this artifact-fetching rule. - */ - public String getName() { - return name; - } - - /** - * Returns the directory that this artifact will be downloaded to. - */ - public Path getOutputDirectory() { - return outputDirectory; - } - - /** * Download the Maven artifact to the output directory. Returns the path to the jar (and the * srcjar if available). */ public JarPaths download(String name, WorkspaceAttributeMapper mapper, Path outputDirectory, MavenServerValue serverValue) throws IOException, EvalException { - this.name = name; - this.outputDirectory = outputDirectory; String url = serverValue.getUrl(); Server server = serverValue.getServer(); @@ -101,7 +80,7 @@ public class MavenDownloader extends HttpDownloader { boolean isCaching = repositoryCache.isEnabled() && KeyType.SHA1.isValid(sha1); if (isCaching) { - Path downloadPath = getDownloadDestination(artifact); + Path downloadPath = getDownloadDestination(outputDirectory, artifact); Path cachedDestination = repositoryCache.get(sha1, downloadPath, KeyType.SHA1); if (cachedDestination != null) { return new JarPaths(cachedDestination, Optional.absent()); @@ -152,7 +131,7 @@ public class MavenDownloader extends HttpDownloader { } } - private Path getDownloadDestination(Artifact artifact) { + private Path getDownloadDestination(Path outputDirectory, Artifact artifact) { String groupIdPath = artifact.getGroupId().replace('.', '/'); String artifactId = artifact.getArtifactId(); String version = artifact.getVersion(); |