1
+ import org.elasticsearch.gradle.VersionProperties
2
+ import org.elasticsearch.gradle.internal.dra.DraResolvePlugin
3
+
1
4
apply plugin : ' elasticsearch.internal-es-plugin'
2
5
apply plugin : ' elasticsearch.internal-cluster-test'
3
6
apply plugin : ' elasticsearch.internal-test-artifact'
@@ -11,27 +14,42 @@ esplugin {
11
14
extendedPlugins = [' x-pack-autoscaling' , ' lang-painless' ]
12
15
}
13
16
17
+ def localRepo = providers. systemProperty(' build.ml_cpp.repo' ). orNull
14
18
if (useDra == false ) {
15
19
repositories {
16
20
exclusiveContent {
21
+ filter {
22
+ includeGroup ' org.elasticsearch.ml'
23
+ }
17
24
forRepository {
18
25
ivy {
19
26
name " ml-cpp"
20
- url providers. systemProperty(' build.ml_cpp.repo' ). orElse(' https://prelert-artifacts.s3.amazonaws.com' ). get()
21
27
metadataSources {
22
28
// no repository metadata, look directly for the artifact
23
29
artifact()
24
30
}
25
- patternLayout {
26
- artifact " maven/org/elasticsearch/ml/ml-cpp/[revision]/[module]-[revision](-[classifier]).[ext]"
31
+ if (localRepo) {
32
+ url localRepo
33
+ patternLayout {
34
+ artifact " maven/[orgPath]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
35
+ }
36
+ } else {
37
+ url " https://artifacts-snapshot.elastic.co/"
38
+ patternLayout {
39
+ if (VersionProperties . isElasticsearchSnapshot()) {
40
+ artifact ' /ml-cpp/[revision]/downloads/ml-cpp/[module]-[revision]-[classifier].[ext]'
41
+ } else {
42
+ // When building locally we always use snapshot artifacts even if passing `-Dbuild.snapshot=false`.
43
+ // Release builds are always done with a local repo.
44
+ artifact ' /ml-cpp/[revision]-SNAPSHOT/downloads/ml-cpp/[module]-[revision]-SNAPSHOT-[classifier].[ext]'
45
+ }
46
+ }
27
47
}
28
48
}
29
49
}
30
- filter {
31
- includeGroup ' org.elasticsearch.ml'
32
- }
33
50
}
34
51
}
52
+
35
53
}
36
54
37
55
configurations {
@@ -112,4 +130,4 @@ tasks.named("dependencyLicenses").configure {
112
130
mapping from : / lucene-.*/ , to : ' lucene'
113
131
}
114
132
115
- addQaCheckDependencies(project)
133
+ addQaCheckDependencies(project)
0 commit comments