Back to DevDoc
AspectJ is a very usefull tool !
For know, it is used for object caching in org.simexplorer.core.commons.tools.caching module.
How to use it with Equinox
- Create the aspect, like this one
- Add the option -Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook to the VM arguments for the runtime
- Add the bundle org.eclipse.equinox.weaving.aspect, and this bundle should be started at very begin (level 4)
You can install the AJDT plugin for Eclipse.
- If you want to export the product from eclipse, you should use the "Export as AspectJ Product" wizard (through the "Export…" menu).
Maven integration
To integrate well our aspect in the build process, what we have done:
- add org.aspectj:com.springsource.org.aspectj.runtime as a dependency for each module that can use the aspect, so as dependency in our root POM
- add aspectj-maven-plugin to the plugins list of the build configuration of the project in our root POM
- our aspect module is built as jar and we include our own Manifest, because we haven't found a way to adjust correctly the Export-package directive with bnd plugin
- at runtime, the property osgi.framework.extensions=org.eclipse.equinox.weaving.hook is given in the equinox configuration file
References:





