From 74889fe25f494723f1fabb53d7232e45160ae251 Mon Sep 17 00:00:00 2001 From: Jakub Stejskal Date: Tue, 23 Jul 2024 15:38:06 +0200 Subject: [PATCH 1/2] Make sure that docsPath ends with slash Signed-off-by: Jakub Stejskal --- .../src/main/java/io/skodjob/DocGeneratorMojo.java | 5 +++++ .../src/main/java/io/skodjob/MdGenerator.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 761f39d..4723c22 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 @@ -108,6 +108,11 @@ public void execute() { getLog().debug(url.getFile()); } + // Ensure that docsPath ends with / + if (!docsPath.endsWith("/")) { + docsPath += "/"; + } + Map classes = Utils.getTestClassesWithTheirPath(testsPath, generateDirs); for (Map.Entry entry : classes.entrySet()) { try { diff --git a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/MdGenerator.java b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/MdGenerator.java index f52e5d4..cef4467 100644 --- a/test-docs-generator-maven-plugin/src/main/java/io/skodjob/MdGenerator.java +++ b/test-docs-generator-maven-plugin/src/main/java/io/skodjob/MdGenerator.java @@ -310,7 +310,7 @@ private static void updateLabelFile(String labelFilePath, String updatedData) { * @param docsPath path where all test docs are stored */ public static void updateLinksInLabels(String docsPath) { - String labelsPath = docsPath + "/" + LABELS; + String labelsPath = docsPath + LABELS; int numberOfDirs = docsPath.length() - docsPath.replace("/", "").length(); String mdFilesPath = "../".repeat(numberOfDirs); From 6c28829cae14450350c2672d834962fd7f2333d4 Mon Sep 17 00:00:00 2001 From: Jakub Stejskal Date: Tue, 23 Jul 2024 16:11:10 +0200 Subject: [PATCH 2/2] Use project.basedir in dummy module Signed-off-by: Jakub Stejskal --- dummy-module/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dummy-module/pom.xml b/dummy-module/pom.xml index 08fbf30..e91adb7 100644 --- a/dummy-module/pom.xml +++ b/dummy-module/pom.xml @@ -99,7 +99,7 @@ test-docs-generator - ./dummy-module/src/test/java/io/skodjob/ + ${project.basedir}/src/test/java/io/skodjob/ ./docs/actual/option1/ true true @@ -112,7 +112,7 @@ test-docs-generator - ./dummy-module/src/test/java/io/skodjob/ + ${project.basedir}/src/test/java/io/skodjob/ ./docs/actual/option2/ true false @@ -125,7 +125,7 @@ test-docs-generator - ./dummy-module/src/test/java/io/skodjob/ + ${project.basedir}/src/test/java/io/skodjob/ ./docs/actual/option3/ false false @@ -138,7 +138,7 @@ test-docs-generator - ./dummy-module/src/test/java/io/skodjob/ + ${project.basedir}/src/test/java/io/skodjob/ ./docs/actual/option4/ false true