-
Notifications
You must be signed in to change notification settings - Fork 141
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
FELIX-6708 upgrade bnd to 7.0.0 #322
Conversation
To be able to handle Multi-Release jars as dependencies in an OSGi bundle. This prevents exceptions like: ``` build 24-May-2024 18:40:01 [ERROR] Bundle com.abc:jersey-bundle:bundle:55.0-SNAPSHOT : Classes found in the wrong directory: {META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport$NonLoomishExecutors.class=org.glassfish.jersey.innate.VirtualThreadSupport$NonLoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/virtual/LoomishExecutors.class=org.glassfish.jersey.innate.virtual.LoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport$Java21LoomishExecutors.class=org.glassfish.jersey.innate.VirtualThreadSupport$Java21LoomishExecutors, META-INF/versions/21/org/glassfish/jersey/innate/VirtualThreadSupport.class=org.glassfish.jersey.innate.VirtualThreadSupport} ```
Update to java 17 as thats required by bnd
Revert unneeded change
Probably this code can be removed now as well, as bnd can handle it. felix-dev/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java Line 2236 in 6bb228d
It suppresses the errors as warnings via
It didn’t cover java 21. Still, it would be nice to move to 7.0.0 as it claims to support multi release jars properly. |
Two integration tests fail still, but one of these also failed on 6.3.1.
|
@hboutemy @rotty3000 any feedback on this pr, as you both worked on upgrading bnd last time it was upgraded. |
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.
LGTM
What do you think about the failing Integration tests? |
@paulrutter do this to fix the test: diff --git a/tools/maven-bundle-plugin/src/it/no-test-scoped-imports/pom.xml b/tools/maven-bundle-plugin/src/it/no-test-scoped-imports/pom.xml
index 3a15568ced..2eedf2350c 100644
--- a/tools/maven-bundle-plugin/src/it/no-test-scoped-imports/pom.xml
+++ b/tools/maven-bundle-plugin/src/it/no-test-scoped-imports/pom.xml
@@ -53,6 +53,11 @@ under the License.
<artifactId>maven-bundle-plugin</artifactId>
<version>@project.version@</version>
<extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <_noimportjava>true</_noimportjava>
+ </instructions>
+ </configuration>
</plugin>
</plugins>
</build> |
In fact, @paulrutter if you want to preserve the original behaviour of maven-bundle-plugin not to import ref: https://bnd.bndtools.org/instructions/noimportjava.html |
I think java packages should simply be always imported, I don't see a reason to disable that, especially as its the default for bnd. |
whatever you prefer! 🤷🏻 |
Great, i will adjust the PR and rerun the tests with that instruction. |
+ <configuration> + <instructions> + <_noimportjava>true</_noimportjava> + </instructions> + </configuration>
The only IT still failing was also failing with bnd 6.3.1.
|
I think we should update the major version when we release this, due to the minimum jvm version updated to 17. |
bnd major update > felix major update regardless of java version (but plugin minium java version must be set to 17 then) |
…proper manifest is created with bnd 7.0.0
I did not get this failure when I locally ran the IT tests on your branch yesterday. Could someone else maybe confirm? |
Maybe it's platform related? I'm running on a Windows 11 based machine. |
.. and I'm running on Ubuntu Linux. Bnd has often had weird windows issues because it's the least tests platform. |
If you don't see the failing test, then i'd say we're good to go. |
Since it would be a major version upgrade for the plugin (6.0.0?), i don't see a problem with requiring 17. |
I agree that updating to bnd 7 and requiring java 17 for the tool chain is probably not a huge problem. However, I'm too far away from the bundle-plugin code to make a call here. |
@rotty3000 maybe? |
man... I've not looked at this for such a long time I would be remise to make a recommendation such out of date info. Perhaps @jbonofre would have better insight? |
@paulrutter since this plugin is justr a wrapper around bnd why not using bnd-maven-plugin? |
I looked at So ideally, i would like to have an updated |
Sad to say but bnd-maven plugin even misses some features of felix-maven-plugin, beside that +1 from me to simply upgrade (with or without major version increment) it all looks fine and sane and should has no impact to the rest of felix. |
Who could give the final go for this to get merged and released? Would be a shame to leave it on the shelve unused, but maybe I'm just too impatient 😉 |
Lgtm |
I can merge, but i am not in the release process. Sorry for that. For all other Users i highly recommend to use bnd direct. |
Sadly |
@laeubi Could you list which features these are? That may help to address them in the future. |
I think most noteable is (one can potentially try to work around this by a combination of copy-dependecy and bnd instructions but thats really cumbersome if more than one jar is involved) Then Last but not least, even though its a bit a style question, the usage of XML elements to represent the Instructions instead of an embedded |
The embedding can take many forms. In the case showed, the "maven dependency" You could embed in a flattened way using (i.e. the classes and packages are directly beside your own):
and so on... there are lots of possible things you can do like extracting certain files and whatnot! |
one would think so, but if you
it instantly become incredibly hard. As you mentioned here
Also So yes that's all doable but far from convenient to the not so experienced users. Also please keep in mind this important portion of my answer:
so all these incredible easy example always ever seem to cover exactly one jar where it in fact becomes quite easy. So to convince people that
|
Fair, but these are incorrect assumptions:
You can use a regex which gets all dependencies? matching is a regex across the names of all artifacts.. so just match all!
You don't need to care where the jar is, only that maven will ultimately already have gotten it for you! The rest may be arguably true, but this is widely used in very large projects with MANY jars (please, if you dare, look at this repo and search for |
anyway.. I do see your point. |
And it is using.... Don't get me wrong its all possible for sure, it was just asked why people using it and I gave some examples, you should not assume that every maven user that wants to wrap a small (or medium) jar can afford to dive into the details of bnd instruction magic, those people only search for a fast way to archive their goal without much hassle and the plugin is offering that for them. So if these one-liner examples above can be transformed into a one-liner bnd instruction (or better maven configuration option) it is fine and probably there is just a lack of let people know, if I look here: https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-maven-plugin I don't find any good hint to archive things similar to |
While I really value this discussion and I dont want to stop it, I think this PR is really not the right place. No one will find this here. So please move it to our mailing list - this is the place where discussions really should happen |
I created a topic here https://bnd.discourse.group/t/bnd-maven-plugin-missing-features-compared-to-felix-maven-bundle-plugin/488 where we can continue the discussion. @laeubi @rotty3000 |
- Skip this test on windows see, #322 (comment)
See https://issues.apache.org/jira/browse/FELIX-6708 and bndtools/bnd#2227 (comment)
To be able to handle Multi-Release jars as dependencies in an OSGi bundle.
This prevents exceptions like: