Set the Security Credentials Using Gradle

Overview

MarkLogic Data Hub provides default roles:

Learn more: Users and Roles

The security role definitions are stored as JSON files in your local project directory under your-project-root/src/main/hub-internal-config/security/roles. Learn more: Project Structure

You can set the user credentials in the appropriate gradle*.properties file or you can specify them at the command line when running the Gradle task.

Before you begin

You need:

Procedure

  • Add or update the credentials in your gradle*.properties file.
       # You must update this username and password manually.
      # The recommended account to use is one assigned to flow-developer-role.
      mlUsername=flow-developer
      mlPassword=your-flow-developer-password
    
    • If the account is specific to an environment, add or update the credentials in gradle-env.properties, where env is the environment you are setting up.
    • If the same account is used in all environments, add or update the credentials in gradle.properties.
  • If you do not want to save the credentials in a file, you can specify the credentials when running the Gradle task at the command line.
    ./gradlew ... -PmlUsername=your-username -PmlPassword=your-password -igradlew.bat ... -PmlUsername=your-username -PmlPassword=your-password -i
    Remember: The credentials must be for a user with the appropriate role to perform the task.