@@ -839,9 +839,7 @@ class ProcessBuilder {
839
839
libs [ mdl . getVersionlessMavenIdentifier ( ) ] = mdl . getPath ( )
840
840
if ( mdl . subModules . length > 0 ) {
841
841
const res = this . _resolveModuleLibraries ( mdl )
842
- if ( res . length > 0 ) {
843
- libs = { ...libs , ...res }
844
- }
842
+ libs = { ...libs , ...res }
845
843
}
846
844
}
847
845
}
@@ -850,9 +848,7 @@ class ProcessBuilder {
850
848
for ( let i = 0 ; i < mods . length ; i ++ ) {
851
849
if ( mods . sub_modules != null ) {
852
850
const res = this . _resolveModuleLibraries ( mods [ i ] )
853
- if ( res . length > 0 ) {
854
- libs = { ...libs , ...res }
855
- }
851
+ libs = { ...libs , ...res }
856
852
}
857
853
}
858
854
@@ -863,27 +859,25 @@ class ProcessBuilder {
863
859
* Recursively resolve the path of each library required by this module.
864
860
*
865
861
* @param {Object } mdl A module object from the server distro index.
866
- * @returns {Array.< string> } An array containing the paths of each library this module requires.
862
+ * @returns {{[id: string]: string} } An object containing the paths of each library this server requires.
867
863
*/
868
864
_resolveModuleLibraries ( mdl ) {
869
865
if ( ! mdl . subModules . length > 0 ) {
870
- return [ ]
866
+ return { }
871
867
}
872
- let libs = [ ]
868
+ let libs = { }
873
869
for ( let sm of mdl . subModules ) {
874
870
if ( sm . rawModule . type === Type . Library ) {
875
871
876
872
if ( sm . rawModule . classpath ?? true ) {
877
- libs . push ( sm . getPath ( ) )
873
+ libs [ sm . getVersionlessMavenIdentifier ( ) ] = sm . getPath ( )
878
874
}
879
875
}
880
876
// If this module has submodules, we need to resolve the libraries for those.
881
877
// To avoid unnecessary recursive calls, base case is checked here.
882
878
if ( mdl . subModules . length > 0 ) {
883
879
const res = this . _resolveModuleLibraries ( sm )
884
- if ( res . length > 0 ) {
885
- libs = libs . concat ( res )
886
- }
880
+ libs = { ...libs , ...res }
887
881
}
888
882
}
889
883
return libs
0 commit comments