0

I am using gradle node plugin behind corporate proxy with our own artifactory url but plugin is not able to download the node dist and hence the build is failing.

As per plugin added the below code

node {
  version = '10.15.3'
  npmVersion = '6.4.1'
  download = true
  distBaseUrl = 'https://<<private-artifactory-url>>'
  workDir = file("${project.buildDir}/nodejs")
  npmWorkDir = file("${project.buildDir}/npm")

}

plugin is trying to resolve the node path like distBaseUrl + v10.15.3/ivy.xml which is not found in private artifactory as the absolute url path is different. Private artifactory path is like http:://domain.com/api/npm/node/10.15.3 which is different from what plugin does. I tried with full absolute url in distBaseUrl also which is not working.

Any suggestions on how to resolve this issue

Rinsen S
  • 461
  • 3
  • 10
  • 26

1 Answers1

0

If you set distBaseUrl to null you can prevent the plugin itself from adding the IvyRepository and at that point you can add your own.

repositories.ivy {
    // URL goes here
    setUrl('https://nodejs.org/dist/latest-v10.x/')
    patternLayout {
        // Here you can change the layout if it's named something else.
        artifact("[artifact](-v[revision]-[classifier]).[ext]")
    }
    metadataSources {
        artifact()
    }

}

node {
    distBaseUrl = null
}

Based on an example from https://github.com/node-gradle/gradle-node-plugin/issues/54#issuecomment-581950868

deepy
  • 473
  • 4
  • 20