Creating Marklogic Forest using ML Gradle

224 Views Asked by At

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": "new-forestName",
"enabled": true,
"database": "db-name-content",
"data-directory": "D:\\folderName"
 }

Problem is when I try to deploy using "data-directory": "D:\\folderName" it fails, am I going anything wrong?

I can achieve the same using mlForestDataDirectory=D:\\folderName in gradle properties, but I want to take this bit out of global property file as other forest will be pointing to different locations on separate drives.

Thanks for your help

Here is the console error:

enter image description here

1

There are 1 best solutions below

0
On

The error message:

Unable to parse JSON: Unrecognized character escape M (code 77)

is telling you that your JSON is invalid and that the evaluated value for the data-directory is D:\ML-DB.

It seems that it is being processed twice, turning D:\\ML-DB into D:\ML-DB and then interpreting that as an escaped M.

You could either:

  • double the backslashes D:\\\\ML-DB
  • or consider using forward slashes for the path separator D:/ML-DB