-
Notifications
You must be signed in to change notification settings - Fork 65
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
OSGi Support #33
Comments
OK, seems not too difficult, and off the top of my head I cannot think of any downside. Yes, I have been using ant, and have a bit of familiarity with maven, and not much with gradle, despite the fact that's the reverse order of popularity these days. Thanks for the pointers. Would not be able to alter any previous releases since the maven repositories forbid changing a release. But could make the changes to the jar manifests for the next release(s). |
Would be nice if you could do a minor release which contains the OSGi metadata then you wouldn't have to overwrite any existing version and we could switch to the new version. |
Yes, I expect to do a release sometime in the next 1-2 months, so I would include this with it. |
Any progress or eta. for the release? |
I'm getting close, I estimate a few more weeks. |
As you suggested I am using the bnd tool, and now I am remembering how complicated osgi can be. Anyway, here is what I am producing as a manifest from what appears to be the latest bnd jar: Manifest-Version: 1.0 I can see you use the bnd tools, which is different from the jar. In fact, there are so many different bnd deliveries it mirrors the complexity of osgi. Too complicated :-) I am not getting an Import-package section like your example, don't know why, but that's probably fine, ipaddress only needs core java 8, nothing fancy. I assume that the above would work for you. If not, please advise. It will end up in the IPAddress jar files found in the releases, and also in the ipaddress-5.3.0.jar jar soon to be found on maven central (https://repo1.maven.org/maven2/com/github/seancfoley/ipaddress) and jfrog bintray (I assume it doesn't need to be in the maven source or javadoc jars). Since I don't know much about osgi, I really don't know. |
Which bnd tool do you use? The ant plugin? It seems "2.4.0.201411031536" is quite old. BND changed the artifactid some time ago - so here you find updated binaries: "aQute.bnd.plugin.ant.AntPlugin" is still available in the newest version. |
I used the ant task. I downloaded something called "bndtools.api-4.2.0.jar" which appeared to the latest of whatever it was, and there was no ant tasks inside. I did not want to go through all 41 chapters on the web site to figure out what to download, after trying a few pages I found nothing useful. The one page on ant is empty. I did a search on maven and it showed 45 things to choose from! Even Eclipse doesn't have 45 separate downloads. So I went looking for the one jar referenced in your link above, the bnd-version.jar, and I found it somewhere. Thanks for pointing to this particular jar, because there is no way I would have ever found it otherwise. |
That jar does not work. It does not have any defined ant tasks. Is there a jar that is recent that has taskdef.properties in it? |
Ok, found a jar that works at https://search.maven.org/artifact/biz.aQute.bnd/biz.aQute.bnd/5.0.1/jar Manifest-Version: 1.0 |
The osgi manifest is included with version 5.3.0 as shown above, and is now available from the releases page, from maven central, or from bintray |
@seancfoley thanks for your work |
It would be nice when the jar would contain OSGi metadata so we could directly consume it via maven central without doing any wrapping.
I have seen this project uses ant to build. I'm not familiar with ant (only gradle/maven) so I can't provide a pull request for generating OSGi metdata but I can guide you into the right direction.
First I would recommend BND - BND is a tool which automatically generates a MANIFEST.MF containing all the necessary OSGi metdata based on the compiled *.class files. BND can be used with gradle, maven and ant to analyze the class files and generate the corresponding MANIFEST.MF based on them and a instructions file (e.g. bnd.bnd). This bnd.bnd file tells bnd what it should do.
In your case:
Bundle-SymbolicName: com.github.seancfoley.ipaddress
Export-Package: inet.ipaddr.*
would be probably enough.
Here I have also found a BND ant example: https://groups.google.com/forum/#!topic/bndtools-users/UgQ9bmoU4Eg
The final MANIFEST.MF should look roughly something like that:
It is possible to simply "hardcode" the manifest additions like that but that would mean that if packages are added you would have to manually maintain that hardcoded manifest too. Some stuff listed above is also optional and only produced because bnd produces "super correct" manifests.
The text was updated successfully, but these errors were encountered: