mirror of https://github.com/apache/druid.git
Add --no-default-remote-repositories flag to pull-deps. (#3120)
This commit is contained in:
parent
53886a677c
commit
3b3e772748
|
@ -30,7 +30,11 @@ A local repostiry that Maven will use to put downloaded files. Then pull-deps wi
|
||||||
|
|
||||||
`-r` or `--remoteRepository`
|
`-r` or `--remoteRepository`
|
||||||
|
|
||||||
Add a remote repository to the default remote repository list, which includes https://repo1.maven.org/maven2/ and https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local
|
Add a remote repository. Unless --no-default-remote-repositories is provided, these will be used after https://repo1.maven.org/maven2/ and https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local
|
||||||
|
|
||||||
|
`--no-default-remote-repositories`
|
||||||
|
|
||||||
|
Don't use the default remote repositories, only use the repositories provided directly via --remoteRepository.
|
||||||
|
|
||||||
`-d` or `--defaultVersion`
|
`-d` or `--defaultVersion`
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package io.druid.cli;
|
package io.druid.cli;
|
||||||
|
|
||||||
import com.google.common.base.Throwables;
|
import com.google.common.base.Throwables;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
@ -133,6 +134,11 @@ public class PullDependencies implements Runnable
|
||||||
*/
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private static final List<String> DEFAULT_REMOTE_REPOSITORIES = ImmutableList.of(
|
||||||
|
"https://repo1.maven.org/maven2/",
|
||||||
|
"https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local"
|
||||||
|
);
|
||||||
|
|
||||||
private TeslaAether aether;
|
private TeslaAether aether;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -166,20 +172,23 @@ public class PullDependencies implements Runnable
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = {"-l", "--localRepository"},
|
name = {"-l", "--localRepository"},
|
||||||
title = "A local repostiry that Maven will use to put downloaded files. Then pull-deps will lay these files out into the extensions directory as needed.",
|
title = "A local repository that Maven will use to put downloaded files. Then pull-deps will lay these files out into the extensions directory as needed.",
|
||||||
required = false
|
required = false
|
||||||
)
|
)
|
||||||
public String localRepository = String.format("%s/%s", System.getProperty("user.home"), ".m2/repository");
|
public String localRepository = String.format("%s/%s", System.getProperty("user.home"), ".m2/repository");
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = {"-r", "--remoteRepository"},
|
name = {"-r", "--remoteRepository"},
|
||||||
title = "Add a remote repository to the default remote repository list, which includes https://repo1.maven.org/maven2/ and https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local",
|
title = "Add a remote repository. Unless --no-default-remote-repositories is provided, these will be used after https://repo1.maven.org/maven2/ and https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local",
|
||||||
required = false
|
required = false
|
||||||
)
|
)
|
||||||
List<String> remoteRepositories = Lists.newArrayList(
|
List<String> remoteRepositories = Lists.newArrayList();
|
||||||
"https://repo1.maven.org/maven2/",
|
|
||||||
"https://metamx.artifactoryonline.com/metamx/pub-libs-releases-local"
|
@Option(
|
||||||
);
|
name = "--no-default-remote-repositories",
|
||||||
|
description = "Don't use the default remote repositories, only use the repositories provided directly via --remoteRepository",
|
||||||
|
required = false)
|
||||||
|
public boolean noDefaultRemoteRepositories = false;
|
||||||
|
|
||||||
@Option(
|
@Option(
|
||||||
name = {"-d", "--defaultVersion"},
|
name = {"-d", "--defaultVersion"},
|
||||||
|
@ -370,7 +379,11 @@ public class PullDependencies implements Runnable
|
||||||
alongside anything else that's grabbing System.out. But who knows.
|
alongside anything else that's grabbing System.out. But who knows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
List<String> remoteUriList = remoteRepositories;
|
final List<String> remoteUriList = Lists.newArrayList();
|
||||||
|
if (!noDefaultRemoteRepositories) {
|
||||||
|
remoteUriList.addAll(DEFAULT_REMOTE_REPOSITORIES);
|
||||||
|
}
|
||||||
|
remoteUriList.addAll(remoteRepositories);
|
||||||
|
|
||||||
List<Repository> remoteRepositories = Lists.newArrayList();
|
List<Repository> remoteRepositories = Lists.newArrayList();
|
||||||
for (String uri : remoteUriList) {
|
for (String uri : remoteUriList) {
|
||||||
|
|
Loading…
Reference in New Issue