Skip to content

Commit 8985956

Browse files
Ryan DewSameeraPriyathamTadikonda
authored andcommitted
MLE-10983: Fix gradle publish for 4.3.3
1 parent 6a7db05 commit 8985956

File tree

4 files changed

+83
-31
lines changed

4 files changed

+83
-31
lines changed

build.gradle

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
allprojects {
2-
task resolveAllDependencies {
3-
doLast {
4-
configurations.all {
5-
if (it.isCanBeResolved()) {
6-
it.resolve()
7-
}
8-
}
9-
}
10-
}
1+
plugins {
2+
// Declaring this at root level so it's available for every subproject without declaring a version
3+
id "net.saliman.properties" version "1.5.1"
114
}
125

136
subprojects {
7+
// While subprojects may need to use java-library plugin, applying this at the top level allows for
8+
// sourceCompatibility/targetCompatibility to be set at this level as well
149
apply plugin: 'java'
1510

16-
sourceCompatibility = "1.8"
17-
targetCompatibility = "1.8"
11+
apply plugin: 'jacoco'
12+
13+
java {
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
16+
}
1817

1918
repositories {
2019
mavenCentral()
2120
mavenLocal()
21+
maven { url "https://developer.marklogic.com/maven2/" }
2222
}
2323

24-
25-
dependencies {
26-
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.1'
27-
testImplementation 'org.apache.httpcomponents:httpclient:4.5.14'
24+
tasks.withType(JavaCompile) {
25+
options.sourcepath = files('bin/sourcepath')
2826
}
2927

30-
test {
28+
tasks.withType(Test) {
29+
ignoreFailures = true
3130
testLogging {
3231
events 'started', 'passed', 'skipped', 'failed'
3332
exceptionFormat 'full'
3433
}
3534
}
3635

36+
jacocoTestReport {
37+
reports {
38+
xml.required = true
39+
}
40+
}
3741
}
3842

3943
wrapper {

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ version=4.3.3
22
publishUrl=file:../marklogic-data-hub/releases
33
systemProp.file.encoding=utf-8
44
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
5+
# To run the snyk Gradle plugin - https://github.com/snyk/gradle-plugin - define this in gradle-local.properties
6+
# A token can be obtained by creating a snyk account at https://snyk.io/
7+
snykToken=

marklogic-data-hub/build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
plugins {
2-
// id "com.github.node-gradle.node" version "3.1.1"
32
id 'net.saliman.properties' version '1.5.1'
43
id 'java'
54
id 'maven-publish'
65
id 'com.marklogic.ml-gradle' version '4.8.0'
7-
// id 'com.moowork.node' version '1.1.1'
6+
// Declaring this at each subproject level, as declaring it at root level resulted in an error about the plugin
7+
// not being able to resolve its "dataFiles" configuration
8+
id "io.snyk.gradle.plugin.snykplugin" version "0.4"
89
}
910

1011
repositories {
@@ -23,6 +24,18 @@ ext.junitVintageVersion = '4.12.0-RC3'
2324
ext.junitPlatformVersion = '1.3.1'
2425
ext.junitJupiterVersion = '5.3.1'
2526

27+
// Disabling javadoc warnings, as we have hundreds of them, and until we want to do something about them,
28+
// seeing them when running a Gradle task (like publishToMavenLocal) is just useless noise
29+
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
30+
31+
// See https://github.com/snyk/gradle-plugin for docs
32+
snyk {
33+
severity = 'medium'
34+
api = snykToken
35+
autoDownload = true
36+
autoUpdate = true
37+
}
38+
2639
dependencies {
2740
//implementation 'com.marklogic:marklogic-client-api:4.2.0'
2841
/* implementation('com.marklogic:ml-app-deployer:3.16.0'){
@@ -167,6 +180,7 @@ publishing {
167180
}
168181
}
169182
url publishUrl
183+
allowInsecureProtocol = true
170184
}
171185
}
172186
}

ml-data-hub-plugin/build.gradle

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,33 @@
1818

1919

2020
plugins {
21-
id 'com.gradle.plugin-publish' version '1.2.1'
22-
id "maven-publish"
23-
id "java-gradle-plugin"
24-
25-
id 'net.saliman.properties' version '1.4.6'
21+
id 'net.saliman.properties' version '1.5.1'
2622
id "groovy"
27-
// id "com.jfrog.bintray" version "1.7.3"
28-
id 'org.springframework.boot' version '2.7.5'
23+
id "java-gradle-plugin"
24+
id "maven-publish"
25+
id "com.gradle.plugin-publish" version "1.3.0"
26+
id 'org.springframework.boot' version '2.7.18'
27+
id "io.snyk.gradle.plugin.snykplugin" version "0.4"
2928
}
3029

31-
// apply plugin: "com.gradle.plugin-publish"
3230
apply plugin: "io.spring.dependency-management"
3331

3432
sourceCompatibility = 1.8
3533
targetCompatibility = 1.8
3634

3735
bootJar.enabled = false
38-
jar.enabled = true
36+
jar {
37+
enabled = true
38+
archiveClassifier = ''
39+
}
40+
41+
// See https://github.com/snyk/gradle-plugin for docs
42+
snyk {
43+
severity = 'medium'
44+
api = snykToken
45+
autoDownload = true
46+
autoUpdate = true
47+
}
3948

4049
repositories {
4150
mavenCentral()
@@ -47,7 +56,7 @@ dependencies {
4756
implementation(project(':marklogic-data-hub')) {
4857
exclude group: 'ch.qos.logback'
4958
}
50-
implementation('com.marklogic:ml-gradle:4.5.2') {
59+
implementation('com.marklogic:ml-gradle:4.8.0') {
5160
exclude group: 'ch.qos.logback'
5261
}
5362
implementation 'commons-io:commons-io:2.16.1'
@@ -121,17 +130,39 @@ bootRun {
121130
}
122131

123132
group = 'com.marklogic'
124-
133+
version = '4.3.3'
125134
java { withSourcesJar() }
126135

136+
publishing {
137+
publications {
138+
main(MavenPublication) {
139+
groupId = 'com.marklogic.ml-data-hub'
140+
artifactId = 'jar'
141+
version = project.version
142+
from components.java
143+
}
144+
}
145+
repositories {
146+
maven {
147+
if (project.hasProperty("mavenUser")) {
148+
credentials {
149+
username mavenUser
150+
password mavenPassword
151+
}
152+
}
153+
url publishUrl
154+
allowInsecureProtocol = true
155+
}
156+
}
157+
}
127158

128159
gradlePlugin {
129160
website = 'https://marklogic.github.io/marklogic-data-hub/'
130161
vcsUrl = 'https://github.com/marklogic/marklogic-data-hub.git'
131162
description = 'ml-data-hub A gradle plugin for Data Hub tasks'
132163

133164
plugins {
134-
mldatahubPlugin {
165+
create('mldatahubPlugin') {
135166
id = 'com.marklogic.ml-data-hub'
136167
implementationClass = 'com.marklogic.gradle.DataHubPlugin'
137168
displayName = 'Gradle tasks for MarkLogic Data Hub'

0 commit comments

Comments
 (0)