Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit a02f174

Browse files
authored
Merge pull request #246 from sastafford/dev
Dev
2 parents 891a6b8 + 693ce43 commit a02f174

File tree

139 files changed

+4268
-5701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+4268
-5701
lines changed

build.gradle

Lines changed: 18 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ buildscript {
1313

1414
plugins {
1515
id "com.marklogic.ml-gradle" version "3.0.0"
16-
id "java"
17-
id "eclipse"
18-
id "idea"
19-
id "checkstyle"
20-
id "maven-publish"
2116
}
2217

18+
mlPostDeploy.dependsOn ":mlJobRepo:deployMarkLogicJobRepository"
19+
mlUndeploy.dependsOn "mlJobRepo:undeployMarkLogicJobRepository"
20+
2321
allprojects {
2422
repositories {
2523
jcenter()
@@ -29,27 +27,26 @@ allprojects {
2927
}
3028

3129
task wrapper(type: Wrapper) {
32-
gradleVersion = '4.1'
30+
gradleVersion = '4.3'
3331
}
34-
35-
sourceSets.test.resources.srcDir 'src/test/java'
3632
}
3733

3834

3935
subprojects {
4036

37+
apply plugin: "java"
38+
apply plugin: "maven-publish"
39+
apply plugin: "idea"
40+
apply plugin: "checkstyle"
41+
4142
/*
42-
* Not applying the bintray plugin. Couldn't get it working properly when declared
43-
* in subprojects, and when declared at root level of this script, it caused an httpcomponents
44-
* classpath issue with ml-gradle in the core project. So for now, each project has to
45-
* duplicate bintray publishing configuration.
43+
* multi project builds must apply the bintray plugin
44+
* and the plugin configuration to every project which
45+
* its artifacts you wish to publish to bintray.
4646
*/
4747

48-
apply plugin: "java"
49-
50-
if (it.name in ["core", "infrastructure", "test"]) {
48+
if (it.name in ["core", "infrastructure", "test", "http"]) {
5149
apply plugin: "com.jfrog.bintray"
52-
apply plugin: 'maven-publish'
5350
}
5451

5552
ext {
@@ -58,14 +55,11 @@ subprojects {
5855
}
5956

6057
dependencies {
61-
compile 'ch.qos.logback:logback-classic:1.1.8'
62-
compile 'org.slf4j:slf4j-api:1.7.21'
63-
compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
64-
compile "com.marklogic:marklogic-client-api:4.0.2"
65-
compile "com.marklogic:ml-javaclient-util:3.0.0"
58+
compile "org.slf4j:slf4j-api:1.7.25"
59+
compile "org.slf4j:slf4j-log4j12:1.7.25"
60+
compile "org.apache.logging.log4j:log4j-api:2.9.1"
6661

67-
testCompile "org.springframework.batch:spring-batch-test:$springBatchVersion"
68-
testCompile "com.marklogic:ml-junit:3.0.0"
62+
testCompile "junit:junit:4.12"
6963
}
7064

7165
sourceCompatibility = 1.8
@@ -76,7 +70,7 @@ subprojects {
7670
toolVersion = '7.1.2'
7771
}
7872

79-
if (it.name in ["core", "infrastructure", "test"]) {
73+
if (it.name in ["core", "infrastructure", "test", "http"]) {
8074
task sourcesJar(type: Jar, dependsOn: classes) {
8175
baseName = artifactId
8276
version = project.version
@@ -104,161 +98,5 @@ subprojects {
10498
}
10599
}
106100
}
107-
108-
109101
}
110102

111-
project(':core') {
112-
113-
dependencies {
114-
//core doesn't depend on infrastructure but want to grab both jars when importing MSB
115-
compile project(":infrastructure")
116-
117-
// Used by ML Job Repo implementation; depends on DataFieldMaxValueIncrementer
118-
compile "org.springframework:spring-jdbc:$springVersion"
119-
120-
// Used by MarkLogicBatchConfiguration, which depends on Jaxb2Marshaller
121-
compile "org.springframework:spring-oxm:$springVersion"
122-
123-
// For the CLI
124-
compile "net.sf.jopt-simple:jopt-simple:5.0.1"
125-
126-
testCompile project(":test")
127-
128-
runtime "org.springframework.batch:spring-batch-core:$springBatchVersion"
129-
130-
runtime "org.springframework:spring-jdbc:$springVersion"
131-
132-
runtime "net.sf.jopt-simple:jopt-simple:5.0.1"
133-
}
134-
135-
}
136-
137-
project(":infrastructure") {
138-
description = 'MarkLogic Spring Batch Infrastructure'
139-
dependencies {
140-
compile "org.springframework:spring-jdbc:$springVersion"
141-
compile "org.apache.commons:commons-lang3:3.5"
142-
testCompile project(':test')
143-
}
144-
}
145-
146-
project(':test') {
147-
dependencies {
148-
compile project(':infrastructure')
149-
compile project(':core')
150-
compile "org.springframework.batch:spring-batch-test:$springBatchVersion"
151-
compile "com.marklogic:ml-junit:3.0.0"
152-
// For detecting version of MarkLogic
153-
compile "com.marklogic:ml-app-deployer:3.0.0"
154-
}
155-
}
156-
157-
project(':samples') {
158-
apply plugin: "application"
159-
160-
dependencies {
161-
compile project(':core')
162-
compile project(':infrastructure')
163-
testCompile project(':test')
164-
165-
// For importing images and extracting text from binaries
166-
compile "org.apache.tika:tika-parsers:1.13"
167-
}
168-
169-
distributions {
170-
main {
171-
baseName = "samples"
172-
}
173-
}
174-
175-
jar {
176-
baseName = "samples"
177-
}
178-
179-
mainClassName = "com.marklogic.spring.batch.core.launch.support.CommandLineJobRunner"
180-
181-
applicationName = "samples"
182-
183-
task runYourJob(type: JavaExec) {
184-
main = 'com.marklogic.spring.batch.core.launch.support.CommandLineJobRunner'
185-
classpath = sourceSets.test.runtimeClasspath
186-
args = ["--job_path", "com.marklogic.spring.batch.samples.JobsConfig",
187-
"--job_id", "job",
188-
"--output_collections", "runYourJob",
189-
"--next"]
190-
}
191-
}
192-
193-
project(':mlJobRepo') {
194-
apply plugin: "application"
195-
196-
//Needed for mlInit, mlInstallAdmin
197-
apply plugin: "com.marklogic.ml-gradle"
198-
199-
task deployMarkLogicJobRepository(type: JavaExec) {
200-
classpath = sourceSets.main.runtimeClasspath
201-
main = 'com.marklogic.spring.batch.DeployMarkLogicJobRepository'
202-
args = ["--name", mlJobRepositoryName, "--host", mlHost, "--port", mlRestPort, "--username", mlManageUsername, "--password", mlManagePassword]
203-
}
204-
205-
task undeployMarkLogicJobRepository(type: JavaExec) {
206-
classpath = sourceSets.main.runtimeClasspath
207-
main = 'com.marklogic.spring.batch.DeployMarkLogicJobRepository'
208-
args = ["--undeploy", "--name", mlJobRepositoryName, "--host", mlHost, "--port", mlRestPort, "--username", mlManageUsername, "--password", mlManagePassword]
209-
}
210-
211-
// Setup the Job Repo in our test application so it's available for use by tests.
212-
mlPostDeploy.dependsOn deployMarkLogicJobRepository
213-
mlUndeploy.dependsOn undeployMarkLogicJobRepository
214-
215-
dependencies {
216-
// For deploying the ML Job Repo
217-
compile "com.marklogic:ml-app-deployer:3.0.0"
218-
219-
// For the CLI
220-
compile "net.sf.jopt-simple:jopt-simple:5.0.1"
221-
}
222-
223-
mainClassName = "com.marklogic.spring.batch.DeployMarkLogicJobRepository"
224-
225-
}
226-
227-
project(":rdf") {
228-
description = 'MarkLogic Spring Batch Infrastructure: Triples'
229-
dependencies {
230-
// For importing RDF
231-
compile('org.apache.jena:jena-arq:2.13.0') {
232-
exclude(group: 'org.slf4j')
233-
exclude(group: 'ch.qos.logback')
234-
exclude(group: 'log4j')
235-
}
236-
compile('org.apache.jena:jena-core:2.13.0') {
237-
exclude(group: 'org.slf4j')
238-
exclude(group: 'xerces')
239-
exclude(group: 'commons-cli')
240-
}
241-
compile('com.hp.hpl.jena:jena:2.6.4') {
242-
exclude(group: 'org.slf4j')
243-
}
244-
compile('com.marklogic:marklogic-jena:1.0.0'){
245-
changing=true
246-
exclude(group: 'org.slf4j')
247-
exclude(group: 'log4j')
248-
exclude(group: 'ch.qos.logback')
249-
}
250-
251-
testCompile project(':test')
252-
}
253-
254-
}
255-
256-
project (':shapefiles') {
257-
258-
dependencies {
259-
compile "org.apache.httpcomponents:httpmime:4.5.2"
260-
compile project(':infrastructure')
261-
testCompile project(':test')
262-
}
263-
264-
}

circle.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ machine:
22
services:
33
- docker
44
java:
5+
version: oraclejdk8
56

67
dependencies:
78
override:
@@ -16,15 +17,15 @@ dependencies:
1617

1718
test:
1819
override:
19-
- docker run --hostname grover --name ml -d -p 8000:8000 -p 8001:8001 -p 8002:8002 -p 8200:8200 $DOCKER_MARKLOGIC_IMAGE
20+
- docker run --hostname grover --name ml -d -p 8000:8000 -p 8001:8001 -p 8002:8002 -p 8200:8200 -p 8201:8201 $DOCKER_MARKLOGIC_IMAGE
2021
- sleep 10
2122
#- git lfs env
2223
#- git lfs pull
2324
- pwd
2425
- chmod +x gradlew
25-
- ./gradlew :mlJobRepo:mlInit -PmlHost=localhost --info
26-
- ./gradlew :mlJobRepo:mlInstallAdmin -PmlHost=localhost -PmlAdminPassword=admin -PmlAdminUsername=admin --info
27-
- ./gradlew :mlJobRepo:mlDeploy -PmlHost=localhost --info
26+
- ./gradlew mlInit -PmlHost=localhost --info
27+
- ./gradlew mlInstallAdmin -PmlHost=localhost -PmlAdminPassword=admin -PmlAdminUsername=admin --info
28+
- ./gradlew mlDeploy -PmlHost=localhost --info
2829
- ./gradlew test --info
2930

3031
post:

core/build.gradle

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
jar {
2-
manifest {
3-
attributes(
4-
'Main-Class': 'com.marklogic.spring.batch.Main'
5-
)
6-
}
7-
}
1+
dependencies {
2+
//core doesn't depend on infrastructure but want to grab both jars when importing MSB
3+
compile project(":infrastructure")
4+
5+
// For the CommandLineInterface main program
6+
compile "net.sf.jopt-simple:jopt-simple:5.0.1"
7+
8+
compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
9+
compile "com.marklogic:marklogic-client-api:4.0.3"
10+
compile "com.marklogic:ml-javaclient-util:3.0.0"
811

12+
testCompile "org.springframework.batch:spring-batch-test:$springBatchVersion"
13+
testCompile "com.marklogic:ml-junit:3.0.0"
14+
15+
// Used by marshall/unmarshall tests, which depends on Jaxb2Marshaller
16+
testCompile "org.springframework:spring-oxm:$springVersion"
17+
testCompile project(":test")
18+
19+
runtime "org.springframework.batch:spring-batch-core:$springBatchVersion"
20+
runtime "net.sf.jopt-simple:jopt-simple:5.0.1"
21+
}
922

1023
bintray {
1124
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
19 Bytes
Binary file not shown.

core/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip
Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
package com.marklogic.spring.batch.bind;
22

3-
import javax.xml.bind.annotation.adapters.XmlAdapter;
4-
3+
import com.marklogic.spring.batch.core.AdaptedJobInstance;
54
import org.springframework.batch.core.JobInstance;
5+
import org.springframework.batch.core.JobParameters;
66

7-
import com.marklogic.spring.batch.core.AdaptedJobInstance;
7+
import javax.xml.bind.annotation.adapters.XmlAdapter;
88

99
public class JobInstanceAdapter extends XmlAdapter<AdaptedJobInstance, JobInstance> {
1010

11-
@Override
12-
public JobInstance unmarshal(AdaptedJobInstance v) throws Exception {
13-
JobInstance jobInstance = new JobInstance(v.getId(), v.getJobName());
14-
jobInstance.setVersion(v.getVersion());
15-
return jobInstance;
16-
}
17-
18-
@Override
19-
public AdaptedJobInstance marshal(JobInstance v) throws Exception {
20-
return new AdaptedJobInstance(v);
21-
}
11+
private JobParameters jobParameters;
12+
13+
public JobInstanceAdapter() {
14+
15+
}
16+
17+
public JobInstanceAdapter(JobParameters jobParameters) {
18+
this.jobParameters = jobParameters;
19+
}
20+
21+
@Override
22+
public JobInstance unmarshal(AdaptedJobInstance v) throws Exception {
23+
JobInstance jobInstance = new JobInstance(v.getId(), v.getJobName());
24+
jobInstance.setVersion(v.getVersion());
25+
return jobInstance;
26+
}
27+
28+
@Override
29+
public AdaptedJobInstance marshal(JobInstance v) throws Exception {
30+
AdaptedJobInstance aji = new AdaptedJobInstance(v);
31+
if (!(jobParameters == null)) {
32+
aji.setJobKey(jobParameters);
33+
}
34+
return aji;
35+
}
2236

2337
}

0 commit comments

Comments
 (0)