This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
171 lines (149 loc) · 5.08 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
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "io.snyk.gradle.plugin.snykplugin" version "0.4"
// This plugin requires Java 11; keeping it commented out so that this project can be built and tested via
// Java 8, 11 or 17; to use this plugin, uncomment this line and use java 11 or higher
// id "com.github.jk1.dependency-license-report" version "2.1"
// For deploying the test app.
id 'net.saliman.properties' version '1.5.2'
id "com.marklogic.ml-gradle" version "4.7.0"
}
group = "com.marklogic"
version = "4.8.0"
java {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
repositories {
mavenLocal()
maven {
url "https://bed-artifactory.bedford.progress.com:443/artifactory/ml-maven-snapshots/"
}
mavenCentral()
}
dependencies {
api 'com.marklogic:marklogic-client-api:6.6.0'
api 'com.marklogic:marklogic-xcc:11.2.0'
api 'org.springframework:spring-context:5.3.34'
implementation 'org.jdom:jdom2:2.0.6.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
// This is currently an implementation dependency, though perhaps should be an api dependency due to its usage in
// LoggingObject; not clear yet on whether the protected Logger in that class should make this an api dependency or not
implementation 'org.slf4j:slf4j-api:2.0.13'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testImplementation 'org.springframework:spring-test:5.3.34'
testImplementation 'org.mockito:mockito-core:4.11.0'
// Used for testing loading modules from the classpath
testImplementation files("lib/modules.jar")
// Forcing Spring to use logback instead of commons-logging
testImplementation "ch.qos.logback:logback-classic:1.3.14" // Not using 1.4.x yet as it requires Java 11
testImplementation "org.slf4j:jcl-over-slf4j:2.0.13"
testImplementation "org.slf4j:slf4j-api:2.0.13"
// For verifying that JAXB can be used in a test on Java 11 or higher
testImplementation "javax.xml.bind:jaxb-api:2.3.1"
testImplementation "org.glassfish.jaxb:jaxb-runtime:2.3.9"
testImplementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
// Including the "new" JAXB libraries to verify that their presence doesn't cause the "old" JAXB libraries to fail
testImplementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
testImplementation "com.sun.xml.bind:jaxb-impl:4.0.5"
}
test {
useJUnitPlatform()
testLogging {
events 'started', 'passed', 'skipped', 'failed'
exceptionFormat 'full'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = "javadoc"
from javadoc
}
javadoc.failOnError = false
// Ignores warnings on params that don't have descriptions, which is a little too noisy
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
task generatePomForDependencyGraph(dependsOn: "generatePomFileForMainJavaPublication") {
description = "Prepare for a release by making a copy of the generated pom file in the root directory so that it " +
"can enable Github's Dependency Graph feature, which does not yet support Gradle"
doLast {
def preamble = '<?xml version="1.0" encoding="UTF-8"?>'
def comment = "<!--\n" +
"This file was generated via Gradle and is being used primarily for github's Dependency Graph feature.\n" +
"It is not intended to be used to build this project.\n" +
"-->"
def fileText = file("build/publications/mainJava/pom-default.xml").getText()
file("pom.xml").setText(fileText.replace(preamble, preamble + comment))
}
}
publishing {
publications {
mainJava(MavenPublication) {
pom {
name = "${group}:${project.name}"
description = "Library that adds functionality on top of the MarkLogic Java Client"
packaging = "jar"
url = "https://github.com/marklogic-community/${project.name}"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "marklogic"
name = "MarkLogic Github Contributors"
email = "[email protected]"
organization = "MarkLogic"
organizationUrl = "https://www.marklogic.com"
}
}
scm {
url = "[email protected]:marklogic-community/${project.name}.git"
connection = "scm:[email protected]:marklogic-community/${project.name}.git"
developerConnection = "scm:[email protected]:marklogic-community/${project.name}.git"
}
}
from components.java
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
if (project.hasProperty("mavenUser")) {
credentials {
username mavenUser
password mavenPassword
}
url publishUrl
} else {
name = "central"
url = mavenCentralUrl
credentials {
username mavenCentralUsername
password mavenCentralPassword
}
}
}
}
}
// See https://github.com/snyk/gradle-plugin for more information
snyk {
//arguments = '--all-sub-projects'
severity = 'low'
api = snykToken
autoDownload = true
autoUpdate = true
}