On Tuesday 10 November 2015 11:53:10 Jean-Baptiste Onofré wrote:
> Hi,
>
> you can specify the kar in dependency, and choose the features
> (installed, boot, etc) in the karaf-maven-plugin configuration.
>
> Is it what you do ?
Right. I tried with features and kar and scopes compile and runtime but the
build fails somehow or other or succeeds but then all features are
"installed". My goal is to build a "standard" Karaf distribution bundled with
Sling's features where a user can decide which features to install - even if
this means I have to declare all features as installedFeatures in the
configuration.
With kar and scope runtime and no installedFeatures configured the build fails
with not finding feature sling-commons-scheduler[1]. It succeeds with features
and scope runtime and no installedFeatures configured, but fails as soon as
one of Sling's features is configured as installedFeature. But then it's
jackrabbit-sling which cannot be found and not sling-commons-scheduler.
Nasty... I cannot see why it fails. Any help appreciated.
I would start to debug karaf-maven-plugin and try to find out what is going
wrong as I think the features and kar are fine.
Thanks,
O.
[1]:
[DEBUG] Resolved (org.apache.sling:org.apache.sling.launchpad.karaf-
features:xml:features:0.1.1-SNAPSHOT) as
/[...]/.m2/repository/org/apache/sling/org.apache.sling.launchpad.karaf-
features/0.1.1-SNAPSHOT/org.apache.sling.launchpad.karaf-features-0.1.1-
SNAPSHOT-features.xml
[...]
[DEBUG] Connection manager is shutting down
[DEBUG] Connection manager shut down
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-
plugin:4.0.3:assembly (default-assembly) on project
org.apache.sling.launchpad.karaf-distribution: Unable to build assembly: Could
not find matching feature for sling-commons-scheduler/0.1.1-SNAPSHOT -> [Help
1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.0.3:assembly (default-assembly)
on project org.apache.sling.launchpad.karaf-distribution: Unable to build
assembly
[...]
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to build
assembly
[...]
Caused by: java.lang.IllegalStateException: Could not find matching feature
for sling-commons-scheduler/0.1.1-SNAPSHOT
at
org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1053)
at
org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1046)
at
org.apache.karaf.profile.assembly.Builder.addFeatures(Builder.java:1046)
at org.apache.karaf.profile.assembly.Builder.bootStage(Builder.java:786)
at
org.apache.karaf.profile.assembly.Builder.doGenerateAssembly(Builder.java:586)
at
org.apache.karaf.profile.assembly.Builder.generateAssembly(Builder.java:375)
at
org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo.java:330)
at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:178)
... 22 more
> Regards
> JB
>
> On 11/10/2015 11:25 AM, Oliver Lietz wrote:
> > hi,
> >
> > is there a way to add a kar to a custom distribution build (for offline
> > usage) with karaf-assembly but _without_ installing all containing
> > features automatically?
> >
> > Thanks,
> > O.