sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [sling-org-apache-sling-feature-modelconverter] 02/40: Fix converting latest Sling Starter app
Date Fri, 27 Apr 2018 10:01:20 GMT
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-org-apache-sling-feature-modelconverter.git

commit 3f6643dc7b5721efa739b0fea3649a1a3f92afa9
Author: Robert Munteanu <rombert@apache.org>
AuthorDate: Tue Nov 28 13:34:46 2017 +0200

    Fix converting latest Sling Starter app
---
 .../java/org/apache/sling/feature/modelconverter/impl/Main.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java b/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
index f030367..ff88255 100644
--- a/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
+++ b/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
@@ -271,7 +271,8 @@ public class Main {
 
         for(final Feature feature : model.getFeatures() ) {
             final String idString;
-            if ( feature.getName() != null ) {
+            // use a default name if not present or not usable as a Maven artifactId ( starts
with ':') 
+            if ( feature.getName() != null && !feature.isSpecial() ) {
                 if ( feature.getVersion() != null ) {
                     idString = "generated/" + feature.getName() + "/" + feature.getVersion();
                 } else {
@@ -280,7 +281,7 @@ public class Main {
             } else {
                 idString = "generated/feature/1.0.0";
             }
-            final org.apache.sling.feature.Feature f = new org.apache.sling.feature.Feature(ArtifactId.fromMvnId(idString));
+            final org.apache.sling.feature.Feature f = new org.apache.sling.feature.Feature(ArtifactId.parse(idString));
             features.add(f);
 
             buildFromFeature(feature, f.getBundles(), f.getConfigurations(), f.getExtensions(),
f.getFrameworkProperties());
@@ -297,7 +298,7 @@ public class Main {
         }
 
         // hard coded dependency to launchpad api
-        app.getBundles().add(1, new org.apache.sling.feature.Artifact(ArtifactId.fromMvnId("org.apache.sling/org.apache.sling.launchpad.api/1.2.0")));
+        app.getBundles().add(1, new org.apache.sling.feature.Artifact(ArtifactId.parse("org.apache.sling/org.apache.sling.launchpad.api/1.2.0")));
         // sling.properties (TODO)
         if ( propsFile == null ) {
             app.getFrameworkProperties().put("org.osgi.framework.bootdelegation", "sun.*,com.sun.*");

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

Mime
View raw message