0

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
}
ravvi
  • 117
  • 6

1 Answers1

0

A proxy configured in gradle.properties might interfere with the credentials being passed to MarkLogic. I don't have a great solution since the proxy is likely required for resolving gradle packages.

However, if you run mlDeploy the first time with the proxy setting so the gradle resolves all of its dependencies, you should be able to comment them out for subsequent runs.

In other words, expect it to fail on the first execution (after all the dependencies are resolved) but succeed on future runs after the proxy lines are commented out.

dbrouwer2
  • 31
  • 2