Set Up Gradle for Different Environments

You can set up the MarkLogic Server and Data Hub in multiple environments (e.g., development, QA, production, local). Before running ml-gradle tasks for a specific environment, you must set up a properties file for that environment.

Before you begin

You need:

Procedure

  1. Create a properties file with a filename in the format gradle-env.properties, where env is the environment the file is intended for.

    Examples:

    • For a development environment, create a file called gradle-dev.properties.
    • For a QA environment, create a file called gradle-qa.properties.
    • For a production environment, create a file called gradle-prod.properties.

    By default, Data Hub uses gradle-local.properties for your local environment.

  2. Enter the environment-specific property settings inside the appropriate properties file. The contents of these environment files will override any values set in the gradle.properties file.
  3. To specify an environment at runtime, use the -PenvironmentName=xxx option.
    Example: To run a Gradle command against the production (prod) environment,
    ./gradlew taskname ... -PenvironmentName=prod ... -igradlew.bat taskname ... -PenvironmentName=prod ... -i