I am using bnd 4.2.0 version
I am building OSGI based application and I am using Eclipse IDE for development. My project is maven based and I am using bnd maven plugins for creating bundles and I use bnd tools eclipse plugin to manage bndrun files in eclipse. Opening bndrun files in Eclipse and even building and debugging application is extremely slow.
I did some investigation in bnd plugin code and found that in class
DefaultRunProvider.java
line number 25, the Workspace object is never resolved as
project.hasNature(BndtoolsConstants.NATURE_ID)
is always false. So everytime a for example a bndrun file is opened, it creates a new Workspace Object. AS the code proceeds further, in
MavenImplicitProjectRunListener.java
MavenImplicitProjectRepository implicitRepo = workspace.getPlugin(MavenImplicitProjectRepository.class);
is found as null and because of that MavenImplicitProjectRepository is newly initialized and whole process of resolution is done every time. At the end of resolution the MavenImplicitProjectRepository object is added to plugin registry but after closing the bndrun file and opening it again, the whole information is lost and the same set of initializations happens again and again. This takes a lot of time in opening the bndrun file.
For a workspace with around 30 projects, it takes around 20-30 seconds to open the file.
The same behavior is observed when debugger is launched. It takes similar amount of time to get the debugger point to the file where debug point is set.
This behavior is only for visible when maven based project is configured. Its not observed if the project is bnd workspace.
The issue of slow opening of bndrun file can be replicated using following sample project https://github.com/prafullp/maven-bnd-issue.git
Need guidance if I have configured the project wrongly or something is missing.