Hi Guillaume, I created https://issues.apache.org/jira/browse/KARAF-5165 for the issue and put it to component karaf-feature (though I am not sure whether this is the correct component for this). The attached POM will reproduce the issue, if you uncomment the three lines in there, you will get the expected result.
Best regards Stephan From: Guillaume Nodet [mailto:[email protected]] Sent: Dienstag, 30. Mai 2017 13:54 To: user <[email protected]> Subject: Re: strange issue with karaf-maven-plugin When the plugin creates the assembly, it needs to compute what resources are needed for boot features. Startup features are pre-installed, so the resolution happens at build time, however, boot features are resolved at startup time by the FeaturesService, which means it needs all the input files. If you have multiple versions for a given feature, the plugin will put all the repositories in the assembly, so that the FeaturesService will be responsible for doing the resolution and choosing which feature to install. That can explain why you have multiple versions in the assembly. I'm not really sure why you would end up with both 6.0.3 and 6.0.4 versions installed at runtime though. Could you create a jira and attach a pom to replicate the issue, it may be worth investigating... 2017-05-30 13:36 GMT+02:00 Siano, Stephan <[email protected]<mailto:[email protected]>>: Hi, one update: After I added the boot following boot features <feature>pax-war-tomcat/6.0.4</feature> <feature>pax-http-whiteboard/6.0.4</feature> <feature>pax-http-tomcat/6.0.4</feature> <feature>pax-war/6.0.4</feature> it works, so I have a workaround for now, however it would be interesting to find out why this works. Best regards Stephan -----Original Message----- From: Siano, Stephan [mailto:[email protected]<mailto:[email protected]>] Sent: Dienstag, 30. Mai 2017 11:27 To: [email protected]<mailto:[email protected]> Subject: strange issue with karaf-maven-plugin Hi, I am trying to build a custom karaf distribution with the karaf-maven-plugin. In my pom, I have defined compile time dependencies to the framework kar and the standard feature xml and runtime dependencies to the framework, spring and enterprise feature xmls. The karaf -maven-plugin defines framework-logback as framework, eventadmin as startup feature, wrapper as installed feature, and standard and pax-war-tomcat as boot features. If I do this, everything seems to work as expected, I get a custom distribution with logback logger and a tomcat web container: ... pax-http | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Implementation of the OSGI HTTP Service pax-http-whiteboard | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide HTTP Whiteboard pattern support pax-war | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide support of a full WebContainer pax-http-tomcat | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide Tomcat support pax-war-tomcat | 6.0.3 | x | Started | org.ops4j.pax.web-6.0.3 | Now I want to change the pax-web version (from 6.0.3 as defined in karaf 4.1.1 to 6.0.4). In order to do that, I added the pax-web feature xml in version 6.0.4 as a runtime dependency and changed the boot feature from "pax-war-tomcat" to "pax-war-tomcat/6.0.4". The resulting distribution is a bit weird. Name | Version | Required | State | Repository | Description --------------------+------------------+----------+---------+-------------------------+-------------------------------------------------- pax-jetty | 9.3.14.v20161028 | | Started | org.ops4j.pax.web-6.0.4 | Provide Jetty engine support pax-http-jetty | 6.0.4 | | Started | org.ops4j.pax.web-6.0.4 | pax-http | 6.0.4 | | Started | org.ops4j.pax.web-6.0.4 | Implementation of the OSGI HTTP Service pax-http-whiteboard | 6.0.4 | | Started | org.ops4j.pax.web-6.0.4 | Provide HTTP Whiteboard pattern support pax-war | 6.0.4 | | Started | org.ops4j.pax.web-6.0.4 | Provide support of a full WebContainer pax-http-tomcat | 6.0.4 | | Started | org.ops4j.pax.web-6.0.4 | Provide Tomcat support pax-war-tomcat | 6.0.4 | x | Started | org.ops4j.pax.web-6.0.4 | ... pax-jetty | 9.3.14.v20161028 | | Started | org.ops4j.pax.web-6.0.3 | Provide Jetty engine support pax-http-jetty | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | pax-http-whiteboard | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide HTTP Whiteboard pattern support pax-war | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide support of a full WebContainer pax-http-tomcat | 6.0.3 | | Started | org.ops4j.pax.web-6.0.3 | Provide Tomcat support As you can see there are not only the expected features installed (in version 6.0.3), but also the pax-web-jetty and the pax-jetty features. The installed versions are not only 6.0.4 but also 6.0.3. Does anyone have an idea what is going on here? What do I need to change to avoid installing pax-http-jetty and pax-jetty? Why are actually both versions installed (6.0.4 and 6.0.4)? I could not find any installed feature that depends on pax-http-tomcat in version 6.0.3. Best regards Stephan -- ------------------------ Guillaume Nodet
