Use regex inside osgi bundles - osgi

we are using osgi based on eclipse equinox.
During the developement the packages/bundels are built with a -dev-SNAPSHOT version.
But after a relase the version is changed to e.g. -v3.1
So inside the config.ini file I would like to replace the specific version with a something similiar to a regular expresion.
osgi.bundles=\
com.example.important.bundle-dev-SNAPHOT.jar#start,\
...
How can I realize this?
Thank you in advance

Related

Where is local javadoc for ControlsFX?

I'm new(ish) to Java/Netbeans/ControlsFX. I know about Javadoc and would like NetBeans to show me javadoc for ControlsFX. I see the online version of the docs for ControlsFX but that defeats (at least part of) the purpose of using an IDE? I know how to add the doc zip file in NetBeans but I don't see the doc file for ControlsFX.
Am I missing something?
Found this lately. ControlFx java doc. You can manipulate the version number at the end of the url to get to page of any other version of the doc if it is in existence. Download the jar version on that page to use it locally controlsfx-version-javadoc.jar. Then you can add the jar in your netbeans Javafx project.

Want to use replica of plugin that i already have with little changes in osgi

I have on osgi plugin but I want to use same plugin with some changes in classes and want to load/install both plugin is it possible? how?
In OSGi there is one simple rule. No two bundles can have the same symbolic name and version. So make sure when you change the classes you also change either symbolic name or version in the Manifest. Then it should be no problem.

Wrapping Antlr 3.5.2 for OSGi

Hibernate uses Antlr (3.5.2 works, apparently), and I'm using Hibernate (therefore also Antlr in an OSGi environment). I've wrapped antlr-complete-3.5.2-SNAPSHOT.jar as an OSGi bundle, but I exported ALL the packages in the bundle. The question is simple. I need to know which Java packages in this bundle are private and which are part of the public Antlr API. For now, I'm exporting everything
under:
antlr.*;
org.antlr.*,
org.stringtemplate.v4.*
This is probably exporting too much. Thanks for any help.
In general, when OSGifying non-OSGi JARs, exporting all packages is the best you can do.
Suppose you could restrict the ANTLR exports without breaking Hibernate, this might still break some other ANTLR client that happens to use one of the packages you didn't export.
Vanilla Java simply doesn't support the concept of private packages.

OSGi - Is it possible to override a bundle's import package version using a fragment?

I have a bundle (jersey-server) that imports a package (org.objectweb.asm) with a resolution of optional and no version specified:
org.objectweb.asm;resolution:=optional
Currently, our application is deployed to Apache Karaf (using the Equinox framework), which exports a new version of this package (org.objectweb.asm), namely version 4.0. The problem I am attempting to solve is that since the jersey-server bundle does not specify a version for the package it is wiring to 4.0. However, the version of jersey-server I am using (1.12) is incompatible with this version. I have a 3.1 version of the package available in the container that I need the jersey-server bundle to wire to.
I have attempted to use a fragment to suit my needs, but it does not appear to be working. I don't fully understand how fragment import-package conflict resolution works in Equinox (or Felix) to know if what I'm trying to do is even possible. Perhaps there is another way?
No, fragments are additive only. I.e. they can add extra imports to their host bundles, but they cannot replace or remove the imports of the host.
The jersey-server bundle is simply broken and must be fixed.
I had a similar issue with pax-web, I created a "workaround" for it:
https://github.com/ops4j/org.ops4j.pax.web/tree/master/pax-web-features/xbean-fragment
it's available also through maven:
http://search.maven.org/#artifactdetails%7Corg.ops4j.pax.web%7Cxbean-fragment%7C3.0.0.M2%7Cbundle

is it possible to use the .java extension files in Xcode?

can I call the java extension files in the Xcode?.i.e Can I create the Object for that class.
Thanks in advance
I think it is not possible as far as my knowledge
Xcode used to have some support for Java (e.g. you could have java projects).
now, you would have to setup custom build phases for your Java sources. so, it could function as a tool, but i think most of the functionality has been pulled by now - you'd actually have better luck using older versions of Xcode, which included project and target templates for Java stuffs.
on osx, Idea or Eclipse (or others) is better suited for Java.

Resources