In order to use Spring Java configuration in your P2 app, the Import-Package
header in your app's
META-INF/MANIFEST.MF
file needs to contain the following entries:
org.springframework.cglib.core
org.springframework.cglib.proxy
org.springframework.cglib.reflect
There are three ways to make this happen:
*
entry in your AMPS Import-Package
instructions, andcom.atlassian.plugins:atlassian-plugins-osgi-javaconfig
(see the
dependencies page)In the scenario above, AMPS will trigger the BND tool to scan the type references in your classpath. BND will detect the
Imports
class in our library and its usages of the above packages, and add the necessary Import-Package
entries for
you.
Add the above packages explicitly to your AMPS Import-Package
instructions. This will work, but has these drawbacks:
*
entry in your AMPS Import-Package
instructions, andImport-Package
entries because it
detects binary references to the relevant packages:1 2// Call this class anything you like, its only purpose is to contain package references final class SyntheticPackageImports { private org.springframework.cglib.reflect.FastClass fastClass; private org.springframework.cglib.proxy.MethodProxy methodProxy; private org.springframework.cglib.core.ReflectUtils reflectUtils; }
Like Option 2, the drawbacks of this approach are:
Rate this page: