Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Provide OSGi metadata for jar projects. #73

wants to merge 1 commit into from

Conversation

rgrunber
Copy link

It would be nice if maven-surefire artifacts provided OSGi metadata in their manifests so that they could be used within an OSGi runtime.

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 11, 2014

Did you discuss it already in Maven/JIRA?
How important is this?

@rgrunber
Copy link
Author

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.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1098424

@Tibor17
Copy link
Contributor

Tibor17 commented Dec 13, 2014

@rgrunber
Can you give me a link to sources of tycho-surefire plugin?
The people don't use github to see any news regarding issues. Therefore please open an issue with this feature. http://jira.codehaus.org/browse/SUREFIRE
I was trying to accept the junit team my OSGi changes in manifest and still this is two years open story.
So please feel free to open discussion with maven-surefire in Fedora devs regarding compatibility and post the link in your new JIRA ticket.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 3, 2015

Discussion is open at Maven mailing list
http://maven.40175.n5.nabble.com/OSGi-Headers-in-SUREFIRE-td5831322.html

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 4, 2015

@rgrunber
Can we see the demo in Tycho project with surefire 2.19-SNAPSHOT built from your branch?
As Igor mentioned "the problem appears to be specific to redhat repackaged version". Can you @rgrunber comment on this?

@rgrunber
Copy link
Author

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.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 14, 2015

@krosenvold
@agudian
What's your opinion? Generally I don't have any objections against OSGi based SUREFIRE, but we would need to reach consensus in Maven developers group. The Maven core is independent of OSGi Headers in surefire as far as I know.
@rgrunber We are using Java Reflection, see Reflection_Util_ class. Is not the Tycho plugin modified?

@rgrunber
Copy link
Author

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.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 14, 2015

That's strange because I do not see package org.eclipse.maven.surefire.booter in project. Can you help me find it?

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 14, 2015

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.

@rgrunber
Copy link
Author

@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.

@Tibor17
Copy link
Contributor

Tibor17 commented Apr 15, 2015

I remember that I solved this problem in JavaHamcrest according to Require-Bundle.
As a hint see this PR hamcrest/JavaHamcrest#32
There should be also tests.

@Tibor17
Copy link
Contributor

Tibor17 commented May 3, 2015

@rgrunber Any progress ?

@Tibor17
Copy link
Contributor

Tibor17 commented May 8, 2015

@rgrunber
Did you succeed with splitting packages **/booter ? AFAIK you planned to improve the manifest.

@rgrunber
Copy link
Author

rgrunber commented May 8, 2015

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.

@Tibor17
Copy link
Contributor

Tibor17 commented May 28, 2015

@rgrunber What can we do about this issue?

@rgrunber
Copy link
Author

rgrunber commented Jun 3, 2015

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.

@Tibor17
Copy link
Contributor

Tibor17 commented Jun 8, 2019

@rgrunber
Closing old PR as it does not seem to have reached a big popularity so far.

@Tibor17 Tibor17 closed this Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants