Hi Konrad,

On Mon, 2023-07-10 at 19:22 +0200, Konrad Windszus wrote:
> Hi,
> Thanks for the input. I started with a draft which uses the Starter
> during the IT of the Models Impl in
> https://github.com/apache/sling-org-apache-sling-models-impl/pull/46.
> Unfortunately the “repository” goal of the slingfeature-maven-plugin
> (
> https://sling.apache.org/components/slingfeature-maven-plugin/reposito
> ry-mojo.html) doesn’t work like I expected.
> The generated repository is almost empty and consequently starting
> the feature afterwards with the feature-launcher based on the
> previously generated repository fails with:
> 
> [ERROR] Error while assembling launcher: Artifact
> :org/apache/felix/org.apache.felix.framework/7.0.0/org.apache.felix.f
> ramework-7.0.0.jar not found in any repository.

(snip)

I don't have a direct answer to your question, but I can say that what
has worked for me is at [1]. I don't use prototype features, but
instead add the Sling Starter features directly to the aggregate.

That may not work for your use case because you would need to add an
artifact clash policy, which is not yet exposed from the feature-
launcher-maven-plugin.

        -C,--artifact-clash

If needed, we can improve the feature-launcher-maven-plugin by adding
the artifact clash and config clash flags.

Other suggestions:

1. You can add the artifact being built to the feature model definition
automatically, I see you removed it explicitly

        <skipAddJarToFeature>false</skipAddJarToFeature>
        <jarStartOrder>25</jarStartOrder>

2. You can define the felix framework directly in the feature model
file, this way it's processed automatically by the 'repository' goal

    "execution-environment:JSON|false":{
        "framework":{
            "id":"org.apache.felix:org.apache.felix.framework:7.0.5"
        }
    }


Thanks,
Robert

[1]:
https://github.com/apache/sling-whiteboard/blob/3e6f7f0aeaeb0cbdd918eeed285fd81b9d7ff44b/org.apache.sling.servlets.oidc-rp/pom.xml#L85-L118

Reply via email to