|
@@ -174,24 +174,21 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
|
|
}
|
|
}
|
|
|
|
|
|
private static void addIvyRepo(Project project, String name, String url, String group) {
|
|
private static void addIvyRepo(Project project, String name, String url, String group) {
|
|
- project.getRepositories().ivy(ivyRepo -> {
|
|
|
|
- ivyRepo.setName(name);
|
|
|
|
- ivyRepo.setUrl(url);
|
|
|
|
- ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
|
|
|
|
|
|
+ IvyArtifactRepository ivyRepo = project.getRepositories().ivy(repo -> {
|
|
|
|
+ repo.setName(name);
|
|
|
|
+ repo.setUrl(url);
|
|
|
|
+ repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
|
|
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
|
|
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
|
|
- ivyRepo.credentials(HttpHeaderCredentials.class, creds -> {
|
|
|
|
|
|
+ repo.credentials(HttpHeaderCredentials.class, creds -> {
|
|
creds.setName("X-Elastic-No-KPI");
|
|
creds.setName("X-Elastic-No-KPI");
|
|
creds.setValue("1");
|
|
creds.setValue("1");
|
|
});
|
|
});
|
|
- ivyRepo.getAuthentication().create("header", HttpHeaderAuthentication.class);
|
|
|
|
- ivyRepo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
|
|
|
|
- ivyRepo.content(content -> content.includeGroup(group));
|
|
|
|
|
|
+ repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
|
|
|
|
+ repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
|
|
});
|
|
});
|
|
- project.getRepositories().all(repo -> {
|
|
|
|
- if (repo.getName().equals(name) == false) {
|
|
|
|
- // all other repos should ignore the special group name
|
|
|
|
- repo.content(content -> content.excludeGroup(group));
|
|
|
|
- }
|
|
|
|
|
|
+ project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
|
|
|
|
+ exclusiveContentRepository.filter(config -> config.includeGroup(group));
|
|
|
|
+ exclusiveContentRepository.forRepositories(ivyRepo);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|