You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/07/04 13:42:20 UTC

[sling-slingfeature-maven-plugin] branch master updated: Look for feature files in src/main/features

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 51b4acc  Look for feature files in src/main/features
51b4acc is described below

commit 51b4acc5b91579d08df637d09c32dbe3c36285f0
Author: David Bosschaert <bo...@adobe.com>
AuthorDate: Wed Jul 4 14:41:44 2018 +0100

    Look for feature files in src/main/features
    
    If they are not present in target/features/processed
---
 .../org/apache/sling/feature/maven/mojos/AttachFeature.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/feature/maven/mojos/AttachFeature.java b/src/main/java/org/apache/sling/feature/maven/mojos/AttachFeature.java
index 2c75baa..f5e73e2 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/AttachFeature.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/AttachFeature.java
@@ -86,7 +86,15 @@ public class AttachFeature extends AbstractFeatureMojo {
     void attachClassifierFeatures() throws MojoExecutionException {
         // Find all features that have a classifier and attach each of them
         String processedFeatures = project.getBuild().getDirectory() + FeatureConstants.FEATURE_PROCESSED_LOCATION;
-        for (File f : new File(processedFeatures).listFiles((d,f) -> f.endsWith(".json"))) {
+
+        File featuresDir = new File(processedFeatures);
+        if (!featuresDir.isDirectory()) {
+            featuresDir = new File(project.getBasedir(), "src/main/features");
+            if (!featuresDir.isDirectory()) {
+                return;
+            }
+        }
+        for (File f : featuresDir.listFiles((d,f) -> f.endsWith(".json"))) {
             try {
                 Feature feat = FeatureJSONReader.read(new FileReader(f), null, SubstituteVariables.NONE);