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

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


The following commit(s) were added to refs/heads/master by this push:
     new e5fb26b  SLING-9437 : Correct detection of missing and wrong packages
e5fb26b is described below

commit e5fb26b2f221917a28b421e1bf2c6611ddc35fdc
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Mon May 11 09:30:33 2020 +0200

    SLING-9437 : Correct detection of missing and wrong packages
---
 .../org/apache/sling/feature/maven/mojos/ApisJarMojo.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java 
b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
index a3b2c8c..a43ec27 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
@@ -1491,12 +1491,14 @@ public class ApisJarMojo extends 
AbstractIncludingFeatureMojo {
             for(final ArtifactInfo info : infos) {
                 final File dir = archiveType == ArtifactType.APIS ? 
info.getBinDirectory() : info.getSourceDirectory();
 
-                final String[] usedExportedPackageIncludes = 
info.getUsedExportedPackageIncludes(apiRegion);
-                getLog().debug("Adding directory " + dir.getName() + " with " 
+ Arrays.toString(usedExportedPackageIncludes));
-                final DefaultFileSet fileSet = new DefaultFileSet(dir);
-                fileSet.setIncludingEmptyDirectories(false);
-                fileSet.setIncludes(usedExportedPackageIncludes);
-                jarArchiver.addFileSet(fileSet);
+                if ( dir != null ) {
+                    final String[] usedExportedPackageIncludes = 
info.getUsedExportedPackageIncludes(apiRegion);
+                    getLog().debug("Adding directory " + dir.getName() + " 
with " + Arrays.toString(usedExportedPackageIncludes));
+                    final DefaultFileSet fileSet = new DefaultFileSet(dir);
+                    fileSet.setIncludingEmptyDirectories(false);
+                    fileSet.setIncludes(usedExportedPackageIncludes);
+                    jarArchiver.addFileSet(fileSet);
+                }
             }
         } else {
             // javadoc

Reply via email to