-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathbuild.gradle
More file actions
198 lines (171 loc) · 7.64 KB
/
build.gradle
File metadata and controls
198 lines (171 loc) · 7.64 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
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
/*
* Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
*/
plugins {
id 'maven-publish'
}
configurations.all {
// Ensure that no test dependencies below, namely marklogic-junit5, bring in their own version of marklogic-client-api,
// as we only want to use the one built by this project.
exclude group: 'com.marklogic', module: 'marklogic-client-api'
}
dependencies {
// Using the latest version now that the 8.0.0 release requires Java 17.
// This is now an implementation dependency as opposed to an api dependency in 7.x and earlier.
// The only time it appears in the public API is when a user uses JAXBHandle.
// But in that scenario, the user would already be using JAXB in their application.
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.4"
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.6"
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
implementation 'io.github.rburgst:okhttp-digest:3.1.1'
// We tried upgrading to the org.eclipse.angus:angus-mail dependency, but we ran into significant performance issues
// with using the Java Client eval call in our Spark connector. Example - an eval() call for getting 50k URIs would
// take 50s instead of 2 to 3s. Haven't dug into the details, but seems like the call isn't lazy and the entire set
// of URIs is being retrieved. This implementation - in the old "com.sun.mail" package but still adhering to the new
// jakarta.mail API - works fine and performs well for eval calls.
// As of the 8.0.0 release - this still is a good solution, particularly as com.sun.mail:jakarta.mail received a
// recent patch release and is therefore still being maintained.
implementation "com.sun.mail:jakarta.mail:2.0.2"
implementation 'org.slf4j:slf4j-api:2.0.17'
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:${jacksonVersion}"
// Dependencies for hash generation. Can be safely omitted if not using the incremental write feature. But neither
// has any transitive dependencies, and thus their impact on the dependency tree is minimal.
implementation "io.github.erdtman:java-json-canonicalization:1.1"
implementation "net.openhft:zero-allocation-hashing:0.27ea1"
// Only used by extras (which some examples then depend on)
compileOnly 'org.jdom:jdom2:2.0.6.1'
compileOnly 'org.dom4j:dom4j:2.2.0'
compileOnly 'com.google.code.gson:gson:2.13.2'
testImplementation "com.marklogic:marklogic-junit5:2.0-SNAPSHOT"
testImplementation 'org.xmlunit:xmlunit-legacy:2.11.0'
testImplementation project(':examples')
testImplementation 'org.apache.commons:commons-lang3:3.20.0'
// Allows talking to the Manage API.
testImplementation "com.marklogic:ml-app-deployer:6.2-SNAPSHOT"
testImplementation "org.mockito:mockito-core:5.21.0"
testImplementation "org.mockito:mockito-inline:5.2.0"
testImplementation "com.squareup.okhttp3:mockwebserver3:${okhttpVersion}"
testImplementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jacksonVersion}"
testImplementation 'ch.qos.logback:logback-classic:1.5.23'
// Using this to avoid a schema validation issue with the regular xercesImpl
testImplementation 'org.opengis.cite.xerces:xercesImpl-xsd11:2.12-beta-r1667115'
testImplementation('com.opencsv:opencsv:5.12.0') {
// Excluding this due to a security vulnerability, and the test for the example that uses this library
// passes without this on the classpath.
exclude module: "commons-beanutils"
}
testImplementation 'org.skyscreamer:jsonassert:1.5.3'
// Automatic loading of test framework implementation dependencies is deprecated.
// https://docs.gradle.org/current/userguide/upgrading_version_8.html#test_framework_implementation_dependencies
// Without this, once using JUnit 5.12 or higher, Gradle will not find any tests and report an error of:
// org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junitVersion}"
}
// Ensure that mlHost and mlPassword can override the defaults of localhost/admin if they've been modified
tasks.withType(Test).configureEach {
useJUnitPlatform()
systemProperty "TEST_HOST", mlHost
systemProperty "TEST_ADMIN_PASSWORD", mlPassword
// Needed by the tests for the example programs
systemProperty "EXAMPLE_HOST", mlHost
systemProperty "EXAMPLE_ADMIN_PASSWORD", mlPassword
systemProperty "TEST_USE_REVERSE_PROXY_SERVER", testUseReverseProxyServer
}
tasks.register("testRows", Test) {
description = "Run all 'rows' tests; i.e. those exercising Optic and Optic Update functionality"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
include "com/marklogic/client/test/rows/**"
}
tasks.register("debugCloudAuth", JavaExec) {
description = "Test program for manual testing of cloud-based authentication against a Progress Data Cloud instance"
mainClass = 'com.marklogic.client.test.ProgressDataCloudAuthenticationDebugger'
classpath = sourceSets.test.runtimeClasspath
args = [cloudHost, cloudKey, cloudBasePath]
}
tasks.register("runXmlSmokeTests", Test) {
description = "Run a bunch of XML-related tests for smoke-testing on a particular JVM"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
include "com/marklogic/client/test/BufferableHandleTest.class"
include "com/marklogic/client/test/EvalTest.class"
include "com/marklogic/client/test/HandleAsTest.class"
include "com/marklogic/client/test/JAXBHandleTest.class"
}
// Publishing setup - see https://docs.gradle.org/current/userguide/publishing_setup.html .
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
maxMemory = "6000m"
options.overview = "src/main/javadoc/overview.html"
options.windowTitle = "MarkLogic Java Client API $rootProject.version"
options.docTitle = "MarkLogic Java Client API $rootProject.version"
options.bottom = "Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved."
options.use = true
exclude([
'**/impl/**', '**/jaxb/**', '**/test/**'
])
// workaround for bug in options.docFilesSubDirs = true
doLast {
copy {
from "${projectDir}/src/main/javadoc/doc-files"
into "${layout.buildDirectory.get()}/docs/javadoc/doc-files"
}
}
}
publishing {
publications {
mainJava(MavenPublication) {
from components.java
pom {
name = "${project.group}:${project.name}"
description = "The MarkLogic Java Client API"
packaging = "jar"
url = "https://github.com/marklogic/java-client-api"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "marklogic"
name = "MarkLogic Github Contributors"
email = "general@developer.marklogic.com"
organization = "MarkLogic"
organizationUrl = "https://www.marklogic.com"
}
}
scm {
url = "https://github.com/marklogic/java-client-api"
connection = "https://github.com/marklogic/java-client-api"
developerConnection = "https://github.com/marklogic/java-client-api"
}
}
}
}
repositories {
maven {
if (project.hasProperty("mavenUser")) {
credentials {
username = mavenUser
password = mavenPassword
}
url = publishUrl
allowInsecureProtocol = true
} else {
name = "central"
url = mavenCentralUrl
credentials {
username = mavenCentralUsername
password = mavenCentralPassword
}
}
}
}
}