Skip to content
rjrudin edited this page Jan 8, 2016 · 45 revisions

The pages on the right cover ml-gradle tasks and features for both ml-gradle 1 (for MarkLogic 7) and for ml-gradle 2 (for MarkLogic 8). Some notes on these pages:

  • "Common tasks" covers tasks that are present in both versions of ml-gradle.
  • The "Content Pump" and "Corb" pages cover how ml-gradle supports using these tools.
  • To extend ml-gradle with new functionality that utilizes the MarkLogic Management REST API, check out the "Writing your own management task" and "Writing your own command" pages.

Frequently Asked Questions

Where should I start to learn ml-gradle?

Start by examining the sample-project build file. The sample-project is intended to show many different features of ml-gradle in executable form with comments to explain what's going on. The examples directory includes several other projects to demonstrate other features of ml-gradle.

But how does ml-gradle really work?

See How ml-gradle works.

How do I override properties for local development?

Gradle reads all of its properties from a single file - gradle.properties. Typically, you'll have these properties default to values that are useful for local development. But sometimes, a developer may want to override some of them - but without modifying gradle.properties. Check out the sample-project build file for an example of how to apply a "local.gradle" file (note that this has nothing to do with ml-gradle, it's just a Gradle technique).

How do I override properties when deploying to a particular environment?

Similar to overriding properties for local development above, the sample-project build file has a technique for doing this. Again, this is not specific to ml-gradle, it's just a Gradle technique.

What are all the different ways to configure ml-gradle?

See Configuring ml-gradle.

How are the tokens set in configuration files?

The mlAppConfig.customTokens property in a build.gradle file translates to the customTokens Map on an instance of AppConfig in ml-app-deployer. For more information, see the ml-app-deployer Wiki page.

How do I add a new resource or transform?

See Creating a new resource and Creating a new transform.

How do I add a new set of search options?

You can put a search options file at src/main/ml-modules/options, and when you run "mlLoadModules", ml-gradle will automatically load each xml/json file in that directory. Each options file will then be available at /v1/config/query/(name of options file minus extension), as defined in the Client REST API docs. See the Search API docs for instructions on how to create a search options file.

How do I perform a deployment in an environment that doesn't have access to my dependency repositories?

The disconnected-project build file shows a non-ml-gradle-specific way of creating a package that can be used for offline/disconnected depoyments that don't depend on any repositories.

Do the names of configuration files matter?

They only matter for ordering purposes when ml-gradle processes each file in a directory. And so far, that only matters for roles - since a role can depend on another role, it's important that you can use the file name to control the order in which each file is processed (and the order is alphabetic). Otherwise, the name of the file has no bearing at all on what's actually sent to the management REST API - the contents of the file are what's read in and sent in the request.

How do I extend ml-gradle?

The easiest way to extend what ml-gradle can do is by writing your own commands and writing your own tasks.

Clone this wiki locally