@@ -13,6 +13,7 @@ import { throwIfCancelled } from './transformApiHandler'
1313import { sleep } from '../../../shared/utilities/timeoutUtils'
1414import path from 'path'
1515import globals from '../../../shared/extensionGlobals'
16+ import os from 'os'
1617
1718function collectDependenciesAndMetadata ( dependenciesFolderPath : string , workingDirPath : string ) {
1819 getLogger ( ) . info ( 'CodeTransformation: running mvn clean test-compile with maven JAR' )
@@ -22,9 +23,11 @@ function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingD
2223
2324 getLogger ( ) . info ( 'CodeTransformation: running Maven extension with JAR' )
2425
26+ const quotePath = ( p : string ) => ( os . platform ( ) === 'win32' ? `"${ p } "` : p )
27+
2528 const args = [
26- `-Dmaven.ext.class.path=${ jarPath } ` ,
27- `-Dcom.amazon.aws.developer.transform.jobDirectory=${ dependenciesFolderPath } ` ,
29+ `-Dmaven.ext.class.path=${ quotePath ( jarPath ) } ` ,
30+ `-Dcom.amazon.aws.developer.transform.jobDirectory=${ quotePath ( dependenciesFolderPath ) } ` ,
2831 'clean' ,
2932 'test-compile' ,
3033 ]
@@ -34,6 +37,14 @@ function collectDependenciesAndMetadata(dependenciesFolderPath: string, workingD
3437 environment = { ...process . env , JAVA_HOME : transformByQState . getSourceJavaHome ( ) }
3538 }
3639
40+ getLogger ( ) . info ( `CodeTransformation: JAVA_HOME = ${ environment . JAVA_HOME } ` )
41+ getLogger ( ) . info ( `CodeTransformation: baseCommand = ${ baseCommand } ` )
42+ getLogger ( ) . info ( `CodeTransformation: jarPath = ${ jarPath } ` )
43+ getLogger ( ) . info ( `CodeTransformation: args = ${ args . join ( ' ' ) } ` )
44+ getLogger ( ) . info (
45+ `CodeTransformation: shell info --> SHELL=${ process . env . SHELL } , COMSPEC=${ process . env . COMSPEC } , PSModulePath=${ process . env . PSModulePath ? 'PowerShell' : 'not set' } `
46+ )
47+
3748 const spawnResult = spawnSync ( baseCommand , args , {
3849 cwd : workingDirPath ,
3950 shell : true ,
0 commit comments