if you use dns4java inside a osgi-container you have to bundle junit, because META-INF/MANIFEST defines org.junit as a dependency
Export-Package: org.xbill.DNS;uses:="org.xbill.DNS.util",org.xbill.DNS
.spi;uses:="org.xbill.DNS,sun.net.spi.nameservice",org.xbill.DNS.util
s;uses:="junit.framework"
the bundle information should not depend on org.junit
for karaf the command for the workaround is:
# bundle:install wrap:mvn:junit/junit
I'm not seeing this in the released org.xbill.dns_2.1.3.jar, and I'm also not seeing it when I build a bundle from scratch.
the problem is related to version 2.1.1 which is the last version i can find in maven repos:
http://mvnrepository.com/artifact/dnsjava/dnsjava
why is 2.1.3 not in one of the central repositories?
oh i see, you don't maintain the version in the central maven repo and your version doesn't even have any osgi bundling.
I don't know what you mean "your version doesn't even have any osgi bundling". How is the org.xbill.dns_2.1.3.jar not an osgi bundle?
a jar is an osgi-bundle if it has bundle infos in its META-INF/MANIFEST
the jar in the mvn repo has this information.
they were added by the guy build the jar for the maven repo by adding the org.apache.felix maven-bundle-plugin to the pom
http://repo1.maven.org/maven2/dnsjava/dnsjava/2.1.1/dnsjava-2.1.1.pom
the felix plugin uses bnd which analyzes the class files and adds the imports to the MANIFEST Import/Export-Package.
since your project doesn't have the default maven structure /src/java, src/test) bnd also picksup all the test-classes and add org.junit as dependency.
damn that's getting complicated.
I see two solutions:
1. don't use the felix-plugin/bnd and add the bundle infos by supplying a hardcoded MANIFEST
2. restructure the project to the default maven structure
are you interested in putting your project into maven and bundling for osgi?
MANIFEST.MF from dnsjava-2.1.1 out of mvnrepo
Ticket the packing for mvn 2.1.1 was don with
https://issues.sonatype.org/browse/OSSRH-1305
No, I am not interested in restructuring the entire project. I don't use maven, and don't have that much time to spend on dnsjava. I'd rather use the time dealing with things like adding features and fixing bugs, not dealing with packaging stuff that I don't use.
would you accept a patch for this?
A patch that restructures the entire project? No.