You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by js...@apache.org on 2026/08/10 13:14:25 UTC

(sling-scriptingbundle-maven-plugin) branch update-spotbugs created (now b933509)

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

jsedding pushed a change to branch update-spotbugs
in repository https://gitbox.apache.org/repos/asf/sling-scriptingbundle-maven-plugin.git


      at b933509  SLING-13296 - Update spotbugs plugin

This branch includes the following new commits:

     new b933509  SLING-13296 - Update spotbugs plugin

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-scriptingbundle-maven-plugin) 01/01: SLING-13296 - Update spotbugs plugin

Posted by js...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jsedding pushed a commit to branch update-spotbugs
in repository https://gitbox.apache.org/repos/asf/sling-scriptingbundle-maven-plugin.git

commit b933509e6f152efa313f5b595edf58d5703c598b
Author: Julian Sedding <js...@apache.org>
AuthorDate: Mon Aug 10 15:14:09 2026 +0200

    SLING-13296 - Update spotbugs plugin
---
 pom.xml                                                             | 2 +-
 .../scriptingbundle/plugin/bnd/BundledScriptsScannerPlugin.java     | 5 ++++-
 .../org/apache/sling/scriptingbundle/plugin/maven/MetadataMojo.java | 6 +++++-
 .../plugin/processor/filevault/VaultContentXmlReader.java           | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5d351dd..705cfde 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,7 @@
             <plugin>
                 <groupId>com.github.spotbugs</groupId>
                 <artifactId>spotbugs-maven-plugin</artifactId>
-                <version>4.3.0</version>
+                <version>4.10.3.0</version>
                 <configuration>
                     <effort>Max</effort>
                     <xmlOutput>true</xmlOutput>
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BundledScriptsScannerPlugin.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BundledScriptsScannerPlugin.java
index d7893cc..6afd832 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BundledScriptsScannerPlugin.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BundledScriptsScannerPlugin.java
@@ -79,7 +79,10 @@ public class BundledScriptsScannerPlugin implements AnalyzerPlugin, Plugin {
                         try {
                             if (!Files.isDirectory(file)) {
                                 Path workingCopy = Paths.get(workDirectory.toString(), sourceDirectoryPath.relativize(file).toString());
-                                Files.createDirectories(workingCopy.getParent());
+                                Path parent = workingCopy.getParent();
+                                if (parent != null) {
+                                    Files.createDirectories(parent);
+                                }
                                 Files.copy(file, workingCopy, StandardCopyOption.REPLACE_EXISTING);
                             }
                         } catch (IOException e) {
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MetadataMojo.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MetadataMojo.java
index 1a562e4..d304757 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MetadataMojo.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MetadataMojo.java
@@ -30,6 +30,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 
 import javax.script.ScriptEngineFactory;
@@ -199,7 +200,10 @@ public class MetadataMojo extends AbstractMojo {
                             try {
                                 if (!Files.isDirectory(file)) {
                                     Path workingCopy = workDirectory.resolve(sourceDirectoryPath.relativize(file));
-                                    Files.createDirectories(workingCopy.getParent());
+                                    Path parent = workingCopy.getParent();
+                                    if (parent != null) {
+                                        Files.createDirectories(parent);
+                                    }
                                     Files.copy(file, workingCopy, StandardCopyOption.REPLACE_EXISTING);
                                 }
                             } catch (IOException e) {
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/filevault/VaultContentXmlReader.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/filevault/VaultContentXmlReader.java
index edee6bc..ddb286e 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/filevault/VaultContentXmlReader.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/filevault/VaultContentXmlReader.java
@@ -47,7 +47,7 @@ import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-public class VaultContentXmlReader {
+public final class VaultContentXmlReader {
 
     private static final DocumentBuilderFactory documentBuilderFactory;