forked from marklogic/ml-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
I. Quick Start
kghmanuel edited this page Jan 12, 2018
·
3 revisions
-
- consider at least skimming through some of the following Gradle docs to get a little familiar with it:
-
- At least MarkLogic 8.0-4
- This tutorial assumes you have installed MarkLogic on localhost.
- Create a new folder to contain your project
- for this tutorial, let's use 'petstore'.
- Move into the project
- Initiate the build.gradle file.
- You can use gradle init and add the lines below accordingly;
- Or, create the file manually and add the lines below.
build.gradle
plugins {
id "net.saliman.properties" version "1.4.6"
id "com.marklogic.ml-gradle" version "3.3.0"
}
Above is a Groovy snippet to declare we are using the ml-gradle plugin. (why Groovy?)
- Creating our initial project configuration file.
gradle mlNew
This process will ask you several questions to help stub out a new project.
[ant:input] Application name: [myApp]
[ant:input] Host to deploy to: [localhost]
[ant:input] MarkLogic admin username: [admin]
[ant:input] MarkLogic admin password: [admin]
[ant:input] REST API port (leave blank for no REST API server):
[ant:input] Test REST API port (intended for running automated tests; leave blank for no server):
[ant:input] Do you want support for multiple environments? ([y], n)
[ant:input] Do you want resource files for a content database and set of users/roles created? ([y], n)
- Supply 'petstore' as "Application name"
- Selecting 'y' to "multiple environments" will pre-create properties files that could be modified accordingly. Refer to the plugin documentation for more info about this plugin.
- Selecting 'y' to "resource files" will pre-create various resources under the src folder (also created if not available). We'll discuss these generated files more later.
- Deploy
gradle mlDeploy
You would see some logging like this at the end:
:mlDeleteModuleTimestampsFile
:mlPrepareRestApiDependencies
:mlDeployApp
:mlPostDeploy UP-TO-DATE
:mlDeploy
BUILD SUCCESSFUL
Total time: 22.518 secs
- Verify
You should now have the following items as you reload your admin UI (i.e. :8001)
- Under Databases:
- petstore-content
- petstore-modules
- petstore-test-content
- Under App Servers:
- petstore (8003) -- or whatever port was specified above
- petstore-test (8004) -- or whatever port was specified above
- Under Forests:
- petstore-content-1 to 3
- petstore-modules-1
- petstore-content-test-1 to 3
- Under Security:
- roles: petstore-proj-admin, petstore-proj-internal, petstore-proj-nobody, petstore-proj-reader, petstore-proj-writer
- users: petstore-admin, petstore-reader, petstore-writer
- Under Databases:
Congratulations! You now have your project wired and ready to go!