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

Invalid OSGi metadata #5991

Closed
rmannibucau opened this issue Dec 5, 2019 · 11 comments · Fixed by #5998
Closed

Invalid OSGi metadata #5991

rmannibucau opened this issue Dec 5, 2019 · 11 comments · Fixed by #5998

Comments

@rmannibucau
Copy link
Contributor

@rmannibucau rmannibucau commented Dec 5, 2019

Hi,

the manifest - at least of jruby-complete - contains a JavaSE requirement of the v9 instead of v8.
this is a bug in bnd - transitively from maven-bundle-plugin - which does not ignore module-info.class out of the box, see https://issues.liferay.com/browse/LPS-98289?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aworklog-tabpanel

guess it should be fixed cause today jruby can't be used on java 8 in OSGi.

@headius
Copy link
Member

@headius headius commented Dec 12, 2019

Ahh good find. We'll see about getting this fixed up.

@mkristian Any suggestion here?

@headius
Copy link
Member

@headius headius commented Dec 12, 2019

This patch did not appear to help:

diff --git a/pom.rb b/pom.rb
index baee376e0f..4a6c5006a2 100644
--- a/pom.rb
+++ b/pom.rb
@@ -98,7 +98,8 @@ project 'JRuby', 'https://github.com/jruby/jruby' do
               'Bundle-Name' =>  '${bundle.name} ${project.version}',
               'Bundle-Description' =>  '${bundle.name} ${project.version} OSGi bundle',
               'Bundle-SymbolicName' =>  '${bundle.symbolic_name}'
-            } ) do
+            },
+            '_noee' => true) do
       dependency(groupId: 'biz.aQute.bnd', artifactId: 'biz.aQute.bndlib', version: '3.5.0')
       execute_goals( 'manifest',
                      :phase => 'prepare-package' )
diff --git a/pom.xml b/pom.xml
index 3f290be2cc..43f1873f61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -201,6 +201,7 @@ DO NOT MODIFIY - GENERATED CODE
               <Bundle-Description>${bundle.name} ${project.version} OSGi bundle</Bundle-Description>
               <Bundle-SymbolicName>${bundle.symbolic_name}</Bundle-SymbolicName>
             </instructions>
+            <_noee>true</_noee>
           </configuration>
         </plugin>
         <plugin>

A jruby-complete build after this still had the following line:

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))"

@headius headius added this to the JRuby 9.2.10.0 milestone Dec 12, 2019
@rmannibucau
Copy link
Contributor Author

@rmannibucau rmannibucau commented Dec 12, 2019

A few options if it helps:

  1. Upgrade bnd (as a bundle plugin dependency), this issue is supposed fixed
  2. Just explicitly set this attribute with version 1.8

@rotty3000
Copy link
Contributor

@rotty3000 rotty3000 commented Dec 12, 2019

should just need an update of plugin that uses bnd, this is fixed upstream: bndtools/bnd@62d1dec

according to tags that fix is in the 4.3.0.REL release.

@rotty3000
Copy link
Contributor

@rotty3000 rotty3000 commented Dec 12, 2019

  • if using the maven-bundle-plugin you can:
  1. update to it's latest: 4.2.1
  2. give it an explicit depedency of biz.aQute.bnd:biz.aQute.bndlib:4.3.1
  • if using bnd-maven-plugin directly, just update to 4.3.1 (latest)

rotty3000 added a commit to rotty3000/jruby that referenced this issue Dec 12, 2019
Fixes  jruby#5991

Signed-off-by: Raymond Augé <rotty3000@apache.org>
@mkristian
Copy link
Member

@mkristian mkristian commented Dec 12, 2019

hmm still seeing

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))"

@rmannibucau
Copy link
Contributor Author

@rmannibucau rmannibucau commented Dec 12, 2019

@mkristian #5999 fix JavaSE version

@mkristian
Copy link
Member

@mkristian mkristian commented Dec 12, 2019

@rmannibucau thanks, #5998 only changed the pom.xml - did not see that

@mkristian
Copy link
Member

@mkristian mkristian commented Dec 12, 2019

with #5999 I could reproduce the desired result

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

@rotty3000
Copy link
Contributor

@rotty3000 rotty3000 commented Dec 12, 2019

yeah, my solution wasn't complete! thanks @rmannibucau both parts should be merged I guess ;)

@headius
Copy link
Member

@headius headius commented Dec 12, 2019

Thanks for the collab, folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants