@@ -10,13 +10,13 @@ export const M2_DIR = '.m2';
1010export const SETTINGS_FILE = 'settings.xml' ;
1111
1212export async function configAuthentication (
13- id : string ,
13+ idArray : string [ ] ,
1414 username : string ,
1515 password : string ,
1616 gpgPassphrase : string | undefined = undefined
1717) {
1818 console . log (
19- `creating ${ SETTINGS_FILE } with server-id: ${ id } ;` ,
19+ `creating ${ SETTINGS_FILE } with server-id: ${ idArray . join ( ',' ) } ;` ,
2020 'environment variables:' ,
2121 `username=\$${ username } ,` ,
2222 `password=\$${ password } ,` ,
@@ -32,13 +32,13 @@ export async function configAuthentication(
3232 core . debug ( `created directory ${ settingsDirectory } ` ) ;
3333 await write (
3434 settingsDirectory ,
35- generate ( id , username , password , gpgPassphrase )
35+ generate ( idArray , username , password , gpgPassphrase )
3636 ) ;
3737}
3838
3939// only exported for testing purposes
4040export function generate (
41- id : string ,
41+ idArray : string [ ] ,
4242 username : string ,
4343 password : string ,
4444 gpgPassphrase : string | undefined = undefined
@@ -50,13 +50,13 @@ export function generate(
5050 '@xsi:schemaLocation' :
5151 'http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd' ,
5252 servers : {
53- server : [
54- {
53+ server : idArray . map ( ( id , index , idArray ) => {
54+ return {
5555 id : id ,
5656 username : `\${env.${ username } }` ,
5757 password : `\${env.${ password } }`
5858 }
59- ]
59+ } )
6060 }
6161 }
6262 } ;
0 commit comments