Menu

#42 dns4java as osgi-bundle depends junit

None
closed-rejected
nobody
None
5
2014-12-22
2012-08-10
No

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

Discussion

  • Brian Wellington

    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.

     
  • Simon Walter

    Simon Walter - 2012-08-11

    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?

     
  • Simon Walter

    Simon Walter - 2012-08-11

    oh i see, you don't maintain the version in the central maven repo and your version doesn't even have any osgi bundling.

     
  • Brian Wellington

    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?

     
  • Simon Walter

    Simon Walter - 2012-08-15

    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?

     
  • Simon Walter

    Simon Walter - 2012-08-15

    MANIFEST.MF from dnsjava-2.1.1 out of mvnrepo

     
  • Simon Walter

    Simon Walter - 2012-08-15

    Ticket the packing for mvn 2.1.1 was don with
    https://issues.sonatype.org/browse/OSSRH-1305

     
  • Brian Wellington

    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.

     
  • Simon Walter

    Simon Walter - 2012-08-15

    would you accept a patch for this?

     
  • Brian Wellington

    A patch that restructures the entire project? No.

     
  • Brian Wellington

    • status: open --> closed-rejected
    • Group: -->
     
MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.