This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch pathtool
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit bd299a7735df2eb4220a8562325804ebc87fee23
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Wed Jan 7 08:43:07 2026 -0500

    Replace old Plexus pathTool utility with JDK method
---
 .../maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
 
b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
index ac343d9..33f1f02 100644
--- 
a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
@@ -30,6 +30,7 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -60,7 +61,6 @@ import 
org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.configuration.PlexusConfiguration;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.PathTool;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.xml.pull.MXParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
@@ -631,7 +631,9 @@ public class CheckstyleViolationCheckMojo extends 
AbstractMojo {
             if (eventType != XmlPullParser.START_TAG) {
                 continue;
             } else if ("file".equals(xpp.getName())) {
-                file = PathTool.getRelativeFilePath(basedir, 
xpp.getAttributeValue("", "name"));
+                file = Paths.get(basedir.toString())
+                        .relativize(Paths.get(xpp.getAttributeValue("", 
"name")))
+                        .toString();
                 continue;
             } else if (!"error".equals(xpp.getName())) {
                 continue;

Reply via email to