when deploying code to marklogic server with gradle , getting 401 Unauthorized error

Viewed 23

I am trying to deploy code on marklogic server(version 10.0-9.4) with gradle but while running the command

./gradlew mlDeploy -i -PmlUsername= -PmlPassword= -PmlHost=""

I am getting following error

`Sending XML GET request as user 'admin' (who should have the 'manage-admin' and 'security'roles) to path: /manage/v2/privileges Logging HTTP response body to assist with debugging: {"errorResponse":   {"statusCode":401,"status":"Unauthorized","message":"401 Unauthorized"}}`

sharing build.gradle configuration for reference :

plugins {
    // node
    id "com.moowork.node" version "1.1.1"
    // ML-Gradle will handle the marklogic configuration
    id 'com.marklogic.ml-gradle' version '4.1.0'
}

repositories {
    mavenCentral()
    // Needed for mlcp dependencies
    maven { url 'https://developer.marklogic.com/maven2/' }
}

configurations {
    mlcp
}

dependencies {
    mlcp 'com.marklogic:mlcp:10.0.5'
    mlcp files('lib')
}

// Control nodejs and NPM build tasks via gradle

node {
    // Version of node to use.
    version = '4.8.4'
    npmVersion = '5.4.2'
    download = true
}
0 Answers
Related