You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2024/07/28 19:42:44 UTC

(maven-site-plugin) branch master updated: Earlier detection of mkdirs failure (#201)

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

elharo 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 e2791dd7 Earlier detection of mkdirs failure (#201)
e2791dd7 is described below

commit e2791dd7862df6523c582a7f4fcdcbae922cb8e4
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Sun Jul 28 15:42:40 2024 -0400

    Earlier detection of mkdirs failure (#201)
---
 .../plugins/site/descriptor/SiteDescriptorArtifactMetadata.java      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorArtifactMetadata.java b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorArtifactMetadata.java
index bd36b376..7ad31e73 100644
--- a/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorArtifactMetadata.java
+++ b/src/main/java/org/apache/maven/plugins/site/descriptor/SiteDescriptorArtifactMetadata.java
@@ -69,7 +69,10 @@ public class SiteDescriptorArtifactMetadata extends AbstractArtifactMetadata {
         File destination = new File(
                 localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata(this, remoteRepository));
 
-        destination.getParentFile().mkdirs();
+        if (!destination.getParentFile().mkdirs()) {
+            throw new RepositoryMetadataStoreException(
+                    "Could not create artifact directory " + destination + " in local repository");
+        }
 
         try (Writer writer = new XmlStreamWriter(destination)) {
             new SiteXpp3Writer().write(writer, siteModel);