bnd icon indicating copy to clipboard operation
bnd copied to clipboard

[Maven] Inconsisitent behavior for bndrun between Eclipse Bndtools integration and console

Open maho7791 opened this issue 1 year ago • 5 comments

Example Project: https://github.com/geckoprojects-org/org.gecko.playground/tree/bndissue/maven Branch: bndissue

When I just want to resolve a bndrun using the IDE by pressing the resolve button, I always need the resolve execution in maven.

When I want to start/run bndrun I also need a run execution.

If I have a bndrun that inherits from a parent one, that has already been resolved, from withtin the IDE I also need a resolve execution for that concrete one.

My expectation was to just resolve, what needs to be resolved. This would also belong to the configuration. So like in the provided example, my pom.xml is expected to look like this:

org/org.gecko.playground/blob/bndissue/maven/org.gecko.playground.maven.ds.simple/pom.xml

But this only works in the console, but not in the IDE integration, when I press run: https://github.com/geckoprojects-org/org.gecko.playground/blob/bndissue/maven/org.gecko.playground.maven.ds.simple/pom.xml

I end up with that:

screenshot-bnd-maven

If you remove the comment in line 33, the application runs fine in the console as well as in the IDE Integration.

Shouldn't this behavior be consistent in the IDE and from Maven CMD. Obviously the expected behavior works in the commmand line. So it seems there is a different configuration expected when using the IDE integration.

maho7791 avatar Jan 22 '24 15:01 maho7791

Source of the issue: https://github.com/bndtools/bnd/blob/5b0da633954f66cc588680e9db10cd7a5211f1a2/bndtools.m2e/src/bndtools/m2e/MavenRunProvider.java#L125

juergen-albert avatar Jan 23 '24 13:01 juergen-albert

The same problem occurs, when Exporting from the IDE

maho7791 avatar Feb 15 '24 10:02 maho7791

After thinking about this issue, my conclusion is. It is the best to provide a meaningful error message, e.g. when lauching the bndrun:

error-message-missing-resolver-config

maho7791 avatar Feb 15 '24 15:02 maho7791

I have a solution, but it conflicts a little bit with the changes of PR #6034

maho7791 avatar Feb 15 '24 15:02 maho7791

error-message-patch.txt

Here is a patch with the proposed changes

maho7791 avatar Feb 15 '24 15:02 maho7791