osgi.enroute
osgi.enroute copied to clipboard
Suggestion: generate -runbundles in archetype
The bndrun files generated by the archetype have -runrequires
populated but not -runbundles
. This forces the user to do a resolve before the project can build cleanly.
Why not prepopulate -runbundles
in the initial archetype output? We already know exactly what it will be at this stage. Then the user can immediately build and run.
Why not prepopulate -runbundles in the initial archetype output?
What would we populate it with? In the majority of cases the bundle in -runrequires
will have dependencies and we don't know what they are.
The bundle will not have any dependencies immediately after generation from the archetype. Even if the user starts adding basic "hello world" code to the bundle, they will not need to worry about dependencies until later on.
The output of resolving immediately after generation of the project is:
-runbundles: \
org.apache.felix.scr;version='[2.1.0,2.1.1)',\
${project.groupId}.${project.artifactId};version='[1.0.0,1.0.1)'
The bundle will not have any dependencies immediately after generation from the archetype. Even if the user starts adding basic "hello world" code to the bundle, they will not need to worry about dependencies until later on.
I can see that this is reasonable for the project archetype, but the application archetype could be run very late in the process and pointed at an existing bundle with many dependencies. Isn't it better to say nothing and force a resolve rather than appear to have resolved but get errors when attempting to run?
I can see that this is reasonable for the project archetype, but the application archetype could be run very late in the process and pointed at an existing bundle with many dependencies.
Then maybe we just do this for the project archetype. If the app archetype is used late in the process then the user will have learned about resolving at that point. But for the project archetype I think it's a win to remove steps in the way of "Hello world".
Isn't it better to say nothing and force a resolve rather than appear to have resolved but get errors when attempting to run?
I don't think there's a difference. The build will fail at the resolve stage, whether -runbundles
is empty or non-empty-with-incorrect-content.
I don't think there's a difference. The build will fail at the resolve stage, whether
-runbundles
is empty or non-empty-with-incorrect-content.
There is a difference if you're in Eclipse. An empty -runbundles
prevents you from launching using the Run button, but a non-empty -runbundles
will launch and fail to resolve. I'm not sure which I think is the more obvious to fix...
Okay good point. Then I propose to leave -runbundles
empty for the app archetype but populate it for the project template.
Sounds good - will you make a PR?