gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Authentication parameters for private repository

Open vinittcs opened this issue 8 years ago • 2 comments

Hi

We have created Private repository for node and through gradle we want to install npm 6.9.2.

Repository created requires authentication and we did not find any way in node plugin to pass user name and password for authentication. Because of this we are gettiing Autherization failed error 401.

Following is what we have used in build.gradle file

buildscript { ext { springBootVersion = '1.5.3.RELEASE' } repositories { maven { credentials { username artifactory_username password artifactory_password } url 'https://xxxxx/xxxxx/remote-repos' }

    maven {

        credentials {

            username artifactory_username
            password artifactory_password

        }

        url 'https://xxxx.xxxx.xx.com/xxxx/xxxxx-NPM/'

    }		
	
	
	
}
dependencies {
	classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	classpath "com.moowork.gradle:gradle-node-plugin:0.12"
}

}

apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'org.springframework.boot' apply plugin: 'war' apply plugin:"com.moowork.node"

sourceCompatibility = 1.8 targetCompatibility = 1.8

node { version = "6.9.2" distBaseUrl = 'https://dev.xxxxx.com/xxxxx/NPM/' download = true nodeModulesDir = file("adminUIClient") }

Thanks Vinit

vinittcs avatar Jul 06 '17 14:07 vinittcs

Hi, can i unbury this ancient issue? We're migrating from nexus to artifactory, my situation and error message are the same as above, any input on how to pass credentials to be able to download node from private artifactory?

nc-baku avatar Apr 16 '24 09:04 nc-baku

@nc-baku there's been no commits for the past 5 years, I recommend giving https://github.com/srs/gradle-node-plugin/issues/315 a read to get an idea on options

deepy avatar Apr 16 '24 09:04 deepy