On 18 Nov 2011, at 14:53, Andrei Pozolotin wrote: > Stuart: > > probably I could ask more simple question: > > how is <Service-Component> related to <Include-Resource>?
This is a BND feature - when you use the Service-Component instruction it scans the project classpath for components and adds the necessary XML to the final bundle, therefore Include-Resource is not necessary. But if you generate files under OSGI-INF using another mechanism then they won't end up in the bundle unless you add that directory using Include-Resource (this goes back to the core design decision that BND pulls classes and resources into the bundle, rather than just taking everything under target/classes). We try to provide reasonable defaults on the Maven side in the bundleplugin so local classes/resources will end up in the bundle without additional configuration, but we do this by looking at the effective pom and src/ folder rather than the generated target/ If you think there's a case where we could deduce a local resource should be in the bundle (ie. from the pom or src/, not just because it's under target/) and it isn't then please open an issue with a suggested patch. HTH > in other words, do you automatically include the resources listed in > service component? > > thanks, > > Andrei > > -------- Original Message -------- > Subject: Re: Latest maven-bundle-plugin 2.4.0-SNAPSHOT > From: Stuart McCulloch <[email protected]> > To: [email protected] > Date: Thu 17 Nov 2011 04:29:16 PM CST >> On 17 Nov 2011, at 22:12, Andrei Pozolotin wrote: >> >>> Stuart: >>> >>> one more bizarreness: >>> >>> 1) parent pom declares >>> >>> <plugin> >>> <groupId>org.apache.felix</groupId> >>> <artifactId>maven-bundle-plugin</artifactId> >>> <extensions>true</extensions> >>> <configuration> >>> <instructions> >>> <Import-Package>*,META-INF.services</Import-Package> >>> >>> <Service-Component>OSGI-INF/components/*.xml</Service-Component> >>> </instructions> >>> </configuration> >>> </plugin> >>> >>> 2) one module does not extend maven-bundle-plugin properties, and >>> OSGI-INF gets included in jar OK >>> >>> 3) but another module extends (to add custom "manifest" goal execution); >>> but now "bundle" goal needs extra resource spec: >>> >>> <execution> >>> <id>default-bundle</id> >>> <goals> >>> <goal>bundle</goal> >>> </goals> >>> <configuration> >>> <instructions> >>> <Include-Resource> >>> OSGI-INF=target/classes/OSGI-INF, >>> {maven-resources} >>> </Include-Resource> >>> </instructions> >>> </configuration> >>> </execution> >>> >>> is it by design? >> this sounds more like a Maven question since we just take the merged >> configuration direct from Maven and don't do any parent-pom processing >> ourselves >> >> you can investigate this with: >> >> a) "mvn help:effective-pom" to find out what the merged pom looks like >> from Maven's perspective - it may be that the merged pom is not quite what >> you expect, hence the different results >> >> b) "mvn -X clean install" and capture the output, search for the "BND" >> sections which show the exact instructions sent to BND and the manifest >> received back >> >> if things are still unclear post the results of the above in a followup >> (check in case the output contains confidential info) or sent it direct to me >> >>> Andrei >>> >>> -------- Original Message -------- >>> Subject: Re: Latest maven-bundle-plugin 2.4.0-SNAPSHOT >>> From: Stuart McCulloch <[email protected]> >>> To: [email protected] >>> Date: Thu 17 Nov 2011 03:00:43 PM CST >>>> On 17 Nov 2011, at 20:58, Andrei Pozolotin wrote: >>>> >>>>> Stuart: >>>>> >>>>> 0) I have maven-bundle-plugin enabled in the project; >>>>> >>>>> 1) I have other plugin that places some generated files directly in >>>>> {basedir}/target/classes >>>>> >>>>> 2) when I run "mvn jar:jar" these files appear in the final jar just fine; >>>>> >>>>> 3) but when I run "mvn package" (which invokes maven-bundle-plugin for >>>>> jarring) >>>>> these artifacts are not in the jar any more; >>>>> >>>>> what am I missing? >>>> http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html#ApacheFelixBundlePluginFAQ-WhenIbuildabundle%252Csomeclassesarebuiltin%2522target%252Fclasses%2522butthey%2527renotincludedinthefinaljar. >>>> >>>>> thank you; >>>>> >>>>> Andrei >>>>> >>>>> -------- Original Message -------- >>>>> Subject: Latest maven-bundle-plugin 2.4.0-SNAPSHOT >>>>> From: Stuart McCulloch <[email protected]> >>>>> To: [email protected] >>>>> Date: Wed 26 Oct 2011 06:37:50 PM CDT >>>>>> Hi folks, I've just deployed a new snapshot of the maven-bundle-plugin >>>>>> with improved parsing of the Embed-Dependency instruction. >>>>>> >>>>>> Any negative clauses (ie. those that begin with !) now reduce the >>>>>> dependencies available for embedding, which is much more intuitive: >>>>>> >>>>>> https://issues.apache.org/jira/browse/FELIX-3185 >>>>>> >>>>>> If you're interested in a new release of this plugin, please give it a >>>>>> try and let me know if you see anything unusual with this update :) >>>>>> >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: [email protected] >>>>>> For additional commands, e-mail: [email protected] >>>>>> >>>>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

