Hi,
My TestOSGi
task is failing because this unwanted transitive dependency is being waved in my general direction:
io.netty:netty-transport-native-kqueue:4.1.60.Final:osx-x86_64
The stack trace is:
! Failed to start bundle io.netty.transport-native-kqueue-4.1.60.Final, exception Unable to resolve io.netty.transport-native-kqueue [6](R 6.0): missing requirement [io.netty.transport-native-kqueue [6](R 6.0)] osgi.native; (&(osgi.native.osname~=macosx)(osgi.native.processor~=x86_64)) Unresolved requirements: [[io.netty.transport-native-kqueue [6](R 6.0)] osgi.native; (&(osgi.native.osname~=macosx)(osgi.native.processor~=x86_64))]
org.osgi.framework.BundleException: Unable to resolve io.netty.transport-native-kqueue [6](R 6.0): missing requirement [io.netty.transport-native-kqueue [6](R 6.0)] osgi.native; (&(osgi.native.osname~=macosx)(osgi.native.processor~=x86_64)) Unresolved requirements: [[io.netty.transport-native-kqueue [6](R 6.0)] osgi.native; (&(osgi.native.osname~=macosx)(osgi.native.processor~=x86_64))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at aQute.launcher.Launcher.start(Launcher.java:688)
at aQute.launcher.Launcher.startBundles(Launcher.java:668)
at aQute.launcher.Launcher.activate(Launcher.java:574)
at aQute.launcher.Launcher.launch(Launcher.java:404)
at aQute.launcher.Launcher.run(Launcher.java:185)
at aQute.launcher.Launcher.main(Launcher.java:161)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52)
I am running on Linux rather than OSX, so I understand why the framework cannot install this native bundle. But what I don’t understand is why Bnd is trying to install it the first place. I would have expected it to be filtered out in favour of an alternative which can satisfy my platform requirements.
I have the simplest of .bndrun
files:
-tester: biz.aQute.tester.junit-platform
-runee: JavaSE-11
-runsystemcapabilities: ${native_capability}
-runfw: org.apache.felix.framework
-resolve.effective: active
-runproperties: \
org.osgi.framework.bootdelegation=sun.reflect
-runrequires: \
bnd.identity;id='${project.archivesBaseName}-tests',\
bnd.identity;id='io.netty.transport-native-kqueue',\
bnd.identity;id='junit-jupiter-engine',\
bnd.identity;id='junit-platform-launcher'
-runstartlevel: \
order=sortbynameversion,\
begin=-1
-runbundles:
My Gradle dependencies are:
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.7.1"
testRuntimeOnly "org.apache.felix:org.apache.felix.framework:6.0.4"
testRuntimeOnly "io.netty:netty-transport-native-kqueue:4.1.60.Final"
testRuntimeOnly "org.apache.activemq:artemis-server-osgi:2.15.0"
}
I know a Gradle incantation
which can exclude the bundle with the
osx-x86_64
classifier, but suspect that MacOSX users might object to me casting it .
Is this just anothe case of b0rked OSGI metadata, please? Am I missing some important piece of configuration? Or is there an issue with bundle resolution?
Thanks for any assistance here,
Cheers,
Chris