You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2019/07/24 11:59:15 UTC

[sling-slingfeature-maven-plugin] branch master updated: SLING-8596 : mvn clean fails if feature directory is empty

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 285815b  SLING-8596 : mvn clean fails if feature directory is empty
285815b is described below

commit 285815b63126d59ac17f59b07d9643277cc466ed
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jul 24 13:58:18 2019 +0200

    SLING-8596 : mvn clean fails if feature directory is empty
---
 src/main/java/org/apache/sling/feature/maven/Preprocessor.java  | 3 ---
 src/main/java/org/apache/sling/feature/maven/ProjectHelper.java | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/maven/Preprocessor.java b/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
index 80666cc..02ca00e 100644
--- a/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
+++ b/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
@@ -116,9 +116,6 @@ public class Preprocessor {
         for(final FeatureProjectInfo finfo : env.modelProjects.values()) {
             process(env, finfo, FeatureProjectConfig.getMainConfig(finfo));
             process(env, finfo, FeatureProjectConfig.getTestConfig(finfo));
-            if ( FeatureConstants.PACKAGING_FEATURE.equals(finfo.project.getPackaging()) && finfo.features.isEmpty() ) {
-                throw new RuntimeException("Feature project has no feature defined: " + finfo.project.getId());
-            }
 
             ProjectHelper.storeProjectInfo(finfo);
 
diff --git a/src/main/java/org/apache/sling/feature/maven/ProjectHelper.java b/src/main/java/org/apache/sling/feature/maven/ProjectHelper.java
index 901b6d8..bc2d28c 100644
--- a/src/main/java/org/apache/sling/feature/maven/ProjectHelper.java
+++ b/src/main/java/org/apache/sling/feature/maven/ProjectHelper.java
@@ -142,6 +142,9 @@ public abstract class ProjectHelper {
             throw new RuntimeException("The slingfeature preprocessor did not run. "
                     + "Please make sure to set <extensions>true</extensions> for the slingfeature plugin in your pom.");
         }
+        if (FeatureConstants.PACKAGING_FEATURE.equals(project.getPackaging()) && getFeatures(project).isEmpty()) {
+            throw new RuntimeException("Feature project has no features defined");
+        }
     }
 
     /**