private void addModules ( MavenProject project , MavenProjectDirectoryDescriptor projectDescriptor , ScannerContext scannerContext ) { File projectDirectory = project . getBasedir ( ) ; Set < File > modules = new HashSet <> ( ) ; for ( String moduleName : project . getModules ( ) ) { File module = new File ( projectDirectory , moduleName ) ; modules . add ( module ) ; } for ( MavenProject module : project . getCollectedProjects ( ) ) { if ( modules . contains ( module . getBasedir ( ) ) ) { MavenProjectDescriptor moduleDescriptor = resolveProject ( module , MavenProjectDescriptor . class , scannerContext ) ; projectDescriptor . getModules ( ) . add ( moduleDescriptor ) ; } } }
Add relations to the modules .