lib/maven-archetype-generate.js
function processModules (resourcesPath, targetPath, directory, modules, parentPomPath, properties, yoFs) {
  modules.forEach(module => {
    debug('Processing module', module);
    var modulePath = path.join(directory, module.dir);
    properties.artifactId = pathFiltering.filter(module.dir, properties);
    addModuleToParentPom(parentPomPath, properties, yoFs);
    var pomPath = copyPom(resourcesPath, targetPath, modulePath, properties, yoFs);
    processFileSets(resourcesPath, targetPath, modulePath, module.fileSets, properties, yoFs);
    processModules(resourcesPath, targetPath, modulePath, module.modules, pomPath, properties, yoFs);
  });
}
function processModules (resourcesPath, targetPath, directory, modules, parentPomPath, properties, yoFs) {
  modules.forEach(module => {
    debug('Processing module', module);
    var modulePath = path.join(directory, module.dir);
    properties.artifactId = pathFiltering.filter(module.dir, properties);
    addModuleToParentPom(parentPomPath, properties, yoFs);
    var pomPath = copyPom(resourcesPath, targetPath, modulePath, properties, yoFs);
    processFileSets(resourcesPath, targetPath, modulePath, module.fileSets, properties, yoFs);
    processModules(resourcesPath, targetPath, modulePath, module.modules, pomPath, properties, yoFs);
  });
}
function processModules ( resourcesPath , targetPath , directory , modules , parentPomPath , properties , yoFs ) { modules . forEach ( module => { debug ( 'Processing module' , module ) ; var modulePath = path . join ( directory , module . dir ) ; properties . artifactId = pathFiltering . filter ( module . dir , properties ) ; addModuleToParentPom ( parentPomPath , properties , yoFs ) ; var pomPath = copyPom ( resourcesPath , targetPath , modulePath , properties , yoFs ) ; processFileSets ( resourcesPath , targetPath , modulePath , module . fileSets , properties , yoFs ) ; processModules ( resourcesPath , targetPath , modulePath , module . modules , pomPath , properties , yoFs ) ; } ) ; }
Given a list of modules, this accounts for the module directory and updates the artifactId
property. Then it copies the module pom.xml, any filesets defined in the module and finally
recuses on any sub-modules.

@param {!string} resourcesPath
@param {!string} targetPath
@param {!string} directory
@param {!Array<{dir: !string, id: !string}>} modules
@param {!string} parentPomPath
@param {!Object} properties
@param {!Object} yoFs
Given a list of modules this accounts for the module directory and updates the artifactId property . Then it copies the module pom . xml any filesets defined in the module and finally recuses on any sub - modules .