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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 97fc2743 Replace maven-shared-utils PathTool with plexus-utils
97fc2743 is described below

commit 97fc274339ba9e12b05904cfcef66b036f0a6df6
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Nov 8 11:39:38 2026 +0000

    Replace maven-shared-utils PathTool with plexus-utils
    
    The logging package stays until the Maven floor is 3.10, so the 
maven-shared-utils dependency remains.
    
    Part of apache/maven-shared-utils#452
---
 .../plugins/site/descriptor/SiteDescriptorAttachMojo.java    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
 
b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
index fb4533de..3b2104ad 100644
--- 
a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorAttachMojo.java
@@ -23,6 +23,7 @@ import javax.inject.Inject;
 import java.io.File;
 import java.io.IOException;
 import java.util.Locale;
+import java.util.Objects;
 
 import org.apache.maven.doxia.site.inheritance.SiteModelInheritanceAssembler;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -30,8 +31,8 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.shared.utils.PathTool;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.PathTool;
 
 /**
  * Adds the site descriptor (<code>site.xml</code>) to the list of files to be 
installed/deployed.
@@ -95,9 +96,12 @@ public class SiteDescriptorAttachMojo extends 
AbstractSiteDescriptorMojo {
                     // Copy the site descriptor to a file
                     FileUtils.copyFile(descriptorFile, targetDescriptorFile);
                     // Attach the site descriptor
-                    getLog().info("Attaching '"
-                            + 
PathTool.getRelativeFilePath(basedir.getAbsolutePath(), 
descriptorFile.getAbsolutePath())
-                            + "' site descriptor with classifier '" + 
classifier + "'.");
+                    // plexus-utils returns null (maven-shared-utils returned 
"") for paths on different Windows drives
+                    String relativePath = Objects.toString(
+                            
PathTool.getRelativeFilePath(basedir.getAbsolutePath(), 
descriptorFile.getAbsolutePath()),
+                            "");
+                    getLog().info("Attaching '" + relativePath + "' site 
descriptor with classifier '" + classifier
+                            + "'.");
                     projectHelper.attachArtifact(project, "xml", classifier, 
targetDescriptorFile);
                 } catch (IOException e) {
                     throw new MojoExecutionException("Unable to copy site 
descriptor", e);

Reply via email to