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

davidb 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 fe1875d  SLING-8600 <includeClassifier> should fail if the classifier 
isn't found
fe1875d is described below

commit fe1875d9ec7ec14b3a5ab57c6f674830a214a02e
Author: David Bosschaert <[email protected]>
AuthorDate: Fri Jul 26 16:34:42 2019 +0100

    SLING-8600 <includeClassifier> should fail if the classifier isn't found
---
 .../sling/feature/maven/mojos/AbstractIncludingFeatureMojo.java      | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/src/main/java/org/apache/sling/feature/maven/mojos/AbstractIncludingFeatureMojo.java
 
b/src/main/java/org/apache/sling/feature/maven/mojos/AbstractIncludingFeatureMojo.java
index d094706..18206ae 100644
--- 
a/src/main/java/org/apache/sling/feature/maven/mojos/AbstractIncludingFeatureMojo.java
+++ 
b/src/main/java/org/apache/sling/feature/maven/mojos/AbstractIncludingFeatureMojo.java
@@ -86,6 +86,7 @@ public abstract class AbstractIncludingFeatureMojo extends 
AbstractFeatureMojo {
             throws MojoExecutionException {
         final Map<String, Feature> projectFeatures = 
ProjectHelper.getAssembledFeatures(this.project);
         boolean includeAll = "*".equals(selection);
+        boolean found = false;
         for (final Map.Entry<String, Feature> entry : 
projectFeatures.entrySet()) {
             final String classifier = entry.getValue().getId().getClassifier();
             boolean include = includeAll;
@@ -98,8 +99,12 @@ public abstract class AbstractIncludingFeatureMojo extends 
AbstractFeatureMojo {
             }
             if (include) {
                 result.put(entry.getKey(), entry.getValue());
+                found = true;
             }
         }
+        if (!found) {
+            throw new MojoExecutionException("Aggregate Classifier " + 
selection + " not found.");
+        }
     }
 
     private void selectFeatureFiles(final String include, final List<String> 
excludes,

Reply via email to