void () { ModuleManager moduleManager = ModuleManager.getInstance(myProject); for (Module module : moduleManager.getModules()) { System.out.println(module); ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); for (ContentEntry contentEntry : moduleRootManager.getContentEntries()) { System.out.println("content root = " + contentEntry.getUrl()); for (SourceFolder sourceFolder : contentEntry.getSourceFolders()) { System.out.println("source root = " + sourceFolder); String packagePrefix = sourceFolder.getPackagePrefix(); if (packagePrefix.isEmpty()) continue; System.out.println("package prefix = " + packagePrefix); } } } }