-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
1084 lines (919 loc) · 33.6 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
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
buildscript {
repositories {
maven { // wetransform artifactory
url 'https://artifactory.wetransform.to/artifactory/libs-release/'
}
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.standardout:gradle-include-plugin:0.2.0'
classpath 'org.standardout:bnd-platform:3.0.0-SNAPSHOT'
classpath 'zipdiff:zipdiff:0.4'
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:6.3.0"
}
configurations.all {
// ensure SNAPSHOTs are updated every time if needed
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
apply plugin: 'eclipse'
apply plugin: 'org.standardout.bnd-platform'
apply plugin: 'org.standardout.include'
defaultTasks 'clean', 'updateSiteZip'
repositories {
maven { // wetransform artifactory
url 'https://artifactory.wetransform.to/artifactory/libs-release/'
}
mavenCentral()
maven { // XXX Snapshot artifacts (remove for release)
url 'https://artifactory.wetransform.to/artifactory/libs-snapshot/'
}
}
// platform version
version = '5.0.0'
ext {
geotoolsVersion = '29.1'
wicketVersion = '6.10.0'
}
include {
// shared modules
from 'modules/shared/default.gradle'
from 'modules/shared/adaptions' // all adaptions
from('modules/geotools.gradle') {
geotools geotoolsVersion, [
'geotools',
'gt-cql',
'gt-epsg-hsql',
'gt-geojson',
// 'gt-geometry',
'gt-main',
'gt-shapefile',
'gt-render',
'gt-wfs-ng'
]
// additional bundles are defined later
}
from('modules/shared/spring.gradle') {
def v = '5.2.0.RELEASE'
spring v, [
'spring-beans',
'spring-context',
'spring-context-support',
'spring-web',
'spring-webmvc'
]
security v, [
'spring-security-core',
'spring-security-config',
'spring-security-web',
'spring-security-cas',
'spring-security-openid',
'spring-security-ldap'
]
}
from('modules/logging.gradle') {
slf4jAndLogback '1.7.36', '1.2.12'
}
from 'modules/shared/orientdb.gradle', {
orientGraphDB '1.5.1'
}
from 'modules/shared/poi.gradle', {
poi('5.2.3', '4.1.2')
}
from('modules/shared/postgis.gradle') {
postgis(
'2.3.0', // PostGIS driver version
'42.2.8', // PostgreSQL driver version
[
// buddies
'eu.esdihumboldt.hale.io.jdbc',
'net.sourceforge.schemacrawler'
]
)
}
from 'modules/shared/gemini-blueprint.gradle'
from('modules/shared/wicket.gradle') {
wicket(wicketVersion, [
'wicket-core',
'wicket-request',
'wicket-util',
'wicket-spring',
'wicket-extensions'
])
}
// TopoJSON support
from 'modules/topojson-j.gradle'
// ensures that always a fixed version of groovy-all is used as groovy dependency
from 'modules/shared/groovy.gradle', {
//XXX custom name is required w/ indy - problem is that Gradle still adds the normal groovy-all dependency
groovyAll '2.5.19', true, 'groovy', false
}
// HALE specific modules
from 'modules/schemacrawler.gradle'
from 'modules/groovy-sandbox'
from 'modules/zest' // Zest 2 Snapshot - TODO instead use official release
from 'modules/wicket-bootstrap'
from 'modules/slf4jplus-config'
// CS3D dependencies for Styled Map View
from 'modules/cs3d-map'
// support bundles for jetty 8/9
from 'modules/jetty-support'
// MSSQL driver for Hale
from 'modules/mssql-support'
// SKOS api
from 'modules/skos-support'
from('modules/deegree') {
deegree('3.4.13')
}
}
configurations {
// exclude bundles conflicting with JRE-provided packages
bndplatform.exclude group: 'javax.xml'
bndplatform.exclude group: 'javax.activation'
bndplatform.exclude group: 'xml-apis'
bndplatform.exclude group: 'dom4j'
bndplatform.exclude group: 'stax'
bndplatform.exclude group: 'org.w3c.dom'
bndplatform.exclude group: 'org.apache.batik'
bndplatform.exclude group: 'org.codehaus.woodstox'
//org.apache.geronimo.specs.geronimo-stax-api_1.0_spec
bndplatform.exclude group: 'org.apache.geronimo.specs'
/*
* They have to be excluded as just removing the version constraint on
* corresponding package imports is not enough - bundles that only have
* optional imports may still bind to them, as they have no explicit
* dependency on the system bundle.
*/
// fix OrientDB 1.5.1 dependenies (which were manually added to the artifactory)
// the original verions are snapshots that no longer work with OrientDB 1.5.1
bndplatform {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (
(details.requested.group == 'com.tinkerpop.blueprints' &&
(details.requested.name == 'blueprints-core' || details.requested.name == 'blueprints-orient-graph')) ||
(details.requested.group == 'com.tinkerpop.gremlin' &&
(details.requested.name == 'gremlin-groovy' || details.requested.name == 'gremlin-java')) ||
(details.requested.group == 'com.tinkerpop' && details.requested.name == 'pipes')
) {
// use custom version
details.useVersion '2.5.0-orientDB151'
}
}
// sshj: group name changed to com.hieronymous from net.schmizz (from version 11.0)
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'sshj' && details.requested.group == 'net.schmizz') {
details.useTarget "com.hierynomus:sshj:${details.requested.version}"
}
}
// activate dependency locking for generating a lockfile for security scanning
resolutionStrategy.activateDependencyLocking()
}
}
platform {
fetchSources = true
determineImportVersions = true
addBndPlatformManifestHeaders = true
auxVersionedSymbolicNames = true
featureId = 'eu.esdihumboldt.hale.platform'
featureName = 'HALE Target Platform Libraries'
hashQualifierMap = file('version-history.json')
defaultQualifierMap.baseDate = DAY // to have a rather short default length, that seldom has to be exceeded
// uncomment and update with eclipse directory only during development
// eclipseHome = new File('/Users/kapil/eclipse/eclipse-4.24-rcp-for-hale-studio-java17/Eclipse-for-hale-studio-5.0.0.app/Contents/Eclipse')
// eclipseHome = new File('C:/Users/EmanuelaEpure/Downloads/eclipse-rcp-2022-06-R-win32-x86_64/eclipse')
// override behavior for all bundles to prevent package uses conflicts for packages provided by the JRE
override {
// ensure javax.annotation imports are w/o version
prependImport('javax.annotation.*')
prependImport('org.apache.commons.logging.*')
optionalImport(
// no version requirement for certain JRE provided packages
// use wildcards to not enforce imports
// use optional imports as otherwise we suddenly get errors in Eclipse while resolving seemingly random optional(!) package imports
'javax.xml.*',
'org.w3c.dom.*',
'org.xml.sax.*',
'javax.activation.*',
'com.sun.xml.internal.*',
'sun.nio.*',
// cal10n.api
'javax.tools.*',
'javax.lang.model.*',
'javax.annotation.processing.*',
// also make JUnit optional everywhere - so we can exclude it from products
'junit.framework.*',
'org.junit.*',
'xml-apis.*',
'jakarta.xml.*'
)
}
// geotools additional bundles not in the default group
bundle group: 'org.geotools.jdbc', name: 'gt-jdbc-oracle', version: geotoolsVersion
bundle group: 'org.geotools.xsd', name: 'gt-xsd-core', version: geotoolsVersion
bundle group: 'org.geotools.xsd', name: 'gt-xsd-gml2', version: geotoolsVersion
bundle group: 'org.geotools.xsd', name: 'gt-xsd-gml3', version: geotoolsVersion
bnd group: 'si.uom', name: 'si-quantity', {
prependImport 'javax.measure.*'
}
bnd group: 'si.uom', name: 'si-units-java8', {
prependImport 'javax.measure.*'
prependImport 'si.uom.quantity.*'
}
bnd group: 'systems.uom', name: 'systems-quantity', {
prependImport 'javax.measure.*'
}
// bnd group: 'systems.uom', name: 'systems-common-java8', {
// prependImport 'javax.measure.*'
// prependImport 'si.uom.quantity.*'
// }
bnd group: 'tec.uom', name: 'uom-se', {
prependImport 'javax.measure.*'
}
bnd group: 'tec.uom.lib', name: 'uom-lib-common', {
prependImport 'javax.measure.*'
}
bnd group: 'tech.units', name: 'indriya', {
prependImport 'tec.uom.lib.common.*'
}
bnd group: 'org.locationtech.jts', name: 'jts-core', {
instruction 'Export-Package', "*;version=$version"
}
// Exclude in favour of later version pulled in by GeoPackage
bundle group: 'org.geotools', name: 'geotools', {
exclude module: 'org.xerial.sqlite-jdbc'
}
// hale connect APIs
bundle 'com.haleconnect.api:haleconnect-user-api:1.0.2'
bundle 'com.haleconnect.api:haleconnect-bucket-api:1.0.1'
bundle 'com.haleconnect.api:haleconnect-projectstore-api:1.6.0'
bundle 'com.haleconnect.api:haleconnect-project-api:0.1.0'
// security
bundle 'org.jasig.cas:cas-client:3.1.10'
// utilities
bundle 'com.google.guava:guava:15.0'
bundle 'net.sf.trove4j:trove4j:2.0.4' // with version 3 some packages have changed
bnd group: 'net.sf.trove4j', name: 'trove4j', {
instructions 'Eclipse-BuddyPolicy': 'registered'
}
bundle 'commons-io:commons-io:2.14.0'
// https://www.cve.org/CVERecord?id=CVE-2022-42889
bundle 'org.apache.commons:commons-text:1.10.0'
bundle 'net.sf.ehcache:ehcache-core:2.6.6'
bundle 'org.apache.velocity:velocity:1.6.2'
bundle 'org.apache.xmlbeans:xmlbeans:5.1.1'
bundle 'com.iabcinc:jmep:0.1.0'
bundle 'com.google.code.findbugs:jsr305:2.0.3'
bundle 'eu.esdihumboldt.hale:prefixmapper:1.0.1'
bundle 'joda-time:joda-time:2.3'
bundle 'cglib:cglib:2.2.2'
bundle 'asm:asm-util:3.3.1' // optional dependency to cglib
bundle 'asm:asm-analysis:3.3.1'
// ivy with at least 2.4 because of bug in IvySettings
bundle 'org.apache.ivy:ivy:2.5.2'
// web stuff
bundle 'commons-fileupload:commons-fileupload:1.5'
bundle 'org.openid4java:openid4java:0.9.8'
bundle 'net.tanesha.recaptcha4j:recaptcha4j:0.0.8'
bundle "org.wicketstuff:wicketstuff-html5:$wicketVersion"
// https://mvnrepository.com/artifact/org.codehaus.groovy.modules.http-builder/http-builder
bundle 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
// fluent HTTP client API
bundle 'org.apache.httpcomponents:fluent-hc:4.5.13'
// prometheus client for providing metrics
bundle 'io.prometheus:simpleclient:0.16.0'
bnd group: 'io.prometheus', name: 'simpleclient', {
optionalImport 'io.prometheus.client.exemplars.tracer.*'
}
// Async HTTP client
// bundle 'com.ning:async-http-client:1.8.15'
// quartz scheduler
bundle 'org.quartz-scheduler:quartz:2.3.2'
// XML
// bundle 'org.apache.ws.xmlschema:xmlschema-core:2.0.2'
bundle 'org.apache.ws.commons.schema:XmlSchema:1.4.7'
bundle 'org.codehaus.castor:castor-xml:1.4.1', {
bnd {
instruction 'Import-Package', 'org.springframework.*'
instruction 'Import-Package', 'org.apache.commons.lang3.*'
// required to run unit tests involving codehaus xml
instruction 'Require-Bundle', "org.codehaus.castor.core,xerces.xercesImpl"
addQualifier = true
}
}
bundle 'org.codehaus.castor:castor-core:1.4.1'
// Units of Measurement
// bundle 'systems.uom:systems-common-java8:0.7.2'
// bundle 'systems.uom:systems-quantity:0.7.2'
bnd group: 'com.sun.istack', name: 'istack-commons-runtime', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
bnd group: 'com.sun.xml.fastinfoset', name: 'FastInfoset', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
bundle 'org.glassfish.jaxb:jaxb-runtime:4.0.1' , {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bundle 'org.glassfish.jaxb:jaxb-core:4.0.1', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bnd group: 'org.glassfish.jaxb', name: 'txw2', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
bnd group: 'org.jvnet.staxex', name: 'stax-ex', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
bnd group: 'org.reflections', name: 'reflections', {
prependImport 'com.google.common.*;version=20'
}
bnd group: 'net.tanesha.recaptcha4j', name: 'recaptcha4j', {
instruction '-removeheaders', 'Require-Capability'
}
// staxon
bundle 'de.odysseus.staxon:staxon:1.3'
// jackson 1
bundle 'org.codehaus.jackson:jackson-core-asl:1.9.13', {
bnd {
symbolicName = 'org.codehaus.jackson'
}
}
bundle 'org.codehaus.jackson:jackson-mapper-asl:1.9.13', {
bnd {
symbolicName = 'org.codehaus.jackson.mapper'
}
}
// jackson 2
bundle 'com.fasterxml.jackson.core:jackson-core:2.13.4'
bundle 'com.fasterxml.jackson.core:jackson-databind:2.13.4' , {
bnd {
optionalImport('javax.xml', '*')
}
}
// https://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-base
bundle 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.13.4'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider
bundle 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.13.4'
// https://mvnrepository.com/artifact/com.github.jnr/jnr-ffi
bundle 'com.github.jnr:jnr-ffi:2.2.12'
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
bnd group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', {
instruction '-removeheaders', 'Require-Capability'
}
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))" generated by bnd
bnd group: 'org.ow2.asm', name: 'asm', {
instruction '-removeheaders', 'Require-Capability'
}
bundle 'com.vladsch.flexmark:flexmark-all:0.64.0'
//suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
bnd group: 'com.vladsch.flexmark', {
instruction '-removeheaders', 'Require-Capability'
}
// spring osgi legacy
bundle 'de.cs3d.thirdparty:springframework-osgi-web-mini:2.0.0.M1'
// CSV
bundle 'net.sf.opencsv:opencsv:2.3'
// CLI (needed for using Groovy CLI builder)
bundle 'commons-cli:commons-cli:1.3.1'
// resources (partly replaced by resources module)
bundle group: 'eu.esdihumboldt.util.resource', name: 'schemas.citygml', version: '1.0.0.20120927'
//bundle group: 'eu.esdihumboldt.util.resource', name: 'schemas.opengis.net', version: '1.0.0.201202131112'
//bundle group: 'eu.esdihumboldt.util.resource', name: 'schemas.inspire', version: '1.0.0.20120927'
bundle group: 'eu.esdihumboldt.util.resource', name: 'schemas.test', version: '1.0.0.201205101531'
//jaxb stuff
// https://mkyong.com/java/jaxbexception-implementation-of-jaxb-api-has-not-been-found-on-module-path-or-classpath/
bundle 'com.sun.xml.bind:jaxb-core:2.2.11'
bundle 'com.sun.xml.bind:jaxb-core:4.0.1', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bundle 'com.sun.xml.bind:jaxb-impl:4.0.1', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bundle 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bundle 'jakarta.xml.bind:jakarta.xml.bind-api-test:3.0.1', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bundle 'jakarta.xml.bind:jakarta.xml.bind-api-parent:4.0.0', {
bnd {
// suppress Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
}
bnd group:'org.jvnet.jaxb2_commons', name:'jaxb2-basics-runtime', {
optionalImport 'com.sun.xml.*'
}
/*
* XXX Orient graph DB hack
*
* The tinkerpop blueprints implementation for OrientDB (at least in version 1.5.1 of OrientDB)
* is not compatible with the OrientDB version itself - probably because it is a SNAPSHOT.
* As workaround for resolving the packages we remove the version contraints on its orient imports.
* FIXME Instead rather specific versions of the tinkerpop libraries or a local snapshot that
* is guaranteed to be compatible should be used.
*/
bnd(group: 'com.tinkerpop.blueprints', name: 'blueprints-orient-graph') {
instruction 'Import-Package', 'com.orientechnologies.*,' + (properties['Import-Package']?:'*')
}
/*
* Override bundle symbolic names (e.g. org.objectweb.asm) as they collide with
* bundles provided via an Eclipse update site, and both versions cannot be
* included in the (plugin-based) product if the symbolic name is the same.
*
* The problem seems to persist with feature-based products as well, even
* as the Tycho build seems to be able to handle it given fixed versions in
* the feature, Eclipse will not create the Run Configuration accordingly and
* will not validate the product correctly.
*/
bnd group: 'org.ow2.asm', {
// -> use versioned symbolic names
def ov = org.osgi.framework.Version.parseVersion(version)
symbolicName = symbolicName + '-' + ov.major
}
bnd group: 'org.ow2.asm', name: 'asm-commons', {
// -> use versioned symbolic names
def ov = org.osgi.framework.Version.parseVersion(version)
// and fix problem with null symbolic name
symbolicName = 'org.ow2.asm.commons-' + ov.major
}
// ensure optional jdi imports for javassist
// not sure why bnd-platform adds those
bnd group: 'org.javassist', name: 'javassist', {
optionalImport 'com.sun.jdi.*'
}
// force package export versions for hsqldb
bnd group: 'org.hsqldb', name: 'hsqldb', {
instruction 'Export-Package', "*;version=$version"
}
bnd group: 'jakarta.activation', name: 'jakarta.activation-api', {
optionalImport 'com.sun.activation.registeries'
}
bnd group: 'org.apache.ws.commons.schema', name: 'XmlSchema', {
optionalImport 'org.w3c.dom'
}
bundle 'xerces:xercesImpl:2.12.2'
imports 'com.google.guava:guava', {
versionStrategy = MINIMUM
}
// HALE FME plugin
bundle 'de.fhg.igd.hale:fme-exec:1.1.0'
bundle 'de.fhg.igd.hale:fme-ui:1.3.0'
bundle 'de.fhg.igd.hale:fme-doc:1.1.0'
// force package export versions
bnd group: 'com.hierynomus', name: 'sshj', {
instruction 'Export-Package', "*;version=$version"
}
bnd group: 'ch.qos.cal10n', name: 'cal10n-api', {
instruction 'Export-Package', "*;version=$version"
}
//bundle for docker client
def dockerClientVersion = '2.7.7'
feature(id: 'com.spotify.docker-client', name: 'Spotify docker client and dependencies', version: dockerClientVersion) {
plugin group:'com.spotify', name:'docker-client', version: dockerClientVersion
// a jnr-unixsocket version that already includes proper OSGi headers
plugin 'com.github.jnr:jnr-unixsocket:0.12'
}
bnd group: 'com.github.jnr', {
optionalImport 'sun.misc.*'
}
// configuration for jffi native stuff (needed for docker client)
/*
bnd group: 'com.github.jnr', name: 'jffi', classifier: 'native', {
symbolicName = 'com.github.jnr.jffi.native'
instruction 'Fragment-Host', 'com.github.jnr.jffi'
instruction 'Require-Bundle', 'com.github.jnr.jffi'
instruction 'Bundle-ClassPath', '.,jni'
instruction 'Export-Package', '!'
instruction 'Private-Package', '*'
}
*/
bnd 'commons-dbcp:commons-dbcp', {
// dbcp must be able to access database drivers (though not directly relevant for HALE)
instruction 'DynamicImport-Package', '*'
}
// typesafe configuration library
bundle group:'com.typesafe', name:'config', version:'1.2.1'
merge {
// merged bundle for javax.annotation packages
// because otherwise only one fragment seems to be used to provide
// the javax.annotation package resulting in missing classes
match {
// merge all artifacts in org.geotools group, but not gt-opengis
(it.group == 'javax.annotation' && it.name == 'javax.annotation-api') ||
(it.group == 'com.google.code.findbugs' && it.name == 'jsr305')
}
bnd {
symbolicName = 'javax.annotation.extensions'
bundleName = 'javax.annotation Extensions'
version = '1.2' // version should be equal to javax.annotation-api module version
instruction 'Fragment-Host', 'system.bundle;extension:=framework'
instruction 'Export-Package', "javax.annotation.*;version=$version;-noimport:=true"
instruction 'Import-Package', '*'
}
}
// MSAccess
bundle 'net.sf.ucanaccess:ucanaccess:3.0.6', {
bnd {
def buddies = ['eu.esdihumboldt.hale.io.jdbc', 'net.sourceforge.schemacrawler']
if (buddies) {
// register buddy
instruction 'Eclipse-RegisterBuddy', buddies.join(',')
// add as optional required bundle
instruction 'Require-Bundle', buddies.collect{
it + ';resolution:=optional'
}.join(',')
}
}
}
bnd group: 'com.healthmarketscience.jackcess', name: 'jackcess', {
instruction 'Export-Package', "*;version=$version"
}
// better assertions
bundle("org.assertj:assertj-core:3.22.0")
// Allure test framework
bundle 'ru.yandex.qatools.allure:allure-junit-adaptor:1.5.0', {
exclude module: 'slf4j-nop'
// exclude junit - is provided by Eclipse
// also, adaptions to the manifest would be necessary (exported package version for 3.x packages)
exclude module: 'junit'
}
bnd group: 'ru.yandex.qatools.allure', name: 'allure-java-adaptor-api', {
// tika exported package version does not seem to resemble bundle version
instruction 'Import-Package', 'org.apache.tika.*;version="[1.0.0,2.0.0)",*'
}
bnd group: 'ru.yandex.qatools.allure', name: 'allure-java-aspects', {
// see http://wiki.eclipse.org/Equinox_Weaving_QuickStart
instruction 'Export-Package', "ru.yandex.qatools.allure.aspects;version=$version;aspects=\"AllureAttachAspects,AllureStepsAspects,AllureParametersAspects\",*;version=$version"
}
bundle 'org.aspectj:aspectjweaver:1.8.3'
// https://mvnrepository.com/artifact/javax.transaction/javax.transaction-api
bundle 'javax.transaction:javax.transaction-api:1.3', {
bnd {
// istack seems to be part of the bundle and reimporting it fails because of a version issue
optionalImport 'javax.enterprise.context'
optionalImport 'javax.enterprise.util'
optionalImport 'javax.interceptor'
}
}
bnd group: 'org.eclipse.jetty', name: 'jetty-plus', {
optionalImport 'javax.transaction'
}
bnd group: 'net.sf.ezmorph', name: 'ezmorph', {
instruction '-removeheaders', 'Require-Capability'
}
// YAML library
bundle 'org.yaml:snakeyaml:2.2'
// Pebble template engine
def pebbleVersion = '3.0.1'
feature(id: 'io.pebbletemplates.pebble', name: 'Pebble template engine', version: pebbleVersion) {
plugin "io.pebbletemplates:pebble:${pebbleVersion}"
}
bnd group: 'com.coverity.security', name: 'coverity-escapers', {
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.1))" generated by bnd
instruction '-removeheaders', 'Require-Capability'
}
bnd group: 'com.github.ben-manes.caffeine', name: 'caffeine', {
// force package export versions
instruction 'Export-Package', "*;version=$version"
}
// Geopackage library
def gpkgVersion = '3.4.0'
def ormliteVersion = '5.1' // see gpkg deps
bundle "mil.nga.geopackage:geopackage:$gpkgVersion", {
// avoid jackson update
exclude module: 'jackson-databind'
}
// merge bundle (because there are shared packages)
merge {
match {
it.group != null && it.group.startsWith('mil.nga.geopackage') && it.name.startsWith('geopackage')
}
bnd {
symbolicName = 'mil.nga.geopackage'
bundleName = 'Geopackage Java'
version = gpkgVersion
instruction 'Export-Package', "*;version=$gpkgVersion"
}
}
// merge ormlite bundle (because there are shared packages)
merge {
match {
it.group != null && it.group.startsWith('com.j256.ormlite') && it.name.startsWith('ormlite')
}
bnd {
symbolicName = 'com.j256.ormlite'
bundleName = 'ormlite'
version = ormliteVersion
instruction 'Export-Package', "*;version=$ormliteVersion"
// need to be able to access sqlite JDBC driver
optionalImport 'org.sqlite'
}
}
bnd group: 'mil.nga.sf', name: 'sf-geojson', {
prependImport 'com.fasterxml.jackson.*' // remove import versions (because we use an older jackson version)
}
// force correct package export versions for sqlite-jdbc
bnd group: 'org.xerial', name: 'sqlite-jdbc', {
instruction 'Export-Package', "*;version=$version"
}
bnd group: 'jline', name: 'jline', {
// make some imports optional which showed up after upgrading bnd
optionalImport 'sun.misc', 'com.cloudius.util'
}
// library fixes
//
// suppress Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.1))" generated by bnd - Eclipse chokes on it
bnd group: 'org.apache.xml', name: 'xml-commons-resolver', {
instruction '-removeheaders', 'Require-Capability'
}
bnd group: 'xml-resolver', name: 'xml-resolver', {
instruction '-removeheaders', 'Require-Capability'
}
}
dependencies {
bndplatform 'de.fhg.igd:osgi-util:1.0', {
// exclude OSGi dependencies (we include Equinox/Eclipse through separate update site)
exclude module: 'org.eclipse.osgi'
exclude module: 'org.osgi.compendium'
}
}
dependencies {
// additional versions of Google Guava
//XXX Guava is too basic, multiple versions result in a bunch of package uses conflicts
// platformaux 'com.google.guava:guava:14.0.1'
// platformaux 'com.google.guava:guava:11.0.2'
}
// build jaxb projects
subprojects { subproject ->
if (subproject.parent?.name == "jaxb") {
apply plugin: 'java'
apply plugin: 'biz.aQute.bnd.builder'
repositories {
maven { // wetransform artifactory
url 'https://artifactory.wetransform.to/artifactory/libs-release/'
}
mavenCentral()
}
configurations {
jaxb
}
dependencies {
jaxb 'com.sun.xml.bind:jaxb-xjc:4.0.1'
jaxb 'com.sun.xml.bind:jaxb-impl:4.0.1'
// as per the documentation this should be commented
// https://docs.gradle.org/current/userguide/upgrading_version_4.html#rel5.0:jaxb_and_java9
jaxb 'javax.xml.bind:jaxb-api:2.3.0'
jaxb 'org.glassfish.jaxb:jaxb-xjc:4.0.1'
jaxb 'org.glassfish.jaxb:jaxb-core:4.0.1'
jaxb 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
jaxb 'jakarta.xml.bind:jakarta.xml.bind-api-test:3.0.1'
jaxb 'jakarta.xml.bind:jakarta.xml.bind-api-parent:4.0.0'
jaxb 'org.glassfish.jaxb:jaxb-runtime:4.0.0'
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
def generatedSources = subproject.file('src/main/java')
task cleanSrc() {
doLast {
generatedSources.deleteDir()
}
}
task xjc {
doLast {
generatedSources.mkdirs()
ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.jaxb.asPath)
ant.xjc(destdir: generatedSources) {
schema(dir: subproject.file('schema'), includes: '*.xsd')
binding(dir: subproject.file('schema'), includes: 'bindings.xml')
}
}
}
// package source into a jar file
task packageSources(type: Jar, dependsOn: 'xjc') {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
tasks.xjc.dependsOn('cleanSrc')
tasks.clean.dependsOn('cleanSrc')
tasks.compileJava.dependsOn('xjc')
// let main project depend on jar task
rootProject.tasks.bundles.dependsOn(tasks.jar)
// ...and on packaged sources
rootProject.tasks.bundles.dependsOn(tasks.packageSources)
// add produced jar to platform
// sources jars will be automatically detected by bnd-platform
def jars = tasks.jar.outputs.files
configure(rootProject) {
platform {
bundle(jars)
}
}
}
}
project.ext {
updateSiteMergeDir = file('../hale-build-support/updatesites/platform')
mergeBasedOnVersion = [
// regular expressions matched against the file name
// generated jaxb sources
/^eu\.esdihumboldt\.hale\..+\.jaxb\.source_\d+\.\d+.\d+\.jar$/
]
}
def mergeOldJars(File targetFolder, File referenceFolder, String resourceName, boolean bndFallback) {
def numReplaced = 0
def numRetained = 0
// test all new bundles
targetFolder.eachFile(groovy.io.FileType.FILES) { File nb ->
// if there is an old bundle with the same name
File ob = new File(referenceFolder, nb.name)
if (ob.exists()) {
boolean replace = project.ext.mergeBasedOnVersion.any {
ob.name ==~ it
}
if (replace) {
logger.warn("Using previously created version of ${nb.name} without difference check")
}
// compare files
def diffcal
try {
diffcal = new zipdiff.DifferenceCalculator(ob, nb)
} catch (java.util.zip.ZipException e) {
logger.error("Error opening Zip file\n $nb\n -- or --\n $ob\n -> ${e.message}")
// use new file, don't replace
}
def diff = null
if (diffcal != null) {
diffcal.ignoreTimestamps = true
diffcal.compareCRCValues = true
diff = diffcal.differences
if (!replace && diff.hasDifferences()) {
if (bndFallback) {
// use bnd diff that does a real diff on the manifest headers
def diffPlugin = new aQute.bnd.differ.DiffPluginImpl()
def otree = diffPlugin.tree(ob)
def ntree = diffPlugin.tree(nb)
def bndDiff = ntree.diff(otree)
switch (bndDiff.delta) {
case aQute.bnd.service.diff.Delta.IGNORED:
case aQute.bnd.service.diff.Delta.UNCHANGED:
replace = true
break
default:
replace = false
}
}
else replace = false
}
else {
replace = true
}
}
if (replace) {
// replace new file with old/reference file
ant.copy(file: ob, tofile: nb, overwrite: true)
logger.info("Replaced $resourceName $nb.name with previously created version")
numReplaced++
}
else {
if (diff != null) {
println diff.toString()
}
else {
logger.info("Keeping $resourceName $nb.name because no difference check could be done")
}
numRetained++
}
}
else {
println "No reference $resourceName found for $nb.name"
numRetained++
}
}
println "Replaced $numReplaced ${resourceName}s with version (with equal content) from reference update site"
println "Retained $numRetained ${resourceName}s that have changes compared to the current update site version"
}
/*
* Merge with old update site in hale-build-support to prevent unnecessary
* pollution of the hale-build-support repository.
*/
task mergeOldSite(dependsOn: [tasks.bundles, tasks.bundleFeatures]) {
doLast {
// bundles
File newBundles = new File(project.buildDir, 'plugins')
File oldBundles = new File(updateSiteMergeDir, 'plugins')
if (oldBundles.exists()) {
logger.warn("Attempting to merge existing update site at $oldBundles, may replace bundles with previously created bundles")
mergeOldJars(newBundles, oldBundles, 'bundle', true)
} else {
logger.warn("Skipping merge with current update site content, as directory $oldBundles was not found")
}
// features
File newFeatures = new File(project.buildDir, 'features')
File oldFeatures = new File(updateSiteMergeDir, 'features')
if (oldFeatures.exists()) {
logger.warn("Attempting to merge existing update site at $oldFeatures, may replace features with previously created features")
mergeOldJars(newFeatures, oldFeatures, 'feature', false)
} else {
logger.warn("Skipping merge with current update site content, as directory $oldFeatures was not found")
}
}
}
tasks.updateSite.dependsOn mergeOldSite
/**
* Tasks that mirror essential update sites.
*/
def json = new groovy.json.JsonSlurper()
def updateSites
file('p2.json').withReader {