|
1 | 1 | plugins { |
2 | | - id "java" |
3 | | - id "maven-publish" |
4 | | - id "com.jfrog.bintray" version "1.8.4" |
5 | | - id "com.github.jk1.dependency-license-report" version "1.3" |
| 2 | + id "java-library" |
| 3 | + id "maven-publish" |
| 4 | + id "com.jfrog.bintray" version "1.8.4" |
| 5 | + id "com.github.jk1.dependency-license-report" version "1.3" |
| 6 | + |
| 7 | + id "net.saliman.properties" version "1.5.1" |
| 8 | + id "io.snyk.gradle.plugin.snykplugin" version "0.4" |
6 | 9 | } |
7 | 10 |
|
8 | | -sourceCompatibility = "9" |
9 | | -targetCompatibility = "9" |
| 11 | +sourceCompatibility = "8" |
| 12 | +targetCompatibility = "8" |
10 | 13 |
|
11 | 14 | ext { |
12 | | - taskGroup = project.name |
| 15 | + taskGroup = project.name |
13 | 16 | } |
14 | 17 |
|
15 | 18 | repositories { |
16 | | - jcenter() |
17 | | - mavenCentral() |
18 | | - maven { url "http://developer.marklogic.com/maven2/" } |
| 19 | + jcenter() |
| 20 | + mavenCentral() |
| 21 | + maven { url "http://developer.marklogic.com/maven2/" } |
| 22 | + mavenLocal() |
19 | 23 | } |
20 | 24 |
|
21 | 25 | dependencies { |
22 | | - compile "com.marklogic:marklogic-client-api:5.2.0" |
| 26 | + api "com.marklogic:marklogic-client-api:5.3.0" |
23 | 27 |
|
24 | | - testCompile "junit:junit:4+" |
25 | | - // Sticking with the latest 4.3.x for tests; including the latest 5.2.x release oddly resulted in the servlet package |
26 | | - // being required |
27 | | - testCompile "org.springframework:spring-test:4.3.28.RELEASE" |
28 | | - testCompile "com.marklogic:ml-javaclient-util:4.0.0" |
| 28 | + testImplementation "junit:junit:4+" |
| 29 | + // Sticking with the latest 4.3.x for tests; including the latest 5.2.x release oddly resulted in the servlet package |
| 30 | + // being required |
| 31 | + testImplementation "org.springframework:spring-test:4.3.29.RELEASE" |
| 32 | + testImplementation "com.marklogic:ml-javaclient-util:4.1.0-SNAPSHOT" |
29 | 33 |
|
30 | | - // Forcing Spring to use logback instead of commons-logging |
31 | | - testRuntime "ch.qos.logback:logback-classic:1.2.3" |
32 | | - testRuntime group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.30" |
33 | | - testRuntime group: "org.slf4j", name: "slf4j-api", version: "1.7.30" |
| 34 | + // Forcing Spring to use logback instead of commons-logging |
| 35 | + testImplementation "ch.qos.logback:logback-classic:1.2.3" |
| 36 | + testImplementation group: "org.slf4j", name: "jcl-over-slf4j", version: "1.7.30" |
| 37 | + testImplementation group: "org.slf4j", name: "slf4j-api", version: "1.7.30" |
34 | 38 | } |
35 | 39 |
|
36 | 40 | task sourcesJar(type: Jar, dependsOn: classes) { |
37 | | - classifier "sources" |
38 | | - from sourceSets.main.allJava |
| 41 | + classifier "sources" |
| 42 | + from sourceSets.main.allJava |
39 | 43 | } |
40 | 44 |
|
41 | 45 | task javadocJar(type: Jar, dependsOn: javadoc) { |
42 | | - classifier "javadoc" |
43 | | - from file(javadocsDir + "/" + project.name) |
| 46 | + classifier "javadoc" |
| 47 | + from file(javadocsDir + "/" + project.name) |
44 | 48 | } |
45 | 49 |
|
46 | 50 | javadoc.destinationDir = file(javadocsDir + "/" + project.name) |
47 | 51 | javadoc.failOnError = false |
48 | 52 |
|
49 | 53 | publishing { |
50 | | - publications { |
51 | | - mainJava(MavenPublication) { |
52 | | - from components.java |
53 | | - } |
54 | | - sourcesJava(MavenPublication) { |
55 | | - from components.java |
56 | | - artifact sourcesJar |
57 | | - } |
58 | | - mavenJavadoc(MavenPublication) { |
59 | | - artifact javadocJar |
| 54 | + publications { |
| 55 | + mainJava(MavenPublication) { |
| 56 | + from components.java |
| 57 | + } |
| 58 | + sourcesJava(MavenPublication) { |
| 59 | + from components.java |
| 60 | + artifact sourcesJar |
| 61 | + } |
| 62 | + mavenJavadoc(MavenPublication) { |
| 63 | + artifact javadocJar |
| 64 | + } |
60 | 65 | } |
61 | | - } |
62 | 66 | } |
63 | 67 |
|
64 | 68 | if (project.hasProperty("myBintrayUser")) { |
65 | | - bintray { |
66 | | - user = myBintrayUser |
67 | | - key = myBintrayKey |
68 | | - publications = ["mainJava", "sourcesJava", "mavenJavadoc"] |
69 | | - pkg { |
70 | | - repo = "maven" |
71 | | - name = project.name |
72 | | - licenses = ["Apache-2.0"] |
73 | | - vcsUrl = "https://github.com/marklogic-community/" + project.name + ".git" |
74 | | - version { |
75 | | - name = project.version |
76 | | - released = new Date() |
77 | | - } |
| 69 | + bintray { |
| 70 | + user = myBintrayUser |
| 71 | + key = myBintrayKey |
| 72 | + publications = ["mainJava", "sourcesJava", "mavenJavadoc"] |
| 73 | + pkg { |
| 74 | + repo = "maven" |
| 75 | + name = project.name |
| 76 | + licenses = ["Apache-2.0"] |
| 77 | + vcsUrl = "https://github.com/marklogic-community/" + project.name + ".git" |
| 78 | + version { |
| 79 | + name = project.version |
| 80 | + released = new Date() |
| 81 | + } |
| 82 | + } |
78 | 83 | } |
79 | | - } |
80 | 84 | } |
81 | 85 |
|
82 | 86 | task copyTableauSourceFiles(type: Copy, group: taskGroup) { |
83 | | - description = "Copy Tableau-dependent source files into the main source directory so they can be compiled and packaged into a jar for publishing. " + |
84 | | - "You'll first need to add the Tableau jars to the 'dependencies' block as described in src/tableau/README.md ." |
85 | | - from "src/tableau/main/java" |
86 | | - into "src/main/java" |
| 87 | + description = "Copy Tableau-dependent source files into the main source directory so they can be compiled and packaged into a jar for publishing. " + |
| 88 | + "You'll first need to add the Tableau jars to the 'dependencies' block as described in src/tableau/README.md ." |
| 89 | + from "src/tableau/main/java" |
| 90 | + into "src/main/java" |
87 | 91 | } |
88 | 92 |
|
89 | 93 | task createTableauPublication(group: taskGroup) { |
90 | | - description = "Publish a version of ${project.name} that includes the Tableau-dependent source files under src/tableau/main/java" |
91 | | - dependsOn = ["copyTableauSourceFiles", "publishToMavenLocal"] |
92 | | - doLast { |
93 | | - println "Version ${version} of ${project.name} has been published to your local Maven repository, which defaults to ~/.m2/repository." |
94 | | - println "You can depend on this artifact in another Gradle project by adding mavenLocal() to your list of repositories." |
95 | | - } |
| 94 | + description = "Publish a version of ${project.name} that includes the Tableau-dependent source files under src/tableau/main/java" |
| 95 | + dependsOn = ["copyTableauSourceFiles", "publishToMavenLocal"] |
| 96 | + doLast { |
| 97 | + println "Version ${version} of ${project.name} has been published to your local Maven repository, which defaults to ~/.m2/repository." |
| 98 | + println "You can depend on this artifact in another Gradle project by adding mavenLocal() to your list of repositories." |
| 99 | + } |
96 | 100 | } |
97 | 101 | publishToMavenLocal.mustRunAfter copyTableauSourceFiles |
| 102 | + |
| 103 | +// See https://github.com/snyk/gradle-plugin for more information |
| 104 | +snyk { |
| 105 | + //arguments = '--all-sub-projects' |
| 106 | + severity = 'low' |
| 107 | + api = snykToken |
| 108 | + autoDownload = true |
| 109 | + autoUpdate = true |
| 110 | +} |
0 commit comments