sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject [sling-whiteboard] branch master updated: Split feature util into io and assembly parts
Date Tue, 17 Apr 2018 14:56:48 GMT
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-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e4185f  Split feature util into io and assembly parts
4e4185f is described below

commit 4e4185f3bca01c33ff1d58afc165928c2c65d6c0
Author: Carsten Ziegeler <cziegeler@apache.org>
AuthorDate: Tue Apr 17 16:56:40 2018 +0200

    Split feature util into io and assembly parts
---
 .../feature/launcher/impl/FeatureProcessor.java    |   2 +-
 .../modelconverter/impl/FeatureToProvisioning.java |   2 +-
 .../modelconverter/impl/ModelConverterTest.java    |  55 +++---
 .../apache/sling/feature/support/FeatureUtil.java  | 196 +--------------------
 .../feature/support/{ => io}/FeatureUtil.java      | 114 +-----------
 .../feature/support/{ => io}/FeatureUtilTest.java  |   6 +-
 .../apache/sling/feature/maven/Preprocessor.java   |  21 ++-
 7 files changed, 55 insertions(+), 341 deletions(-)

diff --git a/featuremodel/feature-launcher/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
b/featuremodel/feature-launcher/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
index 12c0dbe..6fd5fce 100644
--- a/featuremodel/feature-launcher/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
+++ b/featuremodel/feature-launcher/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
@@ -65,7 +65,7 @@ public class FeatureProcessor {
         } else {
             try (FeatureResolver resolver = new FrameworkResolver(artifactManager, Collections.emptyMap()))
{
                 app = FeatureUtil.assembleApplication(null, artifactManager, resolver,
-                       FeatureUtil.getFeatureFiles(config.getHomeDirectory(), config.getFeatureFiles()).toArray(new
String[0]));
+                       org.apache.sling.feature.support.io.FeatureUtil.getFeatureFiles(config.getHomeDirectory(),
config.getFeatureFiles()).toArray(new String[0]));
             } catch (Exception ex) {
                 Main.LOG().error("Error while assembling application: {}", ex.getMessage(),
ex);
                 System.exit(1);
diff --git a/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
b/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
index fd1d268..eb83353 100644
--- a/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
+++ b/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/FeatureToProvisioning.java
@@ -62,7 +62,7 @@ public class FeatureToProvisioning {
     static final String PROVISIONING_MODEL_NAME_VARIABLE = "provisioning.model.name";
 
     public static void convert(File file, String output, ArtifactManager am) throws IOException
{
-        org.apache.sling.feature.Feature feature = FeatureUtil.getFeature(file.getAbsolutePath(),
am, SubstituteVariables.NONE);
+        org.apache.sling.feature.Feature feature = org.apache.sling.feature.support.io.FeatureUtil.getFeature(file.getAbsolutePath(),
am, SubstituteVariables.NONE);
 
         Object featureNameVar = feature.getVariables().remove(PROVISIONING_MODEL_NAME_VARIABLE);
         String featureName;
diff --git a/featuremodel/feature-modelconverter/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
b/featuremodel/feature-modelconverter/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
index dfc85ee..87867fb 100644
--- a/featuremodel/feature-modelconverter/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
+++ b/featuremodel/feature-modelconverter/src/test/java/org/apache/sling/feature/modelconverter/impl/ModelConverterTest.java
@@ -16,12 +16,34 @@
  */
 package org.apache.sling.feature.modelconverter.impl;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.sling.feature.Bundles;
 import org.apache.sling.feature.Configurations;
 import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
 import org.apache.sling.feature.Extensions;
-import org.apache.sling.feature.support.FeatureUtil;
 import org.apache.sling.feature.support.artifact.ArtifactManager;
 import org.apache.sling.feature.support.artifact.ArtifactManagerConfig;
 import org.apache.sling.feature.support.json.FeatureJSONReader.SubstituteVariables;
@@ -43,29 +65,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 public class ModelConverterTest {
     private Path tempDir;
     private ArtifactManager artifactManager;
@@ -175,8 +174,8 @@ public class ModelConverterTest {
         File outFile = files.get(0);
 
         String expectedFile = new File(getClass().getResource(expectedJSON).toURI()).getAbsolutePath();
-        org.apache.sling.feature.Feature expected = FeatureUtil.getFeature(expectedFile,
artifactManager, SubstituteVariables.NONE);
-        org.apache.sling.feature.Feature actual = FeatureUtil.getFeature(outFile.getAbsolutePath(),
artifactManager, SubstituteVariables.NONE);
+        org.apache.sling.feature.Feature expected = org.apache.sling.feature.support.io.FeatureUtil.getFeature(expectedFile,
artifactManager, SubstituteVariables.NONE);
+        org.apache.sling.feature.Feature actual = org.apache.sling.feature.support.io.FeatureUtil.getFeature(outFile.getAbsolutePath(),
artifactManager, SubstituteVariables.NONE);
         assertFeaturesEqual(expected, actual);
     }
 
@@ -206,8 +205,8 @@ public class ModelConverterTest {
         File outFile = files.get(0);
 
         String expectedFile = new File(getClass().getResource(expectedJSON).toURI()).getAbsolutePath();
-        org.apache.sling.feature.Feature expected = FeatureUtil.getFeature(expectedFile,
artifactManager, SubstituteVariables.NONE);
-        org.apache.sling.feature.Feature actual = FeatureUtil.getFeature(outFile.getAbsolutePath(),
artifactManager, SubstituteVariables.NONE);
+        org.apache.sling.feature.Feature expected = org.apache.sling.feature.support.io.FeatureUtil.getFeature(expectedFile,
artifactManager, SubstituteVariables.NONE);
+        org.apache.sling.feature.Feature actual = org.apache.sling.feature.support.io.FeatureUtil.getFeature(outFile.getAbsolutePath(),
artifactManager, SubstituteVariables.NONE);
         assertFeaturesEqual(expected, actual);
     }
 
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
index d5358fa..2ffb38f 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
@@ -19,10 +19,8 @@ package org.apache.sling.feature.support;
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
-import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
 import org.apache.sling.feature.Application;
@@ -51,163 +49,6 @@ public class FeatureUtil {
                 version != null ? version : "5.6.10", null, null);
     }
 
-    static final Comparator<String> FEATURE_PATH_COMP = new Comparator<String>()
{
-
-        @Override
-        public int compare(final String o1, final String o2) {
-            // windows path conversion
-            final String key1 = o1.replace(File.separatorChar, '/');
-            final String key2 = o2.replace(File.separatorChar, '/');
-
-            final int lastSlash1 = key1.lastIndexOf('/');
-            final int lastSlash2 = key2.lastIndexOf('/');
-            if ( lastSlash1 == -1 || lastSlash2 == -1 ) {
-                return o1.compareTo(o2);
-            }
-            final String path1 = key1.substring(0, lastSlash1 + 1);
-            final String path2 = key2.substring(0, lastSlash2 + 1);
-            if ( path1.equals(path2) ) {
-                return o1.compareTo(o2);
-            }
-            if ( path1.startsWith(path2) ) {
-                return 1;
-            } else if ( path2.startsWith(path1) ) {
-                return -1;
-            }
-            return o1.compareTo(o2);
-        }
-    };
-
-    private static void processDir(final List<String> paths, final File dir)
-    throws IOException {
-        for(final File f : dir.listFiles()) {
-            if ( f.isFile() && !f.getName().startsWith(".")) {
-                // check if file is a reference
-                if ( f.getName().endsWith(".ref") || f.getName().endsWith(".json") ) {
-                    processFile(paths, f);
-                }
-            }
-        }
-    }
-
-    public static List<String> parseFeatureRefFile(final File file)
-    throws IOException {
-        final List<String> result = new ArrayList<>();
-        final List<String> lines = Files.readAllLines(file.toPath());
-        for(String line : lines) {
-            line = line.trim();
-            if ( !line.isEmpty() && !line.startsWith("#") ) {
-                if ( line.indexOf(':') == -1 ) {
-                    result.add(new File(line).getAbsolutePath());
-                } else {
-                    result.add(line);
-                }
-            }
-        }
-        return result;
-    }
-
-    private static void processFile(final List<String> paths, final File f)
-    throws IOException {
-        if ( f.getName().endsWith(".ref") ) {
-            paths.addAll(parseFeatureRefFile(f));
-        } else {
-            paths.add(f.getAbsolutePath());
-        }
-    }
-
-    /**
-     * Get the list of feature files.
-     * If the provided list of files is {@code null} or an empty array, the default is used.
-     * The default checks for the following places, the first one found is used. If none
is
-     * found an empty list is returned.
-     * <ol>
-     *   <li>A directory named {@code feature} in the current directory
-     *   <li>A file named {@code features.json} in the current directory
-     *   <li>A directory named {@code feature} in the home directory
-     *   <li>A file named {@code features.json} in the home directory
-     * </ol>
-     *
-     * The list of files is processed one after the other. If it is relative, it is
-     * first tried to be resolved against the current directory and then against the
-     * home directory.
-     * If an entry denotes a directory, all children ending in {@code .json} or {@code .ref}
of that directory are read.
-     * If a file ends in {@code .ref} the contents is read and every line not starting with
the
-     * hash sign is considered a reference to a feature artifact.
-     *
-     * @param homeDirectory If relative files should be resolved, this is the directory to
use
-     * @param files Optional list of files. If none is provided, a default is used.
-     * @return The list of files.
-     * @throws IOException If an error occurs.
-     */
-    public static List<String> getFeatureFiles(final File homeDirectory, final String...
files) throws IOException {
-        String[] featureFiles = files;
-        if ( featureFiles == null || featureFiles.length == 0 ) {
-            // Default value - check feature directory otherwise features file
-            final File[] candidates = new File[] {
-                    new File(homeDirectory, "features"),
-                    new File(homeDirectory, "features.json"),
-                    new File("features"),
-                    new File("features.json")
-            };
-            File f = null;
-            for(final File c : candidates) {
-                if ( c.exists() ) {
-                    f = c;
-                    break;
-                }
-            }
-            // nothing found, we default to the first candidate and fail later
-            if ( f == null ) {
-                f = candidates[0];
-            }
-
-            featureFiles = new String[] {f.getAbsolutePath()};
-        }
-
-        final List<String> paths = new ArrayList<>();
-        for(final String name : featureFiles) {
-            // check for absolute
-            if ( name.indexOf(':') > 1 ) {
-                paths.add(name);
-            } else {
-                // file or relative
-                File f = null;
-                final File test = new File(name);
-                if ( test.isAbsolute() ) {
-                    f = test;
-                } else {
-                    final File[] candidates = {
-                            new File(homeDirectory, name),
-                            new File(homeDirectory, "features" + File.separatorChar + name),
-                            new File(name),
-                            new File("features" + File.separatorChar + name),
-                    };
-                    for(final File c : candidates) {
-                        if ( c.exists() && c.isFile() ) {
-                            f = c;
-                            break;
-                        }
-                    }
-                }
-
-                if ( f != null && f.exists() ) {
-                    if ( f.isFile() ) {
-                        processFile(paths, f);
-                    } else {
-                        processDir(paths, f);
-                    }
-                } else {
-                    // we simply add the path and fail later on
-                    paths.add(new File(name).getAbsolutePath());
-                }
-            }
-        }
-
-        Collections.sort(paths, FEATURE_PATH_COMP);
-        return paths;
-    }
-
     /**
      * Assemble an application based on the given files.
      *
@@ -222,18 +63,21 @@ public class FeatureUtil {
      */
     public static Application assembleApplication(
             Application app,
-            final ArtifactManager artifactManager, FeatureResolver fr, final String... featureFiles)
+            final ArtifactManager artifactManager,
+            final FeatureResolver fr,
+            final String... featureFiles)
     throws IOException {
         final List<Feature> features = new ArrayList<>();
         for(final String initFile : featureFiles) {
-            final Feature f = getFeature(initFile, artifactManager);
+            final Feature f = org.apache.sling.feature.support.io.FeatureUtil.getFeature(initFile,
artifactManager, SubstituteVariables.RESOLVE);
             features.add(f);
         }
 
         return assembleApplication(app, artifactManager, fr, features.toArray(new Feature[0]));
     }
 
-    public static Feature[] sortFeatures(final FeatureResolver fr, final Feature... features)
{
+    public static Feature[] sortFeatures(final FeatureResolver fr,
+            final Feature... features) {
         final List<Feature> featureList = new ArrayList<>();
         for(final Feature f : features) {
             featureList.add(f);
@@ -260,7 +104,9 @@ public class FeatureUtil {
 
     public static Application assembleApplication(
             Application app,
-            final ArtifactManager artifactManager, FeatureResolver fr, final Feature... features)
+            final ArtifactManager artifactManager,
+            final FeatureResolver fr,
+            final Feature... features)
     throws IOException {
         if ( features.length == 0 ) {
             throw new IOException("No features found.");
@@ -292,28 +138,4 @@ public class FeatureUtil {
 
         return app;
     }
-
-    /**
-     * Read the feature
-     *
-     * @param file The feature file
-     * @param artifactManager The artifact manager to read the feature
-     * @return The read feature
-     * @throws IOException If reading fails
-     */
-    public static Feature getFeature(final String file,
-            final ArtifactManager artifactManager) throws IOException {
-        return getFeature(file, artifactManager, SubstituteVariables.RESOLVE);
-    }
-
-    public static Feature getFeature(final String file,
-            final ArtifactManager artifactManager, final SubstituteVariables substituteVariables)
-    throws IOException {
-        final ArtifactHandler featureArtifact = artifactManager.getArtifactHandler(file);
-
-        try (final FileReader r = new FileReader(featureArtifact.getFile())) {
-            final Feature f = FeatureJSONReader.read(r, featureArtifact.getUrl(), substituteVariables);
-            return f;
-        }
-    }
 }
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/io/FeatureUtil.java
similarity index 64%
copy from featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
copy to featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/io/FeatureUtil.java
index d5358fa..d059dda 100644
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/FeatureUtil.java
+++ b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/io/FeatureUtil.java
@@ -14,7 +14,7 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.sling.feature.support;
+package org.apache.sling.feature.support.io;
 
 import java.io.File;
 import java.io.FileReader;
@@ -25,31 +25,13 @@ import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
-import org.apache.sling.feature.Application;
-import org.apache.sling.feature.ArtifactId;
 import org.apache.sling.feature.Feature;
 import org.apache.sling.feature.support.artifact.ArtifactHandler;
 import org.apache.sling.feature.support.artifact.ArtifactManager;
 import org.apache.sling.feature.support.json.FeatureJSONReader;
 import org.apache.sling.feature.support.json.FeatureJSONReader.SubstituteVariables;
-import org.apache.sling.feature.support.process.ApplicationBuilder;
-import org.apache.sling.feature.support.process.BuilderContext;
-import org.apache.sling.feature.support.process.FeatureProvider;
-import org.apache.sling.feature.support.resolver.FeatureResolver;
-import org.apache.sling.feature.support.resolver.FeatureResource;
 
 public class FeatureUtil {
-    /**
-     * Get an artifact id for the Apache Felix framework
-     * @param version The version to use or {@code null} for the default version
-     * @return The artifact id
-     * @throws IllegalArgumentException If the provided version is invalid
-     */
-    public static ArtifactId getFelixFrameworkId(final String version) {
-        return new ArtifactId("org.apache.felix",
-                "org.apache.felix.framework",
-                version != null ? version : "5.6.10", null, null);
-    }
 
     static final Comparator<String> FEATURE_PATH_COMP = new Comparator<String>()
{
 
@@ -209,105 +191,17 @@ public class FeatureUtil {
     }
 
     /**
-     * Assemble an application based on the given files.
-     *
-     * Read the features and assemble the application
-     * @param app The optional application to use as a base.
-     * @param featureFiles The feature files.
-     * @param artifactManager The artifact manager
-     * @param fr
-     * @return The assembled application
-     * @throws IOException If a feature can't be read or no feature is found.
-     * @see #getFeatureFiles(File, String...)
-     */
-    public static Application assembleApplication(
-            Application app,
-            final ArtifactManager artifactManager, FeatureResolver fr, final String... featureFiles)
-    throws IOException {
-        final List<Feature> features = new ArrayList<>();
-        for(final String initFile : featureFiles) {
-            final Feature f = getFeature(initFile, artifactManager);
-            features.add(f);
-        }
-
-        return assembleApplication(app, artifactManager, fr, features.toArray(new Feature[0]));
-    }
-
-    public static Feature[] sortFeatures(final FeatureResolver fr, final Feature... features)
{
-        final List<Feature> featureList = new ArrayList<>();
-        for(final Feature f : features) {
-            featureList.add(f);
-        }
-
-        final List<Feature> sortedFeatures;
-        if (fr != null) {
-            // order by dependency chain
-            final List<FeatureResource> sortedResources = fr.orderResources(featureList);
-
-            sortedFeatures = new ArrayList<>();
-            for (final FeatureResource rsrc : sortedResources) {
-                Feature f = rsrc.getFeature();
-                if (!sortedFeatures.contains(f)) {
-                    sortedFeatures.add(rsrc.getFeature());
-                }
-            }
-        } else {
-            sortedFeatures = featureList;
-            Collections.sort(sortedFeatures);
-        }
-        return sortedFeatures.toArray(new Feature[sortedFeatures.size()]);
-    }
-
-    public static Application assembleApplication(
-            Application app,
-            final ArtifactManager artifactManager, FeatureResolver fr, final Feature... features)
-    throws IOException {
-        if ( features.length == 0 ) {
-            throw new IOException("No features found.");
-        }
-
-        app = ApplicationBuilder.assemble(app, new BuilderContext(new FeatureProvider() {
-
-            @Override
-            public Feature provide(final ArtifactId id) {
-                try {
-                    final ArtifactHandler handler = artifactManager.getArtifactHandler("mvn:"
+ id.toMvnPath());
-                    try (final FileReader r = new FileReader(handler.getFile())) {
-                        final Feature f = FeatureJSONReader.read(r, handler.getUrl(), SubstituteVariables.RESOLVE);
-                        return f;
-                    }
-
-                } catch (final IOException e) {
-                    // ignore
-                }
-                return null;
-            }
-        }), sortFeatures(fr, features));
-
-        // check framework
-        if ( app.getFramework() == null ) {
-            // use hard coded Apache Felix
-            app.setFramework(getFelixFrameworkId(null));
-        }
-
-        return app;
-    }
-
-    /**
      * Read the feature
      *
      * @param file The feature file
      * @param artifactManager The artifact manager to read the feature
+     * @param substituteVariables Variable substitution handling
      * @return The read feature
      * @throws IOException If reading fails
      */
     public static Feature getFeature(final String file,
-            final ArtifactManager artifactManager) throws IOException {
-        return getFeature(file, artifactManager, SubstituteVariables.RESOLVE);
-    }
-
-    public static Feature getFeature(final String file,
-            final ArtifactManager artifactManager, final SubstituteVariables substituteVariables)
+            final ArtifactManager artifactManager,
+            final SubstituteVariables substituteVariables)
     throws IOException {
         final ArtifactHandler featureArtifact = artifactManager.getArtifactHandler(file);
 
diff --git a/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/FeatureUtilTest.java
b/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/io/FeatureUtilTest.java
similarity index 97%
rename from featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/FeatureUtilTest.java
rename to featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/io/FeatureUtilTest.java
index 1f3ff48..1df7822 100644
--- a/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/FeatureUtilTest.java
+++ b/featuremodel/feature-support/src/test/java/org/apache/sling/feature/support/io/FeatureUtilTest.java
@@ -14,16 +14,16 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.apache.sling.feature.support;
+package org.apache.sling.feature.support.io;
 
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
+import org.junit.Test;
 
 public class FeatureUtilTest {
 
diff --git a/featuremodel/osgifeature-maven-plugin/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
b/featuremodel/osgifeature-maven-plugin/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
index 65191a2..6c1a3ef 100644
--- a/featuremodel/osgifeature-maven-plugin/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
+++ b/featuremodel/osgifeature-maven-plugin/src/main/java/org/apache/sling/feature/maven/Preprocessor.java
@@ -16,6 +16,15 @@
  */
 package org.apache.sling.feature.maven;
 
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
 import org.apache.maven.model.Dependency;
 import org.apache.maven.project.MavenProject;
 import org.apache.sling.feature.Artifact;
@@ -23,7 +32,6 @@ import org.apache.sling.feature.ArtifactId;
 import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
 import org.apache.sling.feature.Feature;
-import org.apache.sling.feature.support.FeatureUtil;
 import org.apache.sling.feature.support.json.FeatureJSONReader;
 import org.apache.sling.feature.support.json.FeatureJSONReader.SubstituteVariables;
 import org.apache.sling.feature.support.process.BuilderContext;
@@ -31,15 +39,6 @@ import org.apache.sling.feature.support.process.FeatureBuilder;
 import org.apache.sling.feature.support.process.FeatureProvider;
 import org.codehaus.plexus.logging.Logger;
 
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
 /**
  * The processor processes all feature projects.
  */
@@ -236,7 +235,7 @@ public class Preprocessor {
 
             for(final File file : files) {
                 try {
-                    final List<String> features = FeatureUtil.parseFeatureRefFile(file);
+                    final List<String> features = org.apache.sling.feature.support.io.FeatureUtil.parseFeatureRefFile(file);
                     if ( features.isEmpty() ) {
                         env.logger.debug("Empty feature ref file at " + file);
                     } else {

-- 
To stop receiving notification emails like this one, please contact
cziegeler@apache.org.

Mime
View raw message