bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
530 stars 304 forks source link

Blueprint / Apache Camel - include referenced Exception packages in calculated imports #1258

Closed paul-mcculloch closed 4 years ago

paul-mcculloch commented 8 years ago

Apache Camel has a capability to catch exceptions that can be defined in a blueprint descriptor.(http://camel.apache.org/exception-clause.html). For example:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="..."/>

            <onException>
                <exception>org.foo.bar.MyException</exception>
                <redeliveryPolicy .../>
            </onException>

            <to uri="..."/>
        </route>
    </camelContext>
</blueprint>

It would be nice if the exception packages were identified as such and included in the calculated imports, in the same way that<bean class="org.foo.MyClass"/> elements are handled at present.

bjhargrave commented 8 years ago

You could try modifying https://github.com/bndtools/bnd/blob/master/biz.aQute.bndlib/src/aQute/lib/spring/extract.xsl to handle the camel xml and make a PR.

paul-mcculloch commented 8 years ago

Thanks for the pointer. I need this to work is in org.apache.felix:maven-bundle-plugin as well, so it looks like I'll have to fix it in two places.

bjhargrave commented 8 years ago

maven-bundle-plugin uses bndlib, so if you fix it here, the next release of maven-bundle-plugin can use the updated bndlib.

paul-mcculloch commented 8 years ago

maven-bundle-plugin seems to include its own XSLT which looks to be responsible for this . https://github.com/apache/felix/blob/trunk/tools/maven-bundle-plugin/src/main/resources/org/apache/felix/bundleplugin/blueprint.xsl

bjhargrave commented 8 years ago

Well... Perhaps you should ask @cziegeler about it.

paul-mcculloch commented 8 years ago

Will do - thanks again.

cziegeler commented 8 years ago

That code has actually been added by @gnodet as part of FELIX-2175. (I just moved the code base and it seems the history is lost here in git, it's available via svn)

gnodet commented 8 years ago

The main reason for using a different xslt is to be able to generate the Import-/Export-Service or Require-/Provide-Capabilities headers. If bnd is willing to start generating those (for blueprint, spring, scr), we could move some code from the maven-bundle-plugin to bnd.

pkriens commented 8 years ago

@gnodet We would be more than pleased to accept a PR for this.

stale[bot] commented 4 years ago

This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Bnd/Bndtools or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.