Skip to content

Commit 4cbb7bc

Browse files
authored
Merge pull request #685 from marklogic/dev
Merge dev to master for 4.6.1
2 parents bef94da + db47ccc commit 4cbb7bc

File tree

63 files changed

+114
-260
lines changed

Some content is hidden

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

63 files changed

+114
-260
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ First, [install Gradle](https://gradle.org/install/).
4747

4848
Then, in an empty directory, create a file named "build.gradle" with your favorite text editor and enter the following:
4949

50-
plugins { id "com.marklogic.ml-gradle" version "4.6.0" }
50+
plugins { id "com.marklogic.ml-gradle" version "4.6.1" }
5151

5252
Then run:
5353

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
}
1414

1515
group = "com.marklogic"
16-
version = "4.6.0"
16+
version = "4.6.1"
1717

1818
java {
1919
sourceCompatibility = 1.8
@@ -32,7 +32,7 @@ dependencies {
3232
implementation gradleApi()
3333
implementation localGroovy()
3434

35-
api 'com.marklogic:ml-app-deployer:4.6.0'
35+
api 'com.marklogic:ml-app-deployer:4.6.1'
3636
implementation "com.marklogic:mlcp-util:1.0.1"
3737
implementation "com.marklogic:marklogic-data-movement-components:2.7.0"
3838
implementation "commons-io:commons-io:2.11.0"

examples/alert-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "eclipse"
4-
id "com.marklogic.ml-gradle" version "4.6.0"
4+
id "com.marklogic.ml-gradle" version "4.6.1"
55
}
66

77
repositories {

examples/corb2-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222

2323
plugins {
24-
id "com.marklogic.ml-gradle" version "4.6.0"
24+
id "com.marklogic.ml-gradle" version "4.6.1"
2525
}
2626

2727
repositories {

examples/cpf-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "eclipse"
4-
id "com.marklogic.ml-gradle" version "4.6.0"
4+
id "com.marklogic.ml-gradle" version "4.6.1"
55
}
66

77
repositories {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
plugins {
2-
id "com.marklogic.ml-gradle" version "4.6.0"
2+
id "com.marklogic.ml-gradle" version "4.6.1"
33
}

examples/custom-rest-rewriter-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id "com.marklogic.ml-gradle" version "4.6.0"
2+
id "com.marklogic.ml-gradle" version "4.6.1"
33
}
44

55
task generateCustomRewriterModules {

examples/data-services/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "net.saliman.properties" version "1.5.1"
4-
id "com.marklogic.ml-gradle" version "4.6.0"
4+
id "com.marklogic.ml-gradle" version "4.6.1"
55
id 'com.marklogic.ml-development-tools' version '6.0.0'
66
}
77

examples/dependency-project/README.md

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
This set of projects demonstrates:
22

3-
- How a "provider" project can publish a zip of MarkLogic files (modules, data, schemas, or system plugins)
4-
- How an ml-gradle or DHF project can depend on this zip so that the files are automatically included
5-
in an application
3+
- How a "provider" project can publish a zip of MarkLogic files (modules, data, schemas, or system plugins).
4+
- How an ml-gradle project can depend on this zip so that the files are automatically included in an application.
65

76
## Publishing the provider
87

9-
To try this out, you'll first need Gradle installed locally.
10-
11-
Then, begin by publishing the zip from the provider project:
8+
To try this out, begin by publishing the zip from the provider project:
129

1310
cd provider-project
14-
gradle publishToMavenLocal
11+
../../gradlew publishToMavenLocal
1512

16-
If you'd like to inspect the zip, you'll find it at ~/.m2/repository/com/marklogic/example-dependency.
13+
If you'd like to inspect the zip, you'll find it at `~/.m2/repository/com/marklogic/example-dependency`.
1714

1815
## Deploying and verifying the ml-gradle project
1916

2017
Next, deploy the app in the ml-gradle-client-project, replacing "changeme" below with the password for your admin user
2118
(or using a different admin-like user):
2219

2320
cd ../ml-gradle-client-project
24-
gradle -i mlDeploy -PmlUsername=admin -PmlPassword=change
21+
../../gradlew -i mlDeploy -PmlUsername=admin -PmlPassword=change
2522

2623
You'll see logging like this that lets you know that the modules and data from the example-dependency zip
2724
will be included when the application is deployed:
@@ -32,7 +29,6 @@ Found mlBundle configuration, will extract all of its dependencies to build/mlBu
3229
Finished extracting mlBundle dependencies
3330
Module paths including mlBundle paths: [/Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/build/mlBundle/example-dependency/ml-modules, /Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/src/main/ml-modules]
3431
Data paths including mlBundle paths: [/Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/build/mlBundle/example-dependency/ml-data, /Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/src/main/ml-data]
35-
Plugin paths including mlBundle paths: [/Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/build/mlBundle/example-dependency/ml-plugins, /Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/src/main/ml-plugins]
3632
Schema paths including mlBundle paths: [/Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/build/mlBundle/example-dependency/ml-schemas, /Users/rrudin/dev/workspace/ml-gradle/examples/dependency-project/ml-gradle-client-project/src/main/ml-schemas]
3733
:mlPrepareBundles (Thread[Task worker for ':',5,main]) completed. Took 0.059 secs.
3834
```
@@ -60,16 +56,6 @@ Shutting down ExecutorService
6056
Writing 2 documents to MarkLogic; port: 8030
6157
```
6258

63-
And also some logging like this that indicates that a system plugin was installed:
64-
65-
```
66-
Writing plugin zip file to URI: /com.marklogic/plugins/varianceplugin.zip
67-
Writing content for /com.marklogic/plugins/varianceplugin.zip
68-
Installing plugin with scope 'native' from URI: /com.marklogic/plugins/varianceplugin.zip
69-
Installed plugin with scope 'native', result: 1
70-
Finished executing command [com.marklogic.appdeployer.command.plugins.InstallPluginsCommand]
71-
```
72-
7359
And finally, some logging like this that indicates that schemas were loaded:
7460

7561
```
@@ -86,47 +72,15 @@ Writing 1 documents to MarkLogic; port: 8000; database: ml-gradle-client-schemas
8672

8773
You can then use qconsole to verify that the following documents were inserted:
8874

89-
- In ml-gradle-client-modules: /example.sjs (in addition to the modules included by this project: /my-lib.xqy and /Default/ml-gradle-client/rest-api/properties.xml)
90-
- In ml-gradle-client-schemas: /tde/template1.json (in addition to the schema file included in this project: /tde/my-template.json)
91-
- In ml-gradle-client-content: /example/data1.json and /example/data2.json (in addition to the data files including
92-
in this project: /testdata/test1.json, /testdata/test2.json, and /testdata/test3.json)
93-
- In Extensions: /native/scope.xml, /native/varianceplugin/libvarianceplugin.dylib, and /native/varianceplugin/manifest.xml
94-
95-
Note that ml-gradle-client-content also contains the plugin zip file at /com.marklogic/plugins/varianceplugin.zip . If
96-
you don't want that to remain, you can use a custom Gradle task to delete it after the deployment, or use the
97-
mlPluginDatabaseName property to store the zip file in a different database.
98-
99-
You can also verify that the plugin was installed correctly by running the following task:
100-
101-
gradle testPlugin
102-
103-
Which should return:
104-
105-
```
106-
> Task :testPlugin
107-
66.6666666666667
108-
```
75+
- In ml-gradle-client-modules: `/example.sjs` (in addition to the modules included by this project: `/my-lib.xqy` and `/Default/ml-gradle-client/rest-api/properties.xml`).
76+
- In ml-gradle-client-schemas: `/tde/template1.json` (in addition to the schema file included in this project: `/tde/my-template.json`).
77+
- In ml-gradle-client-content: `/example/data1.json` and `/example/data2.json` (in addition to the data files including
78+
in this project: `/testdata/test1.json`, `/testdata/test2.json`, and `/testdata/test3.json`).
10979

11080
See [Loading data](https://github.com/marklogic/ml-app-deployer/wiki/Loading-data) for more
11181
information on configuring how data is loaded during a deployment.
11282

83+
## Provider project with system plugin
11384

114-
## Deploying and verifying the DHF project
115-
116-
The DHF project is deployed the same way as the ml-gradle project, though you'll first need to run hubInit to
117-
initialize the project (this is to avoid adding a bunch of DHF files to version control that aren't needed for
118-
the purposes of this example):
119-
120-
cd ../dhf-client-project
121-
gradle -i mlDeploy
122-
123-
You'll see the same logging as shown above for the ml-gradle project. And likewise, you can use qconsole
124-
to verify that the following documents were inserted:
125-
126-
- In dhf-client-MODULES: /example.sjs
127-
- In dhf-client-FINAL: /example/data1.json, /example/data2.json
128-
129-
Note that in a DHF project, the final database is equivalent to the default content database in an ml-gradle
130-
project. Thus, data is loaded by default to the final database. This can be overridden via the
131-
mlDataDatabaseName property.
132-
85+
The `./provider-with-plugin-project` directory is included as a reference for including a MarkLogic system plugin
86+
in a bundle. Building this plugin requires a C++ compiler, so it is not included in `./provider-project`.

examples/dependency-project/dhf-client-project/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/build.gradle

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/gradle.properties

Lines changed: 0 additions & 53 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/src/main/ml-data/testdata/test1.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/src/main/ml-data/testdata/test2.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/src/main/ml-data/testdata/test3.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/dependency-project/dhf-client-project/src/main/ml-modules/root/my-lib.xqy

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/dependency-project/dhf-client-project/src/main/ml-schemas/tde/my-template.json

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
1-
//buildscript {
2-
// repositories {
3-
// mavenCentral()
4-
// mavenLocal()
5-
// }
6-
// dependencies {
7-
// classpath "com.marklogic:ml-gradle:4.2.0"
8-
// }
9-
//}
10-
111
plugins {
122
id "net.saliman.properties" version "1.5.1"
13-
id "com.marklogic.ml-gradle" version "4.6.0"
3+
id "com.marklogic.ml-gradle" version "4.6.1"
144
}
155

16-
//apply plugin: "com.marklogic.ml-gradle"
17-
186
repositories {
197
mavenLocal()
208
}
219

2210
dependencies {
2311
mlBundle "com.marklogic:example-dependency:1.0.0"
2412
}
25-
26-
task testPlugin(type: com.marklogic.gradle.task.ServerEvalTask) {
27-
description = "Run this to verify that the plugin from the example-dependency bundle was installed correctly; should get 66.67 as a result"
28-
javascript = "cts.aggregate('native/varianceplugin', 'variance', cts.elementReference(xs.QName('amount')))"
29-
}

examples/dependency-project/ml-gradle-client-project/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mlAppName=ml-gradle-client
2-
mlRestPort=8030
2+
mlRestPort=8037
33
mlContentForestsPerHost=2
44

55
# Define these in gradle-local.properties

examples/dependency-project/provider-project/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ task bundleJar(type: Jar) {
1919
from("src/main/ml-data") {
2020
into("example-dependency/ml-data")
2121
}
22-
from("src/main/ml-plugins") {
23-
into("example-dependency/ml-plugins")
24-
}
2522
from("src/main/ml-schemas") {
2623
into("example-dependency/ml-schemas")
2724
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugins {
2+
id "maven-publish"
3+
}
4+
5+
group = "com.marklogic"
6+
version = "1.0.0"
7+
8+
configurations {
9+
bundle
10+
}
11+
12+
task bundleJar(type: Jar) {
13+
from("src/main/ml-plugins") {
14+
into("example-dependency/ml-plugins")
15+
}
16+
destinationDirectory = file("build/libs")
17+
archiveBaseName = "example-dependency-with-plugin"
18+
}
19+
20+
artifacts {
21+
bundle bundleJar
22+
}
23+
24+
publishing {
25+
publications {
26+
mainBundle(MavenPublication) {
27+
artifactId "example-dependency-with-plugin"
28+
artifact bundleJar
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)