-
Notifications
You must be signed in to change notification settings - Fork 53
/
build.gradle
959 lines (865 loc) · 48.5 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// // A fork of https://github.com/wfhartford/gradle-dependency-analyze that works with Java 10
// classpath 'stroom:gradle-dependency-analyze:v2.2.6'
// The following are required to put JAXB on the Gradle classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
// Using beta versions of jaxb libs as they resolve the split pkg problem between jaxb-core and jaxb-runtime
//classpath 'javax.activation:activation:1.1.1'
//classpath 'javax.xml.bind:jaxb-api:2.3.1'
//classpath 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
}
}
plugins {
id 'java-library'
// Plugin for downloading content from the 'net
id "de.undercouch.download" version "4.1.2" apply false
// Plugin for producing a tree of task dependencies, run task 'taskTree'
id "com.dorongold.task-tree" version "1.3.1" apply true
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id 'nu.studer.jooq' version '8.2.1' apply false
id 'org.flywaydb.flyway' version '10.0.0' apply false
id 'org.kordamp.gradle.jdeps' version '0.16.0'
// id 'org.javamodularity.moduleplugin' version '1.8.10' apply false
// id "ca.cutterslade.analyze" version "1.4.3"
// id 'nebula.lint' version '10.4.2'
// id "com.vanniktech.dependency.graph.generator" version "0.5.0"
}
//wrapper {
// gradleVersion = '5.6.4'
//}
//apply plugin: 'ca.cutterslade.analyze'
apply plugin: 'de.undercouch.download'
//apply plugin: 'com.vanniktech.dependency.graph.generator'
ext.javaLanguageVersion = 21
// Adoptium also covers Temurin
ext.javaVendor = JvmVendorSpec.ADOPTIUM
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaLanguageVersion)
vendor = javaVendor
}
}
//if the project has a value for the passed property (i.e from the cmd line via -PpropName=xxx)
//use that, else use a default value
ext.getPropertyOrDefault = { propName, defaultValue ->
def val;
if (project.hasProperty(propName)
&& project.getProperty(propName) != "unspecified"
&& project.getProperty(propName) != "") {
val = project.getProperty(propName)
logger.info("Using property [$propName] with value [$val]")
} else {
val = defaultValue
logger.info("Property [$propName] has no value, using default value [$val]")
}
return val;
}
// Convert the abs root project dir into a string that can be used as a dir
// to allow us to have a dir for multiple repo instances that don't conflict
// e.g. 'home+dev+git_work+gchq+stroom'
ext.rootProjectAbsPathStr = project.rootProject.rootDir
.toPath()
.toAbsolutePath()
.toString()
.replaceAll("^/", "")
.replaceAll("/", "+");
ext.gwtCompilerProps = [
mainClass: 'stroom.gwt.GwtCompilerWrapper',
minHeap : getPropertyOrDefault('gwtCompilerMinHeap', '50M'),
maxHeap : getPropertyOrDefault('gwtCompilerMaxHeap', '4G'),
workers : getPropertyOrDefault('gwtCompilerWorkers', '5')
]
//version numbers for libs that share version numbers, e.g. dropwizard-*, or for github repo release versions
ext.versions = [
//----------Stroom-----------------
stroom : getPropertyOrDefault('version', 'SNAPSHOT').replaceFirst(/^v/, ""),
//------Stroom-repos---------------
// stroomProxyRepo: 'v5.1-beta.8',
eventLogging : '5.0-beta.31_schema-v4.0-beta.3',
hadoopCommonShaded: '2.6.4-9',
hadoopHdfsShaded : '2.6.4-7',
stroomStats : '1.0-alpha.6',
stroomTestData : '0.2.3',
// NOTE: Curator relies on zookeeper and we are pegged to zookeeper 3.4.5 server by the cloudera stack.
// Curator 4 can apparently work with zk 3.4.x as long as you exclude its zk dependency
// and explicitly add your own 3.4.x dependency. See https://curator.apache.org/zk-compatibility.html
// Also curator has a dependency on guava as it uses a handful of guava classes in its api. Its
// implementation relies on a shaded guava so you should be able to use any version of guava
// to satisfy the few classes used in the curator api, see https://issues.apache.org/jira/browse/CURATOR-200
// It is not clear whether a 3.4.x zk client (where x > 5) and a 3.4.5 zk server are compatible. Given that
// CHD6.1 ships with HBase 2.1 which uses a 3.4.10 zk client against a 3.4.5 server, we should be ok.
// If the version of curator is changed then this may need to be done in tandem with stroom-stats to ensure
// both sides' curator content in zk are compatible.
// For details of cloudera maven dependencies (i.e. hbase/zookeeper versions) see:
// 5.16.x - https://www.cloudera.com/documentation/enterprise/release-notes/topics/cdh_vd_cdh5_maven_repo_516x.html
// 6.1.x - https://www.cloudera.com/documentation/enterprise/6/release-notes/topics/rg_cdh_61_maven_artifacts.html
//------------3rd-party------------
aws : '2.20.157',
bnd : '7.0.0',
curator : '4.2.0', // Curator 4 works with ZK 3.4.x in soft compatibility mode, i.e. you must exlude its dep on ZK and explicitly add one for 3.4.x
dropwizard : '4.0.10', // used to set the dropwizard-bom version, that controls lots of dependency versions
elasticsearch : '8.11.2',
httpcore : '4.4.16', // Transient dependency of Elasticsearch
flyway : '10.0.0',
guice : '7.0.0',
gwt : '2.11.0',
jackson_swagger : '2.11.1', // Specific version of jackson for use with the swagger plugin
jmh : '1.37',
jooq : '3.18.7',
junit_jupiter : '5.10.1',
kafka : '3.6.0',
okhttp : '4.12.0',
poi : '5.2.4',
scylladb : '4.17.0.1',
simple_java_mail : '8.8.0',
swagger : '2.2.18',
unirest : '1.4.9',
zookeeper : '3.4.8', // Roughly pegged to the server version used by Cloudera, see links above. This version is forced below.
]
// Dependency strings for use in sub projects
// If the dependency version is controlled by a BOM, e.g. dropwizard-core, then the
// dependency is specified with no version. Use of the BOMs is configured further down,
// search for 'platform'.
// Any deps with the suffix '__gwt' are intended for use ONLY in GWT client side code, i.e. the
// -client modules. This is to allow GWT to use different versions of some libs to the server side.
ext.libs = [
//------Stroom-libs---------------
eventLogging : "uk.gov.gchq.eventlogging:event-logging:$versions.eventLogging",
hadoopCommonShaded : "uk.gov.gchq.stroom.hadoop.common:hadoop-common-shaded:$versions.hadoopCommonShaded",
hadoopHdfsShaded : "uk.gov.gchq.stroom.hadoop.hdfs:hadoop-hdfs-shaded:$versions.hadoopHdfsShaded",
stroomStatsSchema : "uk.gov.gchq.stroom.stats:stroom-stats-schema:$versions.stroomStats",
//------3rd Party-libs---------------
assertj_core : "org.assertj:assertj-core", // version controlled by dropwizard-dependencies
aws_bom : "software.amazon.awssdk:bom:$versions.aws",
aws_crt : "software.amazon.awssdk.crt:aws-crt:0.27.3",
aws_s3_transfer_manager : "software.amazon.awssdk:s3-transfer-manager", // version controlled by AWS BOM
aws_sqs : "software.amazon.awssdk:sqs", // version controlled by AWS BOM
aws_sts : "software.amazon.awssdk:sts", // version controlled by AWS BOM
bcrypt : 'de.svenkubiak:jBCrypt:0.4.1',
bouncy_castle : 'org.bouncycastle:bcprov-jdk18on:1.78.1',
caffeine : "com.github.ben-manes.caffeine:caffeine", // version controlled by dropwizard-dependencies
commons_beanutils : "commons-beanutils:commons-beanutils:1.9.4",
commons_codec : "commons-codec:commons-codec", // version controlled by dropwizard-dependencies
commons_compress : "org.apache.commons:commons-compress:1.27.1",
commons_csv : "org.apache.commons:commons-csv:1.10.0",
commons_fileupload : "org.apache.commons:commons-fileupload2-jakarta:2.0.0-M1",
commons_io : "commons-io:commons-io:2.15.0",
commons_lang : "org.apache.commons:commons-lang3", // version controlled by dropwizard-dependencies
commons_pool2 : "org.apache.commons:commons-pool2:2.12.0",
commons_text : "org.apache.commons:commons-text", // version controlled by dropwizard-dependencies
classgraph : "io.github.classgraph:classgraph:4.8.146",
curator_client : "org.apache.curator:curator-client:$versions.curator",
curator_framework : "org.apache.curator:curator-framework:$versions.curator",
curator_x_discovery : "org.apache.curator:curator-x-discovery:$versions.curator",
data_faker : "net.datafaker:datafaker:2.0.2",
dropwizard_assets : "io.dropwizard:dropwizard-assets", // version controlled by dropwizard-dependencies
dropwizard_auth : "io.dropwizard:dropwizard-auth", // version controlled by dropwizard-dependencies
dropwizard_bom : "io.dropwizard:dropwizard-bom:$versions.dropwizard",
dropwizard_dependencies : "io.dropwizard:dropwizard-dependencies:$versions.dropwizard",
dropwizard_client : "io.dropwizard:dropwizard-client", // version controlled by dropwizard-dependencies
dropwizard_configuration : "io.dropwizard:dropwizard-configuration", // version controlled by dropwizard-dependencies
dropwizard_core : "io.dropwizard:dropwizard-core",//files("libs/dropwizard-core-2.0.28.jar"),//"io.dropwizard:dropwizard-core", // version controlled by dropwizard-dependencies
dropwizard_jackson : "io.dropwizard:dropwizard-jackson", // version controlled by dropwizard-dependencies
dropwizard_jersey : "io.dropwizard:dropwizard-jersey", // version controlled by dropwizard-dependencies
dropwizard_jetty : "io.dropwizard:dropwizard-jetty", //was 1.0.6 now 1.1.0
dropwizard_lifecycle : "io.dropwizard:dropwizard-lifecycle", // version controlled by dropwizard-dependencies
dropwizard_metrics_annotation : "io.dropwizard.metrics:metrics-annotation", // version controlled by dropwizard-dependencies
dropwizard_metrics_core : "io.dropwizard.metrics:metrics-core", // version controlled by dropwizard-dependencies
dropwizard_metrics_healthchecks : "io.dropwizard.metrics:metrics-healthchecks", // version controlled by dropwizard-dependencies
dropwizard_servlets : "io.dropwizard:dropwizard-servlets", // version controlled by dropwizard-dependencies
dropwizard_testing : "io.dropwizard:dropwizard-testing", // version controlled by dropwizard-dependencies
dropwizard_validation : "io.dropwizard:dropwizard-validation", // version controlled by dropwizard-dependencies
//dropwizard_websockets : "com.liveperson:dropwizard-websockets:1.3.14",
eclipse_transformer_cli : "org.eclipse.transformer:org.eclipse.transformer.cli:0.5.0",
elasticsearch_java : "co.elastic.clients:elasticsearch-java:$versions.elasticsearch",
fast_infoset : "com.sun.xml.fastinfoset:FastInfoset:2.1.1",
flyway_core : "org.flywaydb:flyway-core:${versions.flyway}",
flyway_mysql : "org.flywaydb:flyway-mysql:${versions.flyway}",
gin : "com.google.gwt.inject:gin:2.1.2",
guava : "com.google.guava:guava", // version controlled by dropwizard-dependencies
guice__gwt : "com.google.inject:guice:3.0",
guice : "com.google.inject:guice:$versions.guice",
guice_assistedinject : "com.google.inject.extensions:guice-assistedinject:$versions.guice",
guice_extension : "name.falgout.jeffrey.testing.junit5:guice-extension:1.2.1",
guice_multibindings : "com.google.inject.extensions:guice-multibindings:$versions.guice",
guice_grapher : "com.google.inject.extensions:guice-grapher:$versions.guice",
gwt_dev : "org.gwtproject:gwt-dev:$versions.gwt",
gwt_user : "org.gwtproject:gwt-user:$versions.gwt",
gwtp_mvp_client : "com.gwtplatform:gwtp-mvp-client:0.7",
gson : 'com.google.code.gson:gson:2.6.2',
hbase : "org.apache.hbase:hbase-common:2.1.10", // should be set to be consistent with CDH version
hessian : "com.caucho:hessian:4.0.65",
hibernate_jpa : "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final", // remove when legacy code is removed
hikari : "com.zaxxer:HikariCP:5.1.0",
http_client : "org.apache.httpcomponents.client5:httpclient5", // version controlled by dropwizard-dependencies
httpcore : "org.apache.httpcomponents.core5:httpcore5:$versions.httpcore",
jBCrypt : "de.svenkubiak:jBCrypt:0.4.3",
jackson_annotations : "com.fasterxml.jackson.core:jackson-annotations", // version controlled by dropwizard-dependencies
//jackson_core : "com.fasterxml.jackson.core:jackson-core:2.9.10", // version controlled by dropwizard-dependencies
jackson_core : "com.fasterxml.jackson.core:jackson-core", // version controlled by dropwizard-dependencies
jackson_databind : "com.fasterxml.jackson.core:jackson-databind", // version controlled by dropwizard-dependencies // files('libs/jackson-databind-2.10.5.1.jar'),//
jackson_dataformat_yaml : "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", // version controlled by dropwizard-dependencies
jackson_datatype_jdk8 : "com.fasterxml.jackson.datatype:jackson-datatype-jdk8", // version controlled by dropwizard-dependencies
jackson_datatype_jsr310 : "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", // version controlled by dropwizard-dependencies
jakarta_activation : "jakarta.activation:jakarta.activation-api", // version controlled by dropwizard-dependencies
jakarta_annotation_api : "jakarta.annotation:jakarta.annotation-api", // version controlled by dropwizard-dependencies
jakarta_el : "org.glassfish:jakarta.el", // version controlled by dropwizard-dependencies
jakarta_json_api : "jakarta.json:jakarta.json-api:2.0.1",
jakarta_servlet_api : "jakarta.servlet:jakarta.servlet-api", // version controlled by dropwizard-dependencies
jakarta_validation_api : "jakarta.validation:jakarta.validation-api", // version controlled by dropwizard-dependencies
java_diff_utils : "io.github.java-diff-utils:java-diff-utils:4.11",
java_jwt : "com.auth0:java-jwt:4.4.0",
//javax_annotation_api : "javax.annotation:javax.annotation-api:1.3.2",
javassist : "org.javassist:javassist", // version controlled by dropwizard-dependencies
javax_inject__gwt : "javax.inject:javax.inject:1",
jakarta_inject : "jakarta.inject:jakarta.inject-api:2.0.1",
jaxb_api : "jakarta.xml.bind:jakarta.xml.bind-api:4.0.1",
jaxb_api__gwt : "javax.xml.bind:jaxb-api:2.3.1",//"jakarta.xml.bind:jakarta.xml.bind-api:3.0.1", // Using beta versions of jaxb libs as they resolve the split pkg problem between jaxb-core and jaxb-runtime
jaxb_impl : "com.sun.xml.bind:jaxb-impl:4.0.4",
//jaxb_impl__gwt : "org.glassfish.jaxb:jaxb-runtime:2.3.1",//"com.sun.xml.bind:jaxb-impl:3.0.2",
//jaxws_api : "javax.xml.ws:jaxws-api:2.2.6",
jcl_over_slf4j : "org.slf4j:jcl-over-slf4j", // version controlled by dropwizard-dependencies
jcommander : 'com.beust:jcommander:1.82',
jersey_client : "org.glassfish.jersey.core:jersey-client", // version controlled by dropwizard-dependencies
jersey_common : "org.glassfish.jersey.core:jersey-common", // version controlled by dropwizard-dependencies
jersey_server : "org.glassfish.jersey.core:jersey-server", // version controlled by dropwizard-dependencies
jersey_test_framework_grizzly2 : "org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2", // version controlled by dropwizard-dependencies
jetty_http : "org.eclipse.jetty:jetty-http", // version controlled by dropwizard-dependencies
jetty_server : "org.eclipse.jetty:jetty-server", // version controlled by dropwizard-dependencies
jetty_servlet : "org.eclipse.jetty:jetty-servlet", // version controlled by dropwizard-dependencies
jetty_servlets : "org.eclipse.jetty:jetty-servlets", // version controlled by dropwizard-dependencies
jgit : "org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r",
jinjava : "com.hubspot.jinjava:jinjava:2.7.2",
jmh_core : "org.openjdk.jmh:jmh-core:$versions.jmh",
jmh_generator_annprocess : "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh",
jooq : "org.jooq:jooq:$versions.jooq",
jooq_codegen : "org.jooq:jooq-codegen:$versions.jooq",
jooq_meta : "org.jooq:jooq-meta:$versions.jooq",
jose4j : "org.bitbucket.b_c:jose4j:0.9.3",
// jsr173_api : "javax.xml.bind:jsr173_api:1.0",
jul_to_slf4j : "org.slf4j:jul-to-slf4j", // version controlled by dropwizard-dependencies
junit_bom : "org.junit:junit-bom:$versions.junit_jupiter",
junit_jupiter_api : "org.junit.jupiter:junit-jupiter-api", // version controlled by junit-bom
junit_jupiter_engine : "org.junit.jupiter:junit-jupiter-engine", // version controlled by junit-bom
junit_jupiter_params : "org.junit.jupiter:junit-jupiter-params", // version controlled by junit-bom
junit_platform_launcher : "org.junit.platform:junit-platform-launcher", // version controlled by junit-bom
kafka_clients : "org.apache.kafka:kafka-clients:$versions.kafka", // version controlled by junit-bom
kryo : "com.esotericsoftware:kryo:5.5.0",
// lmdbjava 0.8.3 causes FFI errors on centos7 due to glibc version
// See https://github.com/gchq/stroom/issues/3485 & https://github.com/gchq/stroom/issues/4133
// Potentially caused by https://github.com/jnr/jffi/issues/138 and fixable with a jnr-ffi uplift in lmdbjava
// lmdbjava 0.9.0 has a cursor bug though, https://github.com/lmdbjava/lmdbjava/issues/228
lmdbjava : "org.lmdbjava:lmdbjava:0.8.2",
// This is the bridge from log4j v1 to slf4j
log4j_over_slf4j : "org.slf4j:log4j-over-slf4j", // version controlled by dropwizard-dependencies
// This is the bridge from log4j v2 to slf4j
//log4j_slf4j2_impl : "org.apache.logging.log4j:log4j-slf4j2-impl:2.24.1",
logback_classic : "ch.qos.logback:logback-classic", // version controlled by dropwizard-dependencies
logback_core : "ch.qos.logback:logback-core", // version controlled by dropwizard-dependencies
mbknor_jackson_jsonSchema : "com.kjetland:mbknor-jackson-jsonschema_2.12:1.0.36",
mockito_core : "org.mockito:mockito-core", // version controlled by dropwizard-dependencies
mockito_junit_jupiter : "org.mockito:mockito-junit-jupiter", // version controlled by dropwizard-dependencies
mysql_connector_java : "mysql:mysql-connector-java:8.0.33",
okhttp : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
okhttp_logging_interceptor : "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}",
poi : "org.apache.poi:poi:${versions.poi}",
poi_ooxml : "org.apache.poi:poi-ooxml:${versions.poi}",
quartz : "org.quartz-scheduler:quartz:2.5.0-rc1",
restygwt : "org.fusesource.restygwt:restygwt:2.2.7",
saxon_he : "net.sf.saxon:Saxon-HE:9.9.1-8",
scylladb_driver_core : "com.scylladb:java-driver-core:${versions.scylladb}",
scylladb_query_builder : "com.scylladb:java-driver-query-builder:${versions.scylladb}",
scylladb_driver_mapper : "com.scylladb:java-driver-mapper-runtime:${versions.scylladb}",
simple_java_mail : "org.simplejavamail:simple-java-mail:${versions.simple_java_mail}",
simple_java_mail_batch_module : "org.simplejavamail:batch-module:${versions.simple_java_mail}",
slf4j_api : "org.slf4j:slf4j-api", // version controlled by dropwizard-dependencies
snake_yaml : "org.yaml:snakeyaml:2.3",
solrj : "org.apache.solr:solr-solrj:8.2.0",
sqlite : "org.xerial:sqlite-jdbc:3.43.2.2",
stax_api : "stax:stax-api:1.0.1",
swagger_annotations : "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger",
swagger_core : "io.swagger.core.v3:swagger-core-jakarta:$versions.swagger",
swagger_jaxrs : "io.swagger.core.v3:swagger-jaxrs2-jakarta:$versions.swagger",
unirest : "com.mashape.unirest:unirest-java:$versions.unirest",
vavr : "io.vavr:vavr:0.10.4",
wiremock : 'org.wiremock:wiremock:3.3.1',
wix_embedded_mysql : "com.wix:wix-embedded-mysql:4.6.2",
ws_rs_api : "jakarta.ws.rs:jakarta.ws.rs-api", // version controlled by dropwizard-dependencies
ws_rs_api__gwt : "javax.ws.rs:javax.ws.rs-api:2.1.1", // For GWT compilation
xerces : "xerces:xercesImpl:2.12.2",
//xml_apis : "xml-apis:xml-apis:2.0.2",
zero_allocation_hashing : "net.openhft:zero-allocation-hashing:0.16",
zookeeper : "org.apache.zookeeper:zookeeper:$versions.zookeeper",
]
// Defines the content packs that will be donwloaded/copied for SetupSampleData,
// docker builds and zip distributions
def contentPackDefinitionFile = "content-packs.json"
ext.contentPackDefinitionFile = contentPackDefinitionFile
// Directory potentially shared with other stroom version builds to hold the immutable downloaded
// content pack zips. Packs will be downloaded to here if they don't exist or copied if they do.
def contentPackDownloadDir = "${System.properties['user.home']}/.stroom/contentPackDownload"
ext.contentPackDownloadDir = contentPackDownloadDir
//defines a list of gradle projects that we will publish with maven
def projectsToBePublished = subprojects.findAll { project ->
project.path in [
// TODO add in query and expression so others can use them
//':stroom-util',
//':stroom-util-shared',
]
}
//list to hold details of any failed test classes
def failedTestReportFiles = []
//Configuration applicable to all projects
allprojects {
// Make doclint be quiet - we don't care about JavaDoc warnings.
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addBooleanOption('html5', true)
}
}
// Variable to capture the version of slf4j defined in the dropwizard-dependencies, so
// we can use it to set the version of slf4j when we do a dependency
// substitution with log4j
def dropwizardBomSlf4jVersion = null
//Configuration applicable to all sub projects
subprojects {
//println "Configuring subproject ${project.name}"
apply plugin: 'java-library'
apply plugin: 'checkstyle'
apply plugin: 'idea'
// apply plugin: "org.javamodularity.moduleplugin"
// apply plugin: 'org.kordamp.gradle.jdeps'
// apply plugin: 'ca.cutterslade.analyze'
// apply plugin: 'nebula.lint'
//
// gradleLint {
// rules += 'unused-dependency'
//// rules += 'all-dependency'
// }
// This bit makes all sub projects have access to the BOMs for the dependency versions
dependencies {
implementation platform(libs.dropwizard_dependencies)
implementation platform(libs.dropwizard_bom)
implementation platform(libs.aws_bom)
}
//println project.getConfigurations().getByName("implementation").getAllDependencies()
configurations {
// ensure deps don't bring any logging implementations with them as this will
// conflict with logback. Also replace any log4j deps with log4j-over-slf4j
// so dependency jars work with slf4j
all {
// dropwizard-dependencies comes with junit 4 which we don't want
exclude group: "junit", module: "junit"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "log4j", module: "log4j"
exclude group: "commons-logging", module: "commons-logging"
// exclude group: "javax.validation", module: "validation-api"
resolutionStrategy {
// A very hacky way of finding out what version of slf4j is in the dropwizard BOM
// TODO make it less hacky
if (dropwizardBomSlf4jVersion == null) {
eachDependency { DependencyResolveDetails details ->
if (dropwizardBomSlf4jVersion == null) {
if (details.requested.group == 'org.slf4j' && details.requested.name == "log4j-over-slf4j") {
//if (details.requested.group == 'org.slf4j') {
dropwizardBomSlf4jVersion = details.getTarget().getVersion()
logger.info("Slf4j version = $dropwizardBomSlf4jVersion ${details.requested}")
}
}
}
}
dependencySubstitution {
//println "Slf4j version = $dropwizardBomSlf4jVersion"
//substitute module('aopalliance:aopalliance') using module("org.glassfish.hk2.external:aopalliance-repackaged:3.0.5")
//substitute module('com.fasterxml.jackson.datatype:jackson-datatype-joda') using module("com.fasterxml.jackson.datatype:jackson-datatype-joda:2.13.1")
//substitute module("com.fasterxml.jackson.core:jackson-databind") using module('com.fasterxml.jackson.core:jackson-databind:2.10.5.1') withoutClassifier()
substitute module('com.google.code.findbugs:jsr305') using module("javax.annotation:javax.annotation-api:1.3.2")
// substitute module("io.dropwizard:dropwizard-core") using files("libs/dropwizard-core-2.0.28.jar")
//substitute module('javax.inject:javax.inject') using module('org.glassfish.hk2.external:jakarta.inject:2.6.1')
//substitute module('javax.inject:javax.inject') using module('org.glassfish.hk2.external:jakarta.inject:2.6.1')
//substitute module('javax.activation:javax.activation-api') using module('jakarta.activation:jakarta.activation-api:1.2.2')
//substitute module('jakarta.activation:jakarta.activation-api') using module('javax.activation:javax.activation-api:1.2.0')
//substitute module('javax.activation:activation') using module('javax.activation:javax.activation-api:1.2.0')
//substitute module('log4j:log4j') using module("org.slf4j:log4j-over-slf4j:1.7.25")
substitute module('log4j:log4j') using module("org.slf4j:log4j-over-slf4j:$dropwizardBomSlf4jVersion")
// These three are a fudge. We should get it from the dropwiz bom but dropwizard-jersey pulls in 2.33 and metrics-jersey pulls in 2.35. IJ seems to get confused and put both on the classpath. See dependencySubstitution below.
//substitute module('org.glassfish.jersey.core:jersey-common') using module("org.glassfish.jersey.core:jersey-common:$versions.jersey")
//substitute module('org.glassfish.jersey.core:jersey-server') using module("org.glassfish.jersey.core:jersey-server:$versions.jersey")
//substitute module('org.glassfish.jersey.core:jersey-client') using module("org.glassfish.jersey.core:jersey-client:$versions.jersey")
}
// Stop stroom libs from dragging in a different version of dropwizard
// Currently commented out in the hope the dropwiz BOM will solve things
//eachDependency { DependencyResolveDetails details ->
//if (details.requested.group == 'io.dropwizard') {
//details.useVersion versions.dropwizard
//}
//if (details.requested.group == 'io.dropwizard.metrics') {
//details.useVersion versions.dropwizard_metrics
//}
//}
forcedModules = [
// This is how to force a dep to a specific version
//libs.xerces,
// Curator will drag in a more recent version of zk but will support older versions so
// substitute it here. See NOTE in versions block above.
libs.zookeeper
]
}
}
}
repositories {
mavenLocal()
mavenCentral()
}
test {
useJUnitPlatform()
// set heap size for the test JVM(s)
// minHeapSize = "128m"
// maxHeapSize = "8G"
// Run test classes in N different JVMs
// The internet seems to suggest the divide by 2, not sure why, maybe
// not to exhaust all cores. Removing it doesn't seem to speed it up.
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// maxParallelForks = Runtime.runtime.availableProcessors() ?: 1
beforeSuite { descriptor ->
if (descriptor?.className?.trim())
println "Executing test class ${descriptor.className}"
}
beforeTest { descriptor ->
if (descriptor.className == "stroom.search.impl.TestSearchResultCreation") {
println " Executing test ${descriptor.className}.${descriptor.name}"
}
}
// Report duration of tests that take over 1s
afterTest { descriptor, result ->
def durationSecs = (result.endTime - result.startTime) / 1000
if (durationSecs > 1) {
println " Test ${descriptor.className}.${descriptor.name}, took longer than 1s, result: ${result.resultType}, duration: ${durationSecs}s"
}
}
reports.html.outputLocation = file("${reporting.baseDir}/${name}")
afterSuite { descriptor, result ->
if (descriptor != null
&& descriptor.className != null
&& result.resultType.toString() == "FAILURE") {
// test class failed so add its project info and test report file to a global list for
// processing at the end of the build
def reportFileName = "${reports.junitXml.outputLocation}/TEST-${descriptor.className}.xml"
def reportFile = file(reportFileName)
def pair = new Tuple2("${project.name} ${descriptor.name}", reportFile)
failedTestReportFiles.add(pair)
}
}
// Use full logging for test exceptions so we can see where the failure occurred
testLogging {
events "failed"
exceptionFormat = 'full'
showStackTraces = true
}
}
clean {
// clear out the 'out' dirs used by intelliJ
delete "out"
}
tasks.register('allDeps', DependencyReportTask) {}
tasks.register('allDepInsight', DependencyInsightReportTask) {}
// // These lines pull the integration test task into our build process.
// tasks.check.dependsOn integrationTest
// tasks.integrationTest.mustRunAfter test
afterEvaluate {
// repositories {
// }
//
// compileJava {
// inputs.property("moduleName", moduleName)
// doFirst {
// options.compilerArgs = [
// '--module-path', classpath.asPath,
// ]
// classpath = files()
// }
// }
//
// compileTestJava {
// inputs.property("moduleName", moduleName)
// doFirst {
// options.compilerArgs = [
// '--module-path', classpath.asPath,
//// '--add-modules', 'junit',
//// '--add-reads', "$moduleName=junit",
// '--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
// ]
// classpath = files()
// }
// }
//
// compileTestJava {
// inputs.property("moduleName", moduleName)
// doFirst {
// options.compilerArgs = [
// '--module-path', classpath.asPath,
//// '--add-modules', 'ALL-MODULE-PATH',
// '--add-modules', 'org.junit.jupiter.api', // junit5 automatic module specific
// '--add-modules', 'java.xml.bind', // jaxb specific
// '--add-reads', "$moduleName=org.junit.jupiter.api", // allow junit to read your module
//// '--add-modules', 'joda.time',
//// '--add-reads', "$moduleName=joda.time",
//// '--add-reads', "$moduleName=junit",
//// '--add-opens', 'java.base/java.nio=ALL-UNNAMED',
//// '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED',
// '--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath, // add test source files to your module
//
// ]
// classpath = files()
// }
// }
test {
// modularity.inferModulePath = false
//// inputs.property("moduleName", moduleName)
doFirst {
// We have to alter the existing jvm args rather than set them so that we don't lose debug args added by
// IJ Idea.
def jvmArgsCopy = []
for (arg in jvmArgs) {
jvmArgsCopy.add(arg)
}
jvmArgsCopy.add("--add-opens")
jvmArgsCopy.add("java.base/java.nio=ALL-UNNAMED")
jvmArgsCopy.add("--add-opens")
jvmArgsCopy.add("java.base/sun.nio.ch=ALL-UNNAMED")
jvmArgs = jvmArgsCopy
// jvmArgs = [
////// '--module-path', classpath.asPath,
////// '--add-modules', 'ALL-MODULE-PATH',
////// '--add-modules', 'org.junit.jupiter.api', // junit5 automatic module specific
////// '--add-modules', 'java.xml.bind', // jaxb specific
////// '--add-modules', 'org.jvnet.staxex',
////// '--add-modules', 'org.joda.time', // joda time specific
////// '--add-reads', "$moduleName=org.junit.jupiter.api", // allow junit to read your module
////// '--add-modules', 'joda.time',
////// '--add-modules', 'java.activation',
////// '--add-reads', "$moduleName=junit",
// '--add-opens', 'java.base/java.nio=ALL-UNNAMED', // needed for LMDB
// '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', // needed for LMDB
////// '--patch-module', "dropwizard.core=" + libs.dropwizard_core ,
////// '--patch-module', "dropwizard.validation=" + libs.dropwizard_validation ,
//// //'--patch-module', "java.xml=javax.xml.bind:jsr173_api:1.0" ,
////// '--patch-module', "java.activation=" + libs.jakarta_activation ,
////// '--patch-module', "java.annotation=" + libs.jakarta_annotation_api ,
////// '--patch-module', "$moduleName=" + files(sourceSets.test.java.classesDirectory).asPath,
////// '--patch-module', "$moduleName=" + libs.dropwizard_validation,
////// '-verbose', '',
//// '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005', '',
//// '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005', '',
// ]
}
}
//
// java {
// modularity.inferModulePath = false
// }
//
// tasks.named('compileJava') {
// modularity.inferModulePath = false
// }
//
// tasks.named('compileTestJava') {
// modularity.inferModulePath = false
// }
javadoc {
options.addStringOption('-module-path', classpath.asPath)
options.addStringOption('Xdoclint:all,-missing', '-html5')
}
jar {
inputs.property("moduleName", moduleName)
manifest {
attributes(
"Automatic-Module-Name": moduleName,
)
}
}
jdepsReport {
multiRelease = '15'
}
}
//task analyzeJavaLibraryDependencies(type: ca.cutterslade.gradle.analyze.AnalyzeDependenciesTask) {
// classesDirs = sourceSets.main.output.classesDirs
// require = [
// project.configurations.runtimeClasspath
// ]
// allowedToDeclare = [
// project.configurations.permitUnusedDeclared
// ]
// justWarn = true
//}
//task analyzeJavaLibraryTestDependencies(type: ca.cutterslade.gradle.analyze.AnalyzeDependenciesTask) {
// classesDirs = sourceSets.test.output.classesDirs
// require = [
// project.configurations.testRuntimeClasspath
// ]
// allowedToDeclare = [
// project.configurations.permitTestUnusedDeclared
// ]
// allowedToUse = [
// project.configurations.runtimeClasspath
// ]
// justWarn = true
//}
//tasks.build.dependsOn analyzeJavaLibraryDependencies
//tasks.build.dependsOn analyzeJavaLibraryTestDependencies
//
// analyzeClassesDependencies {
// justWarn = true
// }
//
// analyzeTestClassesDependencies {
// justWarn = true
// }
// Check style plugin configuration
// config files in config/checkstyle
checkstyle {
ignoreFailures false
showViolations true
toolVersion = "10.4"
}
// These work in tandem with the suppression.xml
tasks.withType(Checkstyle).tap {
configureEach {
include("**/stroom/**/*.java")
exclude("**/db/jooq/**/*.java")
}
}
}
// configures only those projects in publishedProjectsPaths
configure(projectsToBePublished) {
println "Configuring ${project.name} for publishing"
apply plugin: 'maven-publish'
group = 'stroom'
version = versions.stroom
tasks.register('sourcesJar', Jar) {
dependsOn classes
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn javadoc
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
scm {
url "https://github.com/stroom/stroom"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.children().last() + pomConfig
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
////configuration specific to projects that expose their test jars for other projects to use
//configure(projectsWithSharedTestJars) {
//
// println "Configuring ${project.path} to expose its test jars"
//
// configurations {
// testArtifacts
// }
//
// task testJar(type: Jar) {
// baseName = "${project.name}-test"
// from sourceSets.test.output
// }
//
// artifacts {
// testArtifacts testJar
// }
//
// task packageTests(type: Jar) {
// from sourceSets.test.output
// classifier = 'tests'
// }
//
// artifacts.archives packageTests
//}
//task clearContentPackDownloadDir(type: Delete) {
//doLast {
//println "Clearing ${contentPackDownloadDir}"
//def downloadDir = Paths.get(contentPackDownloadDir)
//if (Files.exists(downloadDir)) {
//// Cleans out any zip files in the contentPackDownloadDir
//delete fileTree(downloadDir) {
//include '**/*.zip'
//}
//}
//}
//}
//task clearContentPackImportDir(type: Delete) {
//doLast {
//println "Clearing ${contentPackImportDir}"
//def importDir = Paths.get(contentPackImportDir)
//if (Files.exists(importDir)) {
//// Cleans out any zip files in the contentPackImportDir
//delete fileTree(importDir) {
//include '**/*.zip'
//}
//}
//}
//}
//task downloadStroomContent() {
//dependsOn ':stroom-app:downloadStroomContentApp'
//}
//task downloadStroomContent() {
// doLast {
// println "Downloading content packs to ${contentPackDownloadDir}"
// def downloadDir = Paths.get(contentPackDownloadDir)
// def importDir = Paths.get(contentPackImportDir)
//
// Files.createDirectories(downloadDir)
// Files.createDirectories(importDir)
//
// def downloadPack = { url ->
// String filename = Paths.get(new URI(url).getPath()).getFileName().toString()
// def downloadFile = downloadDir.resolve(filename)
// def importFile = importDir.resolve(filename)
// if (Files.exists(downloadFile)) {
// println "${url} has already been downloaded"
// } else {
// println "Downloading ${url} into ${contentPackDownloadDir}"
// download {
// src url
// dest downloadDir.toFile()
// overwrite true
// }
// }
//
// if (!Files.exists(importFile)) {
// copy {
// println "Copying from ${downloadFile} to ${importFile}"
// from downloadFile.toFile()
// into contentPackImportDir
// }
// }
// }
//
// // Download each content pack to the contentPackImportDir ready for stroom to import on startup
// for (pack in contentPacks) {
// def packName = pack.key
// def packVer = pack.value
// def packUrl = "${contentReleasesUrl}${packName}-${packVer}/${packName}-${packVer}.zip"
//
// downloadPack packUrl
//
// }
// // Now get the visualisations pack from a different repo
// downloadPack visualisationsContentPackUrl
// }
//}
tasks.register('setupSampleData') {
// dependsOn downloadStroomContent
dependsOn ':stroom-app:setupSampleDataApplication'
}
gradle.buildFinished {
//if any of the tests failed dump the junit xml to the console
if (getPropertyOrDefault('dumpFailedTestXml', 'false') == 'true' && failedTestReportFiles.size() > 0) {
println "Build has ${failedTestReportFiles.size()} failed test classes, dumping JUnit xml output"
failedTestReportFiles.each { pair ->
def info = pair.first
def reportFile = pair.second
if (reportFile.exists()) {
println "-----Failed test class ${info} ------------------"
def lines = reportFile.readLines()
lines.each { String line ->
println "${line}"
}
println "-----End of test class ${info} ------------------"
} else {
println "File ${reportFile.toString()}"
}
}
}
}
tasks.register('dependenciesPng') {
def reportsDir = new File("build/reports")
def compileDepsDot = file("$reportsDir/compileDeps.dot")
inputs.files subprojects.configurations.implementation
outputs.files compileDepsDot
doFirst {
if (!reportsDir.exists()) reportsDir.mkdirs()
}
doLast {
def dotGraph = "digraph compile{" + System.getProperty("line.separator")
Set deps = [] as Set
subprojects.each { subproject ->
subproject.configurations.compile.dependencies.each { dependency ->
if (dependency instanceof ProjectDependency) {
String dep = "\"$subproject.name\" -> \"$dependency.name\";"
if (deps.add(dep)) { // if was not there before - avoid duplicates
dotGraph += dep + System.getProperty("line.separator")
}
}
}
}
dotGraph += "}"
compileDepsDot.write(dotGraph)
}
}
//task clean() {
////dependsOn clearContentPackImportDir
//dependsOn clearContentPackDownloadDir
//}
// Accept the T&Cs for publishing build scans
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
//import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorPlugin
//import com.vanniktech.dependency.graph.generator.DependencyGraphGeneratorExtension.Generator
//import guru.nidi.graphviz.attribute.Color
//import guru.nidi.graphviz.attribute.Style
//
//plugins.apply(DependencyGraphGeneratorPlugin)
//
//def stroomGenerator = new Generator(
// "stroomLibraries", // Suffix for our Gradle task.
// { dependency -> dependency.getModuleGroup().startsWith("stroom") }, // Only want stroom.
// { dependency -> false }, // Include transitive dependencies.
// { node, dependency -> node.add(Style.FILLED, Color.rgb("#ff6f00")) }, // Give them some stroom color.
//)
//
//dependencyGraphGenerator {
// generators = [ stroomGenerator ]
//}