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
Provide OSGi metadata for jar projects. #73
Conversation
Did you discuss it already in Maven/JIRA? |
I haven't posted a bug for this in the maven-surefire Jira. My motivation was that the Tycho project currently bundles some maven-surefire libraries as part of its tycho-surefire plugin and it would have been nice to switch over to using proper OSGi constraints [1]. I don't see this as very high priority but it would be good to know that if these changes were made in downstream packages (eg. maven-surefire in Fedora), whether they'd eventually be integrated into the project itself. |
@rgrunber |
Discussion is open at Maven mailing list |
Sorry about the delay. I patched Tycho with https://rgrunber.fedorapeople.org/0001-Resolve-all-necessary-dependencies-for-Tycho-Surefir.patch in order to have its OSGi runtime treat maven-surefire packages as OSGi bundles. The problem I ran into had to do with various Import/Export packages being incorrect, so maven-bundle-plugin was probably missing certain things ( internal classes being used among maven-surefire bundles possibly ? ). I didn't have time to look at this more thoroughly since then. Yes Igor is correct. This change is not really being driven, or needed by the Tycho projects itself but rather by the Fedora Project, which would like to avoid having maven-surefire bundled into tycho-surefire. These changes could always be patched specifically in Fedora Project sources, but I thought I'd file the bug with mavens-surefire to see if there was any other interest by others to have such a capability. |
@krosenvold |
Yeah reflection would be one issue, but thinking back I think the problem I had was a split-package ( http://wiki.osgi.org/wiki/Split_Packages ). surefire-api and surefire-booter both provided classes under 'org.eclipse.maven.surefire.booter', so any Import-Package would only get one subset. |
That's strange because I do not see package |
@Tibor17 , my mistake. I meant 'org.apache.maven.surefire.booter' ( https://github.com/apache/maven-surefire/tree/master/surefire-api/src/main/java/org/apache/maven/surefire/booter, https://github.com/apache/maven-surefire/tree/master/surefire-booter/src/main/java/org/apache/maven/surefire/booter ) . |
Both are same packages. That's not nice, but this can be solved in osgi, right? Maybe we would have a chance to fix it in 3.0 but I cannot guarantee. |
@Tibor17 , yes this is solvable in OSGi (the wiki page for split packages mentioned above describes the process). I haven't tried it but it makes sense. |
I remember that I solved this problem in JavaHamcrest according to Require-Bundle. |
@rgrunber Any progress ? |
@rgrunber |
I decided it would make sense to have maven-surefire-common combine the split package of surefire-api and surefire-booter given that it already requires both. Another thing I noticed is that maven-surefire-common also depends on various other maven libaries so it'd be difficult to make it an OSGi bundle. It might need to remain embedded in the org.eclipse.tycho.surefire.osgibooter project. I haven't had much time lately to work on this, but as soon as I'm able to fix the split-package issue in maven-surefire, and get a working version of Tycho, I'll post the necessary changes. |
@rgrunber What can we do about this issue? |
Another issue I've found is that even packages like maven-surefire-api use maven-shared-utils, which isn't an OSGi bundle. I don't recall running into this issue initially so either this is something new, or something overlooked that none of Tycho's code paths into maven-surefire ever hit. This request is definitely something I'll be looking into for the future, but for now maybe I should wait to get a working solution before asking for changes. |
@rgrunber |
It would be nice if maven-surefire artifacts provided OSGi metadata in their manifests so that they could be used within an OSGi runtime.