-
Notifications
You must be signed in to change notification settings - Fork 80
Project layout
rjrudin edited this page Feb 5, 2018
·
11 revisions
By default, an ml-gradle project expects for files to be located in MarkLogic-specific directories consistent with the Maven standard layout. Those directories are:
- src/main/ml-config = Contains XML/JSON files for resources that an application needs deployed to MarkLogic (e.g. databases, users, roles, app servers). See the Resource reference for a complete list of supported resource types and their location under this directory.
- src/main/ml-modules = Contains files that should be loaded into an application's modules database. See How modules are loaded for more details.
- src/main/ml-schemas = Contains files that should be loaded into an application's schemas database. See Loading schemas for more details.
So a typical ml-gradle project with some basic resources and modules looks like this:
project_root
│ build.gradle
│ gradle.properties
└───src
└───main
├───ml-config
| rest-api.json
│ ├───databases
│ │ content-database.json
│ │
│ └───security
│ ├───roles
│ │ my-app-role.json
│ │
│ └───users
│ my-app-user.json
│
├───ml-modules
│ └───options
│ my-json-search-options.json
│ my-xml-search-options.xml
│ │
│ ├───root
│ │ my-javascript-module.sjs
│ │ my-xquery-module.xqy
│ │
│ └───services
│ my-javascript-service.sjs
│ my-xquery-service.xqy
│ │
│ └───transforms
│ my-javascript-transform.sjs
│ my-xslt-transform.xsl
│ my-xquery-transform.xqy
│
└───ml-schemas
my-template.json
An application is deployed by running mlDeploy. This will deploy all of the artifacts defined in these 3 directories. The Task reference defines tasks for deploying a specific resource type from ml-config, or for only deploying modules or schemas.
It's also typical for an ml-gradle project to use the Gradle properties plugin, and thus the project directory often has additional gradle-*.properties files:
project_root
│ build.gradle
│ gradle.properties
│ gradle-dev.properties
│ gradle-local.properties
│ gradle-qa.properties
│ gradle-prod.properties