Can't find a working ssh client library that will pass karaf-feature-verification

Working on a new ddwrt plugin. trying to build it on ssh. The two ssh client libs I tried seem to depend on deprecated packages

jsch seems to be most popular but it depends on org.newsclub.net.unix which I can’t resolve

[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-ddwrt; type=karaf.feature; version=4.3.4.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-ddwrt)(type=karaf.feature)(version>=4.3.4.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-ddwrt/4.3.4.SNAPSHOT: missing requirement [openhab-binding-ddwrt/4.3.4.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.ddwrt; type=osgi.bundle; version="[4.3.4.202503102229,4.3.4.202503102229]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.ddwrt/4.3.4.202503102229: missing requirement [org.openhab.binding.ddwrt/4.3.4.202503102229] osgi.wiring.package; filter:="(osgi.wiring.package=org.newsclub.net.unix)"]]

feature.xml:

<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.ddwrt-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
	<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

	<feature name="openhab-binding-ddwrt" description="ddwrt Binding" version="${project.version}">
		<feature>openhab-runtime-base</feature>
		<bundle dependency="true">mvn:com.github.mwiede/jsch/0.2.23</bundle>
		<bundle dependency="true">mvn:org.bouncycastle/bcprov-jdk18on/1.80</bundle>
		<bundle dependency="true">mvn:org.newsclub.net/junixsocket/1.3</bundle>
		<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ddwrt/${project.version}</bundle>
	</feature>
</features>

tried apache sshd which is used by eclipse but ran into issue with sun.security.x509 see The net.i2p.crypto.eddsa 0.3.0 bundle has bad OSGi metadata · Issue #15 · eclipse-orbit/orbit-simrel · GitHub

<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.ddwrt-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
	<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

	<feature name="openhab-binding-ddwrt" description="ddwrt Binding" version="${project.version}">
		<feature>openhab-runtime-base</feature>
		<bundle dependency="true">mvn:org.apache.sshd/sshd-osgi/2.15.0</bundle>
		<bundle dependency="true">mvn:net.i2p.crypto/eddsa/0.3.0</bundle>
		<bundle dependency="true">mvn:sun.security.x509</bundle>
		<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ddwrt/${project.version}</bundle>
	</feature>
</features>

Metadata can be amended with wrap protocol (wrap:mvn:…), see:

Its important to mark wrap protocol feature as a prerequisite, once you do that with few (hundreds) attempts you might be able to pass validation.

I tried several different ways and nothing works

<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.ddwrt-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
	<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

	<feature name="openhab-binding-ddwrt" description="ddwrt Binding" version="${project.version}">
		<feature prerequisite="true">wrap</feature>
		<feature>openhab-runtime-base</feature>
		<bundle>wrap:mvn:org.apache.sshd/sshd-osgi/2.14.0&amp;overwrite=merge&amp;Import-Package=!org.apache.tomcat.*,*</bundle>
		<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ddwrt/${project.version}</bundle>
	</feature>
</features>

The first part after mvn: url should be dollar sign. Rest of it looks fine. Try this: <bundle>wrap:mvn:org.apache.sshd/sshd-osgi/2.14.0$overwrite=merge&amp;Import-Package=!org.apache.tomcat.*,*</bundle>

Thanks I got a little further but stuck on org.apache.tomcat.jni

	<bundle>wrap:mvn:org.apache.sshd/sshd-osgi/2.15.0$overwrite=merge&amp;Import-Package=org.apache.tomcat.jni;resolution:="optional",org.bouncycastle.*;resolution:="optional",net.i2p.crypto.*;resolution:="optional",*</bundle>
[ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.4.6:verify (karaf-feature-verification) on project org.openhab.binding.ddwrt: Feature resolution failed for [openhab-binding-ddwrt/4.3.4.SNAPSHOT]
[ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-ddwrt; type=karaf.feature; version=4.3.4.SNAPSHOT; filter:="(&(osgi.identity=openhab-binding-ddwrt)(type=karaf.feature)(version>=4.3.4.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-ddwrt/4.3.4.SNAPSHOT: missing requirement [openhab-binding-ddwrt/4.3.4.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.ddwrt; type=osgi.bundle; version="[4.3.4.202503192132,4.3.4.202503192132]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.ddwrt/4.3.4.202503192132: missing requirement [org.openhab.binding.ddwrt/4.3.4.202503192132] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.tomcat.jni)"]]

Are you sure you need it? Your binding, or one of dependencies you embedded in it, is trying to make use of it.