code: public Set<String> getPackagesFromMainSources() {
          Set<String> packages = new LinkedHashSet<>();
          File classes = getClassesDirectory();
          if (classes.isDirectory()) {
              DirectoryScanner scanner = new DirectoryScanner();
              scanner.setBasedir(classes);
              scanner.setIncludes(new String[]{"**/*.class"});
              scanner.addDefaultExcludes();
              scanner.scan();
  
              for (int i = 0; i < scanner.getIncludedFiles().length; i++) {
                  packages.add(Packages.getPackageName(scanner.getIncludedFiles()[i]));
              }
          }
  
          return packages;
      }
docs: Gets the list of packages from {@literal src/main/java}. This method scans for ".class" files in {@literal
  target/classes}.
  
  @return the list of packages, empty if none.