On Tuesday 10 November 2015 14:22:51 Oliver Lietz wrote:
> 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.

The cause for this trouble is a version mismatch in 
org.apache.karaf.profile.assembly.Builder between Maven and OSGi.
I've used ${project.version} in the features file which is now 0.1.1-SNAPSHOT 
and it is compared with 0.1.1.SNAPSHOT. Workaround applied in r1713734 
(http://svn.apache.org/viewvc?view=revision&revision=1713734).

Is 0.1.1-SNAPSHOT an invalid feature version? If so, compiling the feature 
should fail or the version should be OSGified automatically.

If it is valid, org.apache.karaf.profile.assembly.Builder should be improved 
when comparing versions.

WDYT?

Regards,
O.

> 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:58
> 6) 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.


Reply via email to