-
Notifications
You must be signed in to change notification settings - Fork 64
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
Import-Package: org.junit.vintage.engine does not work #574
Comments
I've just created default plugin project with wizard and got this resolved without issues:
However I use full / latest SDK nightly build as running platform. Not sure which Eclipse version you have and which target platfrom you use. |
i see the problem in 2023-03 (dsl package) with 2023-03 as target platform. (aka no explicit target set) |
That's a required bundle, though: in our case it's an imported package. |
yes require bundle works perfectly fine |
If someone would have provided the manifest as a text, I would not made the mistake to import bundle :-) Here is it and yes, it is broken on latest 4.28 SDK I build too:
@HannesWell : I believe you were involved in some PDE dependency management refactorings: could you please take a look? |
Yes I can have a look this evening. |
Indeed, as @iloveeclipse mentioend, the |
seems to work, yes |
Can anyone explain for what |
Yes, I wondered that too. And wonder if in the future they change their export if the import stops working... |
That's exactly what the JUnit maintainers want to express with this flag: the package is exported for convenience but not as a public API. It's exactly like |
I was more concerned with what happens if they removed this flag in the future would the import stop resolving because the flag has gone missing? |
You can try adding a |
Thanks Andrey for pointing that out. I can only confirm what Mickael has explained, that this indeed the reason for the problem. To add some reference for those interested, the OSGi 8.0 Spec section 3.7.8 Mandatory Attributes specifies it:
That's not correct as OSGi 8.0 Spec section 3.7.7 Attribute Matching specifies:
And if one tries what you have suggested, one gets a corresponding errors. What you could do is is adding two package-imports one with and one without the extra attribute and mark both as optional (by appending the usual Therefore I would just assume/hope that the JUnit devs added the attributes for a reason and will not just make those packages part of their 'regular API' in the future without renaming the package or a major version bump. Btw. since there was also the question about According to OSGi 8 section 1.3.2 General Syntax Definitions,
And sorry for the later reply but I was busy with other projects last night. |
@HannesWell should the add import dialog respect this behaviour? |
Probably yes. But it is a bit difficult since it is of course a valid choice to not add the extra attribute. There could be another provider of that package without any attribute. So just adding the attributes by default is not always right. |
maybe a better error message (or a quickfix) would be helpful. but i have no idea how easy that can be done |
Thanks both of you for the detailed information! |
Created #578. I can work on it when time permits, but if anybody else wants to do it it is of course welcome. :) |
Well the main problem is, that actually one should neither import the package nor require the bundle, this is currently a limitation of PDE and much better solved by JDT with the JUnit Classpathcontainer (that is suppressed by PDE...) |
Import-Package: org.junit.vintage.engine does not work
(although the dialog proposes it)
what could be the problem?
The text was updated successfully, but these errors were encountered: