You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/12/10 09:45:32 UTC

[sling-slingfeature-maven-plugin] branch feature/SLING-8906 created (now d1a8ef0)

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

rombert pushed a change to branch feature/SLING-8906
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git.


      at d1a8ef0  SLING-8906 - Include filters are too wide and can pull in unwanted resources

This branch includes the following new commits:

     new d1a8ef0  SLING-8906 - Include filters are too wide and can pull in unwanted resources

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-slingfeature-maven-plugin] 01/01: SLING-8906 - Include filters are too wide and can pull in unwanted resources

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

rombert pushed a commit to branch feature/SLING-8906
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git

commit d1a8ef0a59093d84b0832bf299c92cfc7eb97307
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Dec 10 10:44:09 2019 +0100

    SLING-8906 - Include filters are too wide and can pull in unwanted resources
    
    Use strict filtering (one parent) when including resources from deflated bins
    and sources, and relaxed filtering (multiple parents) otherwise.
---
 .../java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 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 46c4c81..e53b9d9 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
@@ -401,7 +401,7 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo implements Artifac
                 // prepare filter
                 for (final ApiRegion r : regions.listRegions()) {
                     for (final ApiExport e : r.listExports()) {
-                        e.getProperties().put(PROPERTY_FILTER, packageToScannerFiler(e.getName()));
+                        e.getProperties().put(PROPERTY_FILTER, packageToScannerFiler(e.getName(), true));
                     }
                 }
 
@@ -1110,7 +1110,7 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo implements Artifac
 
         for (Clause exportedPackage : exportedPackages) {
             final String api = exportedPackage.getName();
-            exports.add(packageToScannerFiler(api));
+            exports.add(packageToScannerFiler(api, false));
         }
 
         return exports.toArray(new String[exports.size()]);
@@ -1405,8 +1405,8 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo implements Artifac
 
 
 
-    private static String packageToScannerFiler(String api) {
-        return "**/" + api.replace('.', '/') + "/*";
+    private static String packageToScannerFiler(String api, boolean strict) {
+        return (strict ? "*": "**") + '/' + api.replace('.', '/') + "/*";
     }
 
     private static String[] concatenate(String[] a, String[] b) {