You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/28 11:35:37 UTC
[sling-whiteboard] 01/01: Fix converting latest Sling Starter app
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch feature/fix-modelconverter
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
commit b6696a94f12b6a0aef4be156477af6e4fb909c4f
Author: Robert Munteanu <ro...@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/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java b/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
index f030367..ff88255 100644
--- a/featuremodel/feature-modelconverter/src/main/java/org/apache/sling/feature/modelconverter/impl/Main.java
+++ b/featuremodel/feature-modelconverter/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
"commits@sling.apache.org" <co...@sling.apache.org>.