bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
527 stars 305 forks source link

MavenWorkspaceRepository #2047

Closed pkriens closed 7 years ago

pkriens commented 7 years ago

When doing a resolve I sometimes get a NPE. I finally found the cause of this. When the BndrunResolveContext iterates over the repositories to find augments it finds a MavenWorkspaceRepository. This repository returns null for findProviders, which breaks the contract. I am not sure I understand the repo since it can only return null, is it really an OSGi repo?

I also noticed that sometimes this repository is listed in the repo view.

pkriens commented 7 years ago

@gamerson can you take a look?

pkriens commented 7 years ago

I should notice that this feels like timing related though looking at the code it seems to always return null. Is this repo only added temporary?

gamerson commented 7 years ago

I'll take a look. this "MavenWorkspaceRepo" is just a temporary repo that is used by Run launches in bndtools so we get bundles from the workspace that in flight. So you likely have a run/debug launch of a framework in the background. I didn't think about what happens when a resolve job is executed at the same time as a launch is active. Do you have a repo that I can use to test this interaction out?

pkriens commented 7 years ago

I think any workspace with m2e and bndtools should exhibit this. However, as I said it is not consistent and I am pretty sure I've no maven projects with a launch.

I fixed it here with a return of en empty Map on findProviders. Maybe we should install that as an urgency fix?

gamerson commented 7 years ago

I'll send a fix to bndtools after doing a little investigation into the other issues mentioned.

On Tue, May 23, 2017 at 2:25 AM, Peter Kriens notifications@github.com wrote:

I think any workspace with m2e and bndtools should exhibit this. However, as I said it is not consistent and I am pretty sure I've no maven projects with a launch.

I fixed it here with a return of en empty Map on findProviders. Maybe we should install that as an urgency fix?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bndtools/bnd/issues/2047#issuecomment-303313104, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFS6XJfVWD2xdJ7naqf6YOGHjcllgks5r8on_gaJpZM4NeCAB .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

gamerson commented 7 years ago

Here is my first attempt to clean things up: https://github.com/bndtools/bndtools/pull/1709

gamerson commented 7 years ago

I've merged the cleaned up MavenWorkspaceRepository here https://github.com/bndtools/bndtools/pull/1709

So I'm going to close this for now but please reopen if you see more issues.