-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bndtools.workspace.min from OSGi R7 to R8 #11
Conversation
@pkriens Question: When I do a
My current JAVA points to:
Could you help me how to interpret this? I would like to find out, if this is basically the same result I need to achieve after the Update from R7 to R8. |
I'm finally getting around to trying your R7-to-R8 workspace template with the OSGi Service wizard. Here's what I'm getting after setting up the workspace with this template as described above and then in the new bndtools workspace doing: New->Other...->OSGi Service->Java OSGi Service (api, impl, consumer) and completing the wizard with project: org.test.hello First the three projects created by the wizard all compile (congrats!) The only issue is that I"m getting a warning in each of the three projects for this annotation usage: Description Resource Path Location Type I don't understand why this is happening...as isn't Version class exported in org.osgi.annotation\6.0.0 ? However, when I try to resolve the HelloService.bndrun I get resolver errors Resolution failed. Capabilities satisfying the following requirements could not be found: This looks like some issue with gogo.runtime, gogo.command, felix.src for org.osgi.framework expected/required version? This appears strange as the framework version in the runtime repo seems to be == 1.10.0...which I would expect to resolve these three dependencies (?) BTW, to try this yourself all you have to do is choose File->New->Other...->OSGi Services->Java OSGi Service (api, impl, consumer) and fill out the wizard (project name and service name) with something reasonable (i.e. 'HelloService'). |
Thanks a lot for testing @scottslewis
I fixed this in my recent commit.
I can reproduce it, and looking into it now. |
Regarding the resolve errors. I get a different resolve error: @pkriens maybe you have an idea? Here are my findings and steps.
Looks like Now I search and filter my respositories who provides this
I find this: Which looks like it provides this capability. What am I missing? |
In those nasty cases, I just add the provider of Maybe the changes I made recently to the Resolution Viewer help. Select the scr bundle + the org.osgi.service.component bundle in the Repositories view. The requirements list then shows the unresolved requirements. Adding bundles by selection them in the Resolution Viewer might give you a clue. If this happens, it tends to suck. That is mostly why the work you do is important. It tends to be work to get this working but a good distro gives very little problems. |
@scottslewis it should resolve now. |
I've got two problems now when the Java OSGi Service goes to make a project:
This appears to me because this line (39) is in cnf/ext/defaults.bnd testbin ${target-dir}/test-classes If I take out this line referring to test-classes, restart the IDE and then run the wizard, all three projects are created just fine, and with no compile errors. Any ideas about this?
Any ideas why this is happening? |
About 1.
I could imagine that the spaces at the end may confuse it somehow. I will try to remove them. About 2.
I think I could reproduce it. If you re-select the OSGi Framework again and pick the 7.0.5 , save the file and resolve again, it should resolve successfully. Solution: @pkriens What do you think? I think yesterday in Slack you mentioned "updating the templates" which I think is option b). Or could we also specify (force the felix version) in Update: e.g. and then remove the I think the problem we have here is that the service template code in |
I think we need to look at the templates, I expect they have more issues. The resources you point out are very specific for Scott's work? I see the other templates in org.bndtools.templates.osgi and org.bndtools.templates.template? I do not think Scott's templates should be in bndtoosl.core? @scottslewis ? If we update the templates (and we should) some thinks to consider:
Phew. Really grateful you're doing this work! |
Thanks @chrisrueger we are getting there! > > Or could we also specify (force the felix version) in `build.bnd` for `bndtools.workspace.min`? > > Update: e.g. in `build.bnd` do `-runfw: org.apache.felix.framework;version='[7.0.5,7.0.5]'` > > and then remove the `-runfw` from `$serviceName$.bndrun` ? > > I think the problem we have here is that the service template code in `bndtools.core` will almost always be out-of-sync with any configured Workspace-templates. The question: who should win? Is the -runfw required in the bndrun file? If not seems better to just remove it from the bndrun template and default to the value in cnf/build.bnd...as @chrisrueger suggests above. |
Here's the template for the bndrun file (in bndtools.core): |
No the template in
I think this is not Scott's work, but just a simple hint for me, to reproduce his bug. But this was the starting point of this rabbit hole we are in now :)
I will create another PR next door in bndtools for this. The challange here is that we need to balance things from 2 different repos and 3 different branches. We'll see. Thanks for your feedback. |
>
> > New->Other...->OSGi Service->Java OSGi Service (api, impl, consumer)
>
> I think this is not Scott's work, but just a simple hint for me, to reproduce his bug. But this was the starting point of this rabbit hole we are in now :)
This is my work (merged to master some time ago), AND I use for testing @chrisrueger work since it's in bndtools 7.*) already. So if you are on 7.x+ you should be able to test it like I do by using the New->other...->OSGi Service->Java OSGi Service menu items, filling out the Project Name and ServiceName fields and Finish...which should contain three projects projectname.api, .impl, and .consumer. In the new .api project is servicename.bndrun which has got the problematic vals (to be removed presumably) for runframework and runee.
Those are project templates. Not the same as service templates (the new thing that I introduced in 7.0-REL). I don't think they need to change for the repo changes, but it's possible they might...I haven't tried them yet as I'm focusing on the service templates that I added. As above, this is the bndrun file serviceTemplate in master at the moment: I'm not sure what the final outcome wrt runframework and runee in cnf/build.bnd (workspace template) or in serviceName.bndrun (serviceTemplate), but I assume it's just to remove parts or all of runframework and/or runee from the projectName.bndrun file linked to above so that these are just automatically use the value from the workspace template/build.bnd file...then that's fine with me....i.e. from my point of view as author anyone is welcome to do these updates, and it will be much easier for Peter or someone else with direct access to the bndtools.core repo contents to do so.
I was using a branch before it was merged to master a few months ago, but haven't been using a branch since then (I haven't made any changes for a while to the serviceTemplate and/or the other bndtools.core stuff [which uses the serviceTemplate content at project creation time].
Everything that I've worked on (service templates/Java OSGi Service Wizard UI) latest is on master of bndtools.core. |
Ah ok thanks for the clarification. Then I think I should have everything. |
@scottslewis @pkriens I created PR bndtools/bnd#5907 |
With the changes in this branch here and in bndtools/bnd#5907 I can successfully create the service via @pkriens I tried moving |
That's great @chrisrueger ! I'll test myself, but looks from you test like everything is cool now. I'll let you know if I get anything different once I test...I'll probably wait for merge of bndtools/bnd#5907 and try out the next day's snapshot build. AFAIK, this makes the Java OSGi Service Wizard ready to go with the bndtools.workspace.min/R7-to-R8 workspace template. For the bndtools.workspace template (the other 'built-in' workspace template) for R7-to-R8: Are you planning to start with this bndtools.workspace.min and add on other bundles or something else? FWIW, as long as you start from bndtools.workspace.min, it should not affect the Java OSGi Service Wizard at all. |
Thanks @scottslewis .
Good question. I have not looked into the other bndtools.workspace yet. I just remember @pkriens mentioning that there was some discussion about in the past. I also don't really know the purpose of it... is also looks different (e.g. there a .jar ... where is that coming from?). Based on that I guess we should address the other bndtools.workspace in a different PR and maybe discuss it first. |
>
> Good question. I have not looked into the other [bndtools.workspace](https://github.com/bndtools/workspace) yet. I just remember @pkriens mentioning that there was some discussion about in the past. I also don't really know the purpose of it... is also looks different (e.g. there a [.jar ](https://github.com/bndtools/workspace/tree/master/cnf/templates/org.bndtools.templates.osgi) ... where is that coming from?). Based on that I guess we should address the other [bndtools.workspace](https://github.com/bndtools/workspace) in a different PR and maybe discuss it first.
My $0.03: For the next release, I think at least that the bndtools.workspace should be updated in exactly the same way that bndtools.workspace.min has been updated...i.e. with the same cnf contents. Yes they would be the same, which is a little strange, but at least they would both be on R8. If bndtools.workspace stays as it is (R7) and bndtools.workspace.min is release on R8 I see disaster...particularly for new bndtools users. If they are the same, then in the future additional repos/bundles can be added to bndtools.workspace in future...making it more capable. But IMHO it would be better to add onto bndtools.workspace incrementally. |
3a9da0a
to
d273357
Compare
As suggested in bndtools/bndtools.workspace.min#11 (comment) we up this repo to OSGi R8 and base it on the files of bndtools.workspace.min initially This may not be the final solution but at least a first step to have an OSGi R8 environment, so that templates may build upon that Signed-off-by: Christoph Rueger <[email protected]>
@scottslewis I created bndtools/workspace#24 based on your suggestion. |
Is this going to be merged soon? Once done I want to test end-to-end (the service template wizard anyway) with the nightly build. |
you should rebase on master. I've updated gradle + the java vm |
preparation to run "bnd mbr update" Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
This gives 404 Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
executed "gradle wrapper --gradle-version 7.3"
Signed-off-by: Christoph Rueger <[email protected]>
this fixes the error Discouraged access: The type 'Version' is not API , because Version is part of osgi-annotation-8.1.0.jar Signed-off-by: Christoph Rueger <[email protected]>
* this was the reason it could not resolve Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
This reverts commit 0d39c74. Signed-off-by: Christoph Rueger <[email protected]>
it is referenced in a template Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Done @pkriens |
This relates to #5632 and #5864
As discussed in the call today this is a first attempt to update the template from R7 to R8.
What is this for?
This template should make it easier "Getting started" with bndtools and is basically the minimum a bndtools Eclipse workspace should look like when starting a new project.
Before this change it was based on OSGi R7.
For R8 the repositories need to be updated. It isn't as easy as changing a 7 to an 8 unfortunately.
Current solution
I made use of the bnd command line command, which automatically updates all versions of an .mvn file to the latest version.
bnd mbr update
(which is a gem I will add to the docu soon. Thanks @pkriens for telling me)How to test this?
This is the place where I need support to verify if we are satisfied with result, or what needs to be changed / added.
https://github.com/chrisrueger/bndtools.workspace.min.git
and branchorigin/R7-to-R8
)This should get you a BnWorkspace which looks lke this:
cnf
folderThe distro term is something I learned from @pkriens today which is just a collection of implementation bundles.
The version in there are just based on the existing
cnf/runtime.mvn
and applyingbnd mbr update
Help wanted
I am not sure if the current status is ok or not. Eclipse Problems view is empty, but I need someone to verify if it is enough.