Commit 13fdf59 1 parent f60f6f7 commit 13fdf59 Copy full SHA for 13fdf59
File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -79,3 +79,26 @@ node-java-maven
79
79
}
80
80
}
81
81
82
+ * Add another maven repo
83
+
84
+ {
85
+ "java": {
86
+ "repositories": [
87
+ {
88
+ "id": "maven",
89
+ "url": "http://example/repository/maven-public/",
90
+ "credentials": {
91
+ "username": "user",
92
+ "password": "pass"
93
+ }
94
+ }
95
+ ],
96
+ "dependencies": [
97
+ {
98
+ "groupId": "org.apache.lucene",
99
+ "artifactId": "lucene-core",
100
+ "version": "4.9.0"
101
+ }
102
+ ]
103
+ }
104
+ }
Original file line number Diff line number Diff line change @@ -442,8 +442,20 @@ module.exports = function(/*options, callback*/) {
442
442
function ( callback ) {
443
443
var repository = options . repositories [ repositoryIndex ] ;
444
444
var url = repository . url + urlPath ;
445
+ var req_options = { url : url } ;
446
+ if ( repository . hasOwnProperty ( 'credentials' ) ) {
447
+ var username = repository . credentials . username ;
448
+ var password = repository . credentials . password ;
449
+ req_options = {
450
+ url : url ,
451
+ auth : {
452
+ user : username ,
453
+ password : password
454
+ }
455
+ } ;
456
+ }
445
457
debug ( 'downloading ' + url ) ;
446
- var r = request ( url ) ;
458
+ var r = request ( req_options ) ;
447
459
r . on ( 'response' , function ( response ) {
448
460
if ( response . statusCode != 200 ) {
449
461
error = new Error ( 'download failed for ' + url + ( reason ? ' (' + reason + ')' : '' ) + ' [status: ' + response . statusCode + ']' ) ;
You can’t perform that action at this time.
0 commit comments