-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
114 lines (96 loc) · 4.15 KB
/
Copy pathbuild.gradle
File metadata and controls
114 lines (96 loc) · 4.15 KB
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
plugins {
id "org.sonarqube" version "7.0.1.6134"
}
sonar {
properties {
property "sonar.projectKey", "flux"
property "sonar.host.url", "http://localhost:9000"
property "sonar.coverage.jacoco.xmlReportPaths", "code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml"
// Avoids a warning from Gradle.
property "sonar.gradle.skipCompile", "true"
}
}
subprojects {
apply plugin: "java-library"
group = "com.marklogic"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Allows for quickly identifying compiler warnings.
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation"]
options.deprecation = true
options.warnings = true
}
javadoc.failOnError = false
// Ignores warnings on params that don't have descriptions, which is a little too noisy
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
repositories {
mavenCentral()
mavenLocal()
// For temporary dependencies on internal snapshots.
maven {
url = "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
}
}
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// Defining this rule for io.netty here so that it affects both flux-cli and flux-embedding-model-azure-open-ai.
if (details.requested.group.equals("io.netty") and (details.requested.version.startsWith("4.1.") || details.requested.version.startsWith("4.2."))) {
details.useVersion "4.2.13.Final"
details.because "Forcing Spark 4.1.x to use latest to minimize CVEs; this also forces azure-open-ai to use latest to avoid conflicts."
}
if (details.requested.group.equals("org.apache.logging.log4j") && details.requested.version.startsWith("2.24")) {
details.useVersion "2.26.0"
details.because "Forces Spark 4.1.x to use latest log4j 2.x to eliminate CVEs."
}
if (details.requested.group.startsWith("com.fasterxml.jackson")) {
if (details.requested.name == "jackson-annotations") {
// This oddly does not have a 2.21.0 or 2.21.1 release, just 2.21.
details.useVersion "2.21"
} else {
details.useVersion "2.21.1"
}
details.because "Force Jackson to 2.21.x to align with Java Client 8.1.0."
}
if (details.requested.group.equals("org.apache.thrift") && details.requested.name.equals("libthrift")) {
// This is being done solely for Black Duck's sake, as it seems to be having trouble recognizing that the
// internal snapshot build of the MarkLogic Spark connector is already using version 0.23.0.
details.useVersion "0.23.0"
details.because "Forces Spark 4.1.x to use the latest libthrift, which is needed to avoid CVEs."
}
}
}
test {
useJUnitPlatform()
testLogging {
events = ['started', 'passed', 'skipped', 'failed']
exceptionFormat = 'full'
}
jvmArgs = [
// Needed for all Java 17 testing.
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
// For Spark's SerializationDebugger when using Java 17. See ReprocessTest for one example of why this is needed.
"--add-opens", "java.base/sun.security.action=ALL-UNNAMED",
// Needed by the JDBC tests.
"--add-opens", "java.base/sun.util.calendar=ALL-UNNAMED",
// Needed by CustomImportTest
"--add-opens", "java.base/java.io=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.cs=ALL-UNNAMED"
]
}
}
tasks.register("gettingStartedZip", Zip) {
description = "Creates a zip of the getting-started project that is intended to be included as a downloadable file " +
"on the GitHub release page."
from "examples/getting-started"
exclude "build", ".gradle", "gradle-*.properties", "flux", ".gitignore", "marklogic-flux"
exclude "src/main/ml-schemas/tde/chunks.json"
into "marklogic-flux-getting-started-${version}"
archiveFileName = "marklogic-flux-getting-started-${version}.zip"
destinationDirectory = file("build")
}