1
1
/*
2
- * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License").
5
5
* You may not use this file except in compliance with the License.
16
16
buildscript {
17
17
ext {
18
18
es_group = " org.elasticsearch"
19
- es_version = ' 7.6.1 '
19
+ es_version = ' 7.7.0 '
20
20
}
21
21
22
22
repositories {
@@ -31,9 +31,10 @@ buildscript {
31
31
}
32
32
33
33
plugins {
34
- id ' nebula.ospackage' version " 8.2 .0" apply false
34
+ id ' nebula.ospackage' version " 8.3 .0" apply false
35
35
id " com.diffplug.gradle.spotless" version " 3.26.1"
36
36
id ' java-library'
37
+ id ' checkstyle'
37
38
}
38
39
39
40
repositories {
@@ -43,7 +44,7 @@ repositories {
43
44
}
44
45
45
46
ext {
46
- opendistroVersion = ' 1.7 .0'
47
+ opendistroVersion = ' 1.8 .0'
47
48
isSnapshot = " true" == System . getProperty(" build.snapshot" , " true" )
48
49
}
49
50
@@ -165,6 +166,30 @@ testClusters.integTest {
165
166
}
166
167
}
167
168
plugin(fileTree(" src/test/resources/job-scheduler" ). getSingleFile())
169
+
170
+ // As of ES 7.7.0 the opendistro-anomaly-detection plugin is being added to the list of plugins for the testCluster during build before
171
+ // the opendistro-job-scheduler plugin, which is causing build failures. From the stack trace, this looks like a bug.
172
+ //
173
+ // Exception in thread "main" java.lang.IllegalArgumentException: Missing plugin [opendistro-job-scheduler], dependency of [opendistro-anomaly-detection]
174
+ // at org.elasticsearch.plugins.PluginsService.addSortedBundle(PluginsService.java:452)
175
+ //
176
+ // One explanation is that ES build script sort plugins according to the natural ordering of their names.
177
+ // opendistro-anomaly-detection comes before opendistro-job-scheduler.
178
+ //
179
+ // The following is a comparison of different plugin installation order:
180
+ // Before 7.7:
181
+ // ./bin/elasticsearch-plugin install --batch file:opendistro-anomaly-detection.zip file:opendistro-job-scheduler.zip
182
+ //
183
+ // After 7.7:
184
+ // ./bin/elasticsearch-plugin install --batch file:opendistro-job-scheduler.zip file:opendistro-anomaly-detection.zip
185
+ //
186
+ // A temporary hack is to reorder the plugins list after evaluation but prior to task execution when the plugins are installed.
187
+ nodes. each { node ->
188
+ def plugins = node. plugins
189
+ def firstPlugin = plugins. get(0 )
190
+ plugins. remove(0 )
191
+ plugins. add(firstPlugin)
192
+ }
168
193
}
169
194
170
195
run {
@@ -242,6 +267,10 @@ jacocoTestCoverageVerification {
242
267
check. dependsOn jacocoTestCoverageVerification
243
268
jacocoTestCoverageVerification. dependsOn jacocoTestReport
244
269
270
+ checkstyle {
271
+ toolVersion = ' 8.20'
272
+ }
273
+
245
274
dependencies {
246
275
compile " org.elasticsearch:elasticsearch:${ es_version} "
247
276
compileOnly " org.elasticsearch.plugin:elasticsearch-scripting-painless-spi:${ versions.elasticsearch} "
@@ -254,10 +283,10 @@ dependencies {
254
283
compile group : ' com.yahoo.datasketches' , name : ' memory' , version : ' 0.12.2'
255
284
compile group : ' commons-lang' , name : ' commons-lang' , version : ' 2.6'
256
285
257
- compile " org.jacoco:org.jacoco.agent:0.8.3 "
258
- compile " org.jacoco:org.jacoco.ant:0.8.3 "
259
- compile " org.jacoco:org.jacoco.core:0.8.3 "
260
- compile " org.jacoco:org.jacoco.report:0.8.3 "
286
+ compile " org.jacoco:org.jacoco.agent:0.8.5 "
287
+ compile " org.jacoco:org.jacoco.ant:0.8.5 "
288
+ compile " org.jacoco:org.jacoco.core:0.8.5 "
289
+ compile " org.jacoco:org.jacoco.report:0.8.5 "
261
290
262
291
testCompile group : ' pl.pragmatists' , name : ' JUnitParams' , version : ' 1.1.1'
263
292
testImplementation group : ' org.mockito' , name : ' mockito-core' , version : ' 3.0.0'
0 commit comments