Questions tagged [ml-gradle]

Gradle plugin for automating anything you can imagine with MarkLogic

github.com/marklogic/corb2https://github.com/marklogic-community/ml-gradle

What is ml-gradle?

ml-gradle is a Gradle plugin that supports a number of tasks pertaining to deploying an application to MarkLogic and interacting with other features of MarkLogic via a Gradle build file. The bulk of the functionality provided by ml-gradle is actually in ml-app-deployer - ml-gradle is just intended to be a thin wrapper around this library, exposing its functionality via Gradle tasks and properties.

Why use ml-gradle?

ml-gradle is a good fit for you and your team if:

  1. You're using MarkLogic 8
  2. You're using Gradle, or you're considering moving away from Ant/Maven/etc to Gradle to manage all of your build processes
  3. You'd like to use a build tool that can manage the dependencies and execution of MarkLogic tools such as the Java Client API, mlcp, corb, recordloader, xqsync
  4. You'd like to have a single all-purpose tool that allows you to define tasks to do anything you need to on your MarkLogic project, including tasks that have nothing to do with MarkLogic.

If you're currently using Ant or Maven and are wondering about Gradle, there are many comparisons of these tools on the Internet; I recommend making this shift. If you are using Ant, it's easy to invoke Ant tasks from Gradle. And if you can't move away from Maven, you can try this Maven plugin for invoking Gradle.

What are the main features of ml-gradle?

  1. Utilizes the new Management REST API in MarkLogic 8 to configure and deploy all aspects of an application.
  2. Can watch for new/modified modules and automatically load them for you, thus speeding up the code/build/test cycle
  3. Can run Content Pump, Corb, and other Java-based MarkLogic tools without having to copy jars around and worry about a classpath
  4. Can treat packages of MarkLogic code as true third-party dependencies, resolving them just like you would a dependency on a jar, as well as automatically loading such code into your modules database
  5. Can take advantage of all the features of Gradle

Related tags :

85 questions
1
vote
1 answer

Deploy a specific MarkLogic Database configuration using ml-gradle

Is there a CLI argument or parameter to deploy configuration of a particular database instead of deploying all the database configurations under src/main/ml-config/databases? e.g. when I use the gradle mlDeployDatabases command, it deploys all the…
1
vote
1 answer

mlUnitTest throws a java.nio.file.NoSuchFileException at the end of the tests

I try to use mlunitTest with ml-gradle 3.17.1 and Marklogic marklogic-unit-test-client:1.0.0 All the tests are OK, I test with my test user on the UI and with ml-gradle. But when ml-gradle wants to access the results in a directory…
1
vote
1 answer

Gradle task error : NullPointerException thrown while using ServerEvaluationCall to invoke xquery module

I am new to gradle and need to write a task for scheduling MarkLogic backup. So, I want to invoke an XQuery module that uses a config XML for getting details for backup. So I tried this : task mlBackupTask(type:…
Shabana
  • 121
  • 7
1
vote
1 answer

which port number is ml-gradle calling when performing a mlDeploy

Which is the port number is used by gradle internally while performing mlDeploy, mlRelaodModules, and mlLoadModules tasks in MarkLogic?
ramz123
  • 207
  • 1
  • 8
1
vote
1 answer

Adding permission for ml-data folder using ml-gradle

I'm using ml-gradle plugin to deploy the data and modules to a ML10 database. I have used mlModulePermissions property to set permissions for modules. Is there a similar property to set permissions for the files loaded from ml-data directory?
Antony
  • 183
  • 8
1
vote
1 answer

Is there a way to reverse generate the ml-gradle project configuration setting based on existing ML application server?

mlDeploy and mlUndeploy enable to rebuild the ML application from CI/CD. Using ml-gradle is the default way to manage new ML app server. That is great. How to migrate existing ML app to use ml-gradle to manage? How to automatically rebuild the ML…
1
vote
1 answer

how to read content of a xqy file in gradle and pass it to a gradle task as a string value?

I have a xqy file with path a/b/sample.xqy in ml-gradle project which is inserting a custom dictionary in to the DB. I want to run that xquery file as part of a gradle task. I am able to run the code by providing the code in string format but wanted…
ravvi
  • 117
  • 6
1
vote
0 answers

'GC overhead limit exceeded' error when running gradle mlExportBatchesToDirectory

I am receiving a 'GC overhead limit exceeded' error when running gradle mlExportBatchesToDirectory. The gradle command is: gradle mlExportBatchesToDirectory -PexportPath=/qa2/tgtfiles/Customer -PbatchSize=25000…
Hank
  • 131
  • 4
1
vote
1 answer

Setting total number of Marklogic forests for a database in ml-gradle

I'm currently working on configuring the resources like databases and app servers for an application using ml-gradle.These configurations would be deployed to ML10 environment. I have a content database and there are nine hosts in the environment. I…
Antony
  • 183
  • 8
1
vote
1 answer

Can I use mlDatabasesWithForestsOnOneHost with replicas?

mlPrintForestPlan gives an error when I try to use mlDatabasesWithForestsOnOneHost with replicas in a 3-node cluster. #…
Dave Cassel
  • 8,352
  • 20
  • 38
1
vote
1 answer

How to add prefix in URI while loading XQuery file using ml-gradle

I am using gradle 6.8 and MarkLogic version is 10.0-5.2, My XQuery code is in directory \ml-gradle\src\main\common. When I run the command mlLoadModules to load XQuery into the modules database it loads with default URI /common/test.xqy. I want to…
1
vote
1 answer

How to import a certificate's public and private keys via ml-gradle?

How can I add public and private keys for a certificate to a certificate template via ml-gradle? I'm trying to configure some new servers entirely via ml-gradle + DHF 5. I can set up the certificate templates by adding a configuration file to…
eaolson
  • 14,717
  • 7
  • 43
  • 58
1
vote
1 answer

How to use gradle mlExportToFile and REST Transform to Create NDJSON File

I am currently using gradle mlExportToFile to export json documents to a file. However, I need the final file to be in newline delimited JSON format, with each document on its own line within the file. I saw that the mlExportToFile + REST transform…
Hank
  • 131
  • 4
1
vote
1 answer

java.lang.IllegalStateException: Replacing an existing task that may have already been used by other plugins is not supported

I am using gradle6.7 and ml-gradle 4.1.0 version in my my project but i am getting error given below at the the time of Deployment: "java.lang.IllegalStateException: Replacing an existing task that may have already been used by other plugins is not…
1
vote
1 answer

Creating Marklogic Forest using ML Gradle

Currently I am setting up Marklogic instance using mlgradle to automate deployment process. I am creating a new custom forest based on json config file path (ml-config\forests\db-name\file.json) Here is the config: { "forest-name":…
subsoft
  • 99
  • 1
  • 8