Thanks Carsten! On Thu, Jul 23, 2020 at 1:10 AM Carsten Ziegeler <[email protected]> wrote:
> Hi, > > for your first question from the first mail, there is a test for that as > part of the plugin. Have a look at > > https://github.com/apache/sling-slingfeature-maven-plugin/blob/master/src/it/attach-metadata-from-pom/pom.xml#L54 > how this works. Thanks, I re-read the example and think I was getting confused between the variables and the placeholders. It appears to do "variables" in Feature Model for items which are resolved from Maven, you actually want to use placeholders and provide the value as a property in the pom.xml. When I tried using the variables to contain the dependency version, it still fails to resolve the dependency, but seems to work fine when I put the dependency variable as a POM property: https://github.com/apache/sling-org-apache-sling-starter/compare/feature/SLING-9595...feature/SLING-9595-with-variables > > What do you mean with "slingfeature artifacts" - the feature model > itself or a feature archive? Both can be created with the slingfeature > maven plugin. The model files can be the source of that project, or they > can be aggregated, or even generated with any other plugin. And then > they can be attached as artifacts of the project. > Similar, you can configure the attach-featurearchives mojo to produce > and attach feature archives based on any feature model. > Ah, I got it, the classifier for the artifacts are created as "slingosgifeature" and my prototype was looking for "slingfeature" > > If you want to remove things (bundles, content packages, configurations) > from a feature then the only way to do this is creating a prototype. > Features should form a reusable unit, so there should only be rare cases > where you want or need to remove something from that unit. Of course > that requires that the units are cut in a good way and are not just a > collection of random things. > Makes sense. Based on this response, I'm thinking that most likely if you were to create a Sling-based application you would not use the Sling Starter as a prototype for a couple reasons. First, you wouldn't want to be tied to Sling Starter's releases and secondly Starter has a relatively opinionated configuration and requires a fair number of removals for extension. Based on that, it feels like once we transition to feature model, it would make a lot of sense to create a number of feature projects for common Sling sub-module groups, such as repoinit, composum, oak, etc so that implementers of Sling can pull those features rather than defining everything from scratch. > > Regards > Carsten > > Am 23.07.2020 um 05:26 schrieb Daniel Klco: > > Sorry, I found two more questions related to the feature model: > > > > 1. How does one produce slingfeature artifacts? I'm not clear how this > > would work and the Starter reference doesn't do this > > 2. How would one remove artifacts from an aggregate feature? For > example, I > > want to > > remove com.composum.sling.core:composum-sling-user-management:1.12.0 > > from > org.apache.sling:org.apache.sling.starter:slingfeature:sling:12-SNAPSHOT > > (which I sideloaded into my local maven), but when I try to do this, it > > complains: > > org.apache.maven.InternalErrorException: Internal error: > > java.lang.IllegalStateException: Bundle > > com.composum.sling.core:composum-sling-user-management:1.12.0 can't be > > removed from feature > > org.apache.sling:org.apache.sling.starter:slingfeature:sling:12-SNAPSHOT > as > > it is not part of that feature. > > Is this not supported? Or will I need to prototype every aggregated > module > > of sling starter? > > > > On Wed, Jul 22, 2020 at 10:45 PM Daniel Klco <[email protected]> wrote: > > > >> Hi, > >> > >> I've been looking into the feature model for the CMS App and > investigating > >> Robert's Feature Model implementation[1] of the Sling Starter. > >> > >> One thing I can't get to work is variable interpolation inside the > models. > >> I was expecting that I could do the same thing currently in the > >> Provisioning model for version variables, such as oak.version or > >> slf4j.version, but when I attempted to set these variables the feature > >> model, maven fails when resolving dependencies. > >> > >> I tried setting the replacePropertyVariables property in the execution > as > >> documented[2] but no change. > >> > >> Is this not possible or is there something I missed? > >> > >> [1] > >> > https://github.com/apache/sling-org-apache-sling-starter/tree/feature/SLING-9595 > >> [2] https://github.com/apache/sling-slingfeature-maven-plugin > >> > > > > -- > -- > Carsten Ziegeler > Adobe Research Switzerland > [email protected] >
