diff --git a/dummy-module/pom.xml b/dummy-module/pom.xml index 8224368..a09f706 100644 --- a/dummy-module/pom.xml +++ b/dummy-module/pom.xml @@ -101,7 +101,7 @@ - ./dummy-module/src/test/java/io/ + ./dummy-module/src/test/java/io/skodjob/ ./docs/ true diff --git a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/DocGeneratorMojo.java b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/DocGeneratorMojo.java index ac8b2b9..b20b380 100644 --- a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/DocGeneratorMojo.java +++ b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/DocGeneratorMojo.java @@ -94,7 +94,6 @@ public void execute() { for (URL url : classRealm.getURLs()) { getLog().debug(url.getFile()); } - getLog().info("testsPath: " + testsPath); Map classes = Utils.getTestClassesWithTheirPath(testsPath); @@ -143,7 +142,7 @@ public void addJarFilesToClassPath(File directory, ClassRealm classRealm) throws addJarFilesToClassPath(file, classRealm); } else if (file.isFile() && file.getName().toLowerCase(Locale.ROOT).endsWith(".jar")) { // Print the absolute path if it's a .jar file - getLog().info("Found .jar file: " + file.getAbsolutePath()); + getLog().debug("Found .jar file: " + file.getAbsolutePath()); classRealm.addURL(file.toURI().toURL()); } } diff --git a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/common/Utils.java b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/common/Utils.java index dbf357b..aad5c6c 100644 --- a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/common/Utils.java +++ b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/common/Utils.java @@ -21,7 +21,7 @@ */ public class Utils { - private static final Pattern REMOVE_BEFORE_PACKAGE = Pattern.compile(".*java\\/"); + private static final Pattern REMOVE_BEFORE_PACKAGE = Pattern.compile(".*java/"); /** * Updates Map ({@param classes}) with info about classes inside {@param packagePath}. @@ -38,18 +38,16 @@ public class Utils { * @return updated Map with test-classes info from the {@param packagePath} */ private static Map getClassesForPackage(Map classes, Path packagePath) { - try (Stream pathStream = Files.list(packagePath)) { - pathStream.forEach(path -> { - if (Files.isDirectory(path)) { - classes.putAll(getClassesForPackage(classes, path)); - } else { - String classPackagePath = path.toAbsolutePath().toString().replaceAll(REMOVE_BEFORE_PACKAGE.toString(), "").replace(".java", ""); - classes.put(classPackagePath, classPackagePath.replaceAll("/", ".")); - } - }); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); + if (Files.isDirectory(packagePath)) { + try (Stream pathStream = Files.list(packagePath)) { + pathStream.forEach(path -> classes.putAll(getClassesForPackage(classes, path))); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } else { + String classPackagePath = packagePath.toAbsolutePath().toString().replaceAll(REMOVE_BEFORE_PACKAGE.toString(), "").replace(".java", ""); + classes.put(classPackagePath, classPackagePath.replaceAll("/", ".")); } return classes;