-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using service loader mediator annotations (see #630). #632
Conversation
Thank you for the PR. The solution looks nice, as it very easily deal with OSGi. I am curious to know how adding some depenencies it is able to modify the MANIFEST.MF. I guess maven-bundle-plugin:5.1.1:manifest is detecting these dependencies and it is delegating on them. The only thing that I don't like is that if you decompile Session or StreamProvider, you are going to find the ServiceConsumer annotation, and also in the module-info. As this is only needed to generate the manfest, it looks too intrusive to find it in the generated jar. Ideally there should be a plugin to deal with the manifest. Something like this:
I bring the attention of @lukasj. He has been dealing with OSGi more time than me, in other words, he knows more than me :). |
You don't need an extra plugin. You can simply add this information using the Felix maven bundle plugin which is already in pom.xml with instructions If it helps, I can provide another PR with the pom.xml based solution. |
@@ -198,6 +198,7 @@ | |||
* @author Max Spivak | |||
*/ | |||
|
|||
@aQute.bnd.annotation.spi.ServiceConsumer(value = Provider.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is currently a restriction on using 3rd party libraries in the APIs and only Java SE/Jakarta EE packages can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is currently not allowed to depend on 3rd party libraries from APIs
This is why this has actually been superseded by #633. |
so this should have been closed then |
Shows the usage of the service locator mediator with annotations that generate the "Require-Capability" header in MANIFEST.MF. (Alternatively the Header can be specified directly in pom.xml.)
The Providers (in angus-mail) need a corresponding
@ServiceProvider
annotation such as:(Sorry, can't provide a PR for that, maven compilation for angus-mail doesn't work.)