-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (95 loc) · 3.89 KB
/
build.gradle
File metadata and controls
110 lines (95 loc) · 3.89 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
buildscript {
ext {
springBootVersion = '1.2.4.RELEASE'
springLoadedVersion = '1.2.3.RELEASE'
mlGradleVersion = '0.9.9'
}
repositories {
mavenCentral()
maven {url "http://developer.marklogic.com/maven2/"}
maven {url "http://rjrudin.github.io/marklogic-java/releases"}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.springframework:springloaded:${springLoadedVersion}")
classpath("com.marklogic:ml-gradle:${mlGradleVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: 'ml-gradle'
sourceCompatibility = 1.7
mainClassName = "de.nava.mlsample.MarkLogicSampleApplication"
springBoot {
classifier = 'exec'
}
war {
baseName = 'springboot-marklogic-sample'
version = '0.1.4'
}
repositories {
mavenCentral()
maven {url "http://developer.marklogic.com/maven2"}
maven {url "http://rjrudin.github.io/marklogic-java/releases"}
// for resolving mlcp -> hadoop
maven {url "http://repository.cloudera.com/artifactory/cloudera-repos/"}
}
// Specify own classpath for running corb and mlcp jobs via Gradle tasks
configurations {
runtimeCorb
mlcp
}
dependencies {
// Support for full-stack web development, including Tomcat and spring-webmvc
compile("org.springframework.boot:spring-boot-starter-freemarker")
// Adds production ready features such as metrics and monitoring
compile("org.springframework.boot:spring-boot-starter-actuator")
// MarkLogic Client API
compile("com.marklogic:client-api-java:2.0.4")
// Support for common test dependencies (including JUnit, Hamcrest and Mockito)
testCompile("org.springframework.boot:spring-boot-starter-test")
// For triggering CORB on MarkLogic Server
runtimeCorb("com.marklogic:corb:1.0")
// inclusion of ml-java will make direct reference to XCC obsolete
runtimeCorb("com.marklogic:marklogic-xcc:7.0.4")
// content pump
mlcp("com.marklogic:mlcp-Hadoop2:1.2-3") { exclude module:"commons-modeler" }
mlcp("commons-modeler:commons-modeler:2.0") { transitive = false }
}
task wrapper(type: Wrapper) { gradleVersion = '1.6' }
ext {
// This property is used for grouping all the custom tasks in this file so that they appear together when "gradle tasks" is run.
taskGroup = "Sample project" // TODO: "tasks" already prepended
}
// Path to definition of database indexes
mlMergeDatabasePackages.mergePackageFilePaths = ["src/main/xqy/packages/content-database.xml"]
/*
* This is an example of both a custom Gradle task and an easy way of invoking Corb. This depends on "classes" to ensure
* that the Corb dependency is retrieved and on "mlLoadModules" to ensure that the Corb uris/transform modules are
* loaded.
*/
task corb(dependsOn: ['mlLoadModules'], type: JavaExec, group: taskGroup) {
main = 'com.marklogic.developer.corb.Manager'
classpath = configurations.runtimeCorb
args = [mlAppConfig.xccUrl, '""', 'transform.xqy', '4', 'uris.xqy', '/ext/corb/', 'springboot-demo-modules', 'false']
}
task createUser(type: com.marklogic.gradle.task.security.CreateUserTask, group: taskGroup) {
username = "sample-project-user"
userDescription = "Sample project user"
password = "password"
roleNames = ["alert-user", "rest-admin"]
collections = ["default-collection"]
permissionRoles = ["rest-reader", "rest-writer"]
permissionCapabilities = ["read", "update"]
}
// For documentation of the the mlcp options please see the original documentation
// http://docs.marklogic.com/guide/ingestion/content-pump#id_87699
task importViaContentPump(type: com.marklogic.gradle.task.MlcpTask, group: taskGroup) {
classpath = configurations.mlcp
command = "IMPORT"
input_file_path = "/path/to/file"
args = ["-document_type", "text"]
}