0

In my code I start multiple OSGi frameworks using EquinoxFactory. By setting the property "org.osgi.framework.storage" to "@user.home/osgi-frameworks/framework-x", where x is different for every framework, each framework uses a different directory:

frameworkProperties.put("osgi.clean", "true");
frameworkProperties.put("osgi.console", "true");
frameworkProperties.put("org.osgi.framework.storage", 
                        "@user.home/osgi-frameworks/osgi-framework-" 
                        + numberOfFramework);       

framework = new EquinoxFactory().newFramework(frameworkProperties)

This works perfectly when running the actual application. Also the JUnit tests in the IDE run without any problems.

However, when I start the Maven build for my project, the JUnit tests fail since all frameworks use the same directory ("osgi-frameworks/framework-0").

I added logging to the application to check whether the property "org.osgi.framework.storage" does really have different value in the OSGi property map. Everything looks fine in the log, but when checking the file space, only one directory has been created.

Since I would like to include the application in Jenkins, I would rather not skip the tests.

Has anyone an idea what could be wrong? Do I have to set other parameters for the framework? Is there any considerable difference between Junit in the IDE and in Maven?

Björn Pollex
  • 75,346
  • 28
  • 201
  • 283
user1488793
  • 284
  • 2
  • 14
  • Where have you added the logging? Are you sure you are logging the property-values that are actually used by the framework? – Björn Pollex Oct 04 '12 at 08:00
  • Just curious, I am wanting to start headless builds with osgi and rcp apps. How are you going about this build process, are you using maven integration with OSIG? – Duncan Krebs Nov 23 '12 at 23:58

0 Answers0