You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Robert Munteanu <ro...@apache.org> on 2020/05/05 09:55:22 UTC

Building a main + test jar from the provisioning model

Hi,

I am trying out moving the launchpad-testing module to the sling
starter. This is just an experiment for now, will get back to the list
in case I am successful for a proper discussion.

The launchpad-testing module has its own limited provisioning model
file [1]. I am trying to add it to the sling starter, without having it
end up in the main jar file.

Just copy-pasting it to src/test/provisioning/model.text lead to and
error

  [ERROR] Recursive model dependency list including project MavenProject: org.apache.sling:org.apache.sling.starter:12-SNAPSHOT @ /home/robert/sources/apache/sling/org-apache-sling-starter/pom.xml -> [Help 1]

I guess that's warranted, so next I removed it, but got scolded because

  [ERROR] No launchpad feature found. -> [Help 1]

I guess that the Maven plug-in expects a full provisioning model under
src/test/provisioning, while I'm looking to:

- build a main jar from src/main/provisioning
- build a test jar from src/test/provisioning, extending the main jar

Is there a way to achieve that with the provisioning model? I'm also
open to alternative suggestions on how I can build a main + test jar
for the Sling Starter.

Thanks,
Robert

[1]: https://github.com/apache/sling-org-apache-sling-launchpad-testing/blob/master/src/main/provisioning/model.txt


Re: Building a main + test jar from the provisioning model

Posted by Konrad Windszus <ko...@gmx.de>.
Hi Robert,
I guess you need some tweaks in https://github.com/apache/sling-slingstart-maven-plugin/blob/5bbdae1d61698ac202845e5f242ecc8b602e7ed6/src/main/java/org/apache/sling/maven/slingstart/run/StartMojo.java#L366.
The launchpad to start must consist of the merged 2 provisioning models, so most probably you also need to adjust how the merged 2 provisioning models are built...

Konrad

> On 5. May 2020, at 11:55, Robert Munteanu <ro...@apache.org> wrote:
> 
> Hi,
> 
> I am trying out moving the launchpad-testing module to the sling
> starter. This is just an experiment for now, will get back to the list
> in case I am successful for a proper discussion.
> 
> The launchpad-testing module has its own limited provisioning model
> file [1]. I am trying to add it to the sling starter, without having it
> end up in the main jar file.
> 
> Just copy-pasting it to src/test/provisioning/model.text lead to and
> error
> 
>  [ERROR] Recursive model dependency list including project MavenProject: org.apache.sling:org.apache.sling.starter:12-SNAPSHOT @ /home/robert/sources/apache/sling/org-apache-sling-starter/pom.xml -> [Help 1]
> 
> I guess that's warranted, so next I removed it, but got scolded because
> 
>  [ERROR] No launchpad feature found. -> [Help 1]
> 
> I guess that the Maven plug-in expects a full provisioning model under
> src/test/provisioning, while I'm looking to:
> 
> - build a main jar from src/main/provisioning
> - build a test jar from src/test/provisioning, extending the main jar
> 
> Is there a way to achieve that with the provisioning model? I'm also
> open to alternative suggestions on how I can build a main + test jar
> for the Sling Starter.
> 
> Thanks,
> Robert
> 
> [1]: https://github.com/apache/sling-org-apache-sling-launchpad-testing/blob/master/src/main/provisioning/model.txt
> 


Re: Building a main + test jar from the provisioning model

Posted by Robert Munteanu <ro...@apache.org>.
Thanks Carsten and Konrad.

I hoped there would be a very simple solution that I overlooked. I
think we should look into this once we have moved to the feature model,
which I guess makes lauching such combinations very easy.

Thanks,
Robert

On Tue, 2020-05-05 at 13:32 +0200, Carsten Ziegeler wrote:
> I'm not sure if this works ootb, but you could try creating a model 
> archive out of the testing provisioning model and then at runtime
> use 
> the osgi installer (with the prov model plugin) to install the
> testing part.
> 
> I think the slingfeature maven plugin is flexible enough to do so
> for 
> feature models, not sure if the slingstart maven plugin provides
> this 
> flexibility for provisioning models
> 
> Regards
> Carsten
> 
> On 05.05.2020 11:55, Robert Munteanu wrote:
> > Hi,
> > 
> > I am trying out moving the launchpad-testing module to the sling
> > starter. This is just an experiment for now, will get back to the
> > list
> > in case I am successful for a proper discussion.
> > 
> > The launchpad-testing module has its own limited provisioning model
> > file [1]. I am trying to add it to the sling starter, without
> > having it
> > end up in the main jar file.
> > 
> > Just copy-pasting it to src/test/provisioning/model.text lead to
> > and
> > error
> > 
> >    [ERROR] Recursive model dependency list including project
> > MavenProject: org.apache.sling:org.apache.sling.starter:12-SNAPSHOT 
> > @ /home/robert/sources/apache/sling/org-apache-sling-
> > starter/pom.xml -> [Help 1]
> > 
> > I guess that's warranted, so next I removed it, but got scolded
> > because
> > 
> >    [ERROR] No launchpad feature found. -> [Help 1]
> > 
> > I guess that the Maven plug-in expects a full provisioning model
> > under
> > src/test/provisioning, while I'm looking to:
> > 
> > - build a main jar from src/main/provisioning
> > - build a test jar from src/test/provisioning, extending the main
> > jar
> > 
> > Is there a way to achieve that with the provisioning model? I'm
> > also
> > open to alternative suggestions on how I can build a main + test
> > jar
> > for the Sling Starter.
> > 
> > Thanks,
> > Robert
> > 
> > [1]: 
> > https://github.com/apache/sling-org-apache-sling-launchpad-testing/blob/master/src/main/provisioning/model.txt
> > 


Re: Building a main + test jar from the provisioning model

Posted by Carsten Ziegeler <cz...@apache.org>.
I'm not sure if this works ootb, but you could try creating a model 
archive out of the testing provisioning model and then at runtime use 
the osgi installer (with the prov model plugin) to install the testing part.

I think the slingfeature maven plugin is flexible enough to do so for 
feature models, not sure if the slingstart maven plugin provides this 
flexibility for provisioning models

Regards
Carsten

On 05.05.2020 11:55, Robert Munteanu wrote:
> Hi,
> 
> I am trying out moving the launchpad-testing module to the sling
> starter. This is just an experiment for now, will get back to the list
> in case I am successful for a proper discussion.
> 
> The launchpad-testing module has its own limited provisioning model
> file [1]. I am trying to add it to the sling starter, without having it
> end up in the main jar file.
> 
> Just copy-pasting it to src/test/provisioning/model.text lead to and
> error
> 
>    [ERROR] Recursive model dependency list including project MavenProject: org.apache.sling:org.apache.sling.starter:12-SNAPSHOT @ /home/robert/sources/apache/sling/org-apache-sling-starter/pom.xml -> [Help 1]
> 
> I guess that's warranted, so next I removed it, but got scolded because
> 
>    [ERROR] No launchpad feature found. -> [Help 1]
> 
> I guess that the Maven plug-in expects a full provisioning model under
> src/test/provisioning, while I'm looking to:
> 
> - build a main jar from src/main/provisioning
> - build a test jar from src/test/provisioning, extending the main jar
> 
> Is there a way to achieve that with the provisioning model? I'm also
> open to alternative suggestions on how I can build a main + test jar
> for the Sling Starter.
> 
> Thanks,
> Robert
> 
> [1]: https://github.com/apache/sling-org-apache-sling-launchpad-testing/blob/master/src/main/provisioning/model.txt
> 

-- 
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org