Skip to content
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

Bnd resolve task emits unexportable version requirement #3762

Closed
gamerson opened this issue Feb 5, 2020 · 1 comment
Closed

Bnd resolve task emits unexportable version requirement #3762

gamerson opened this issue Feb 5, 2020 · 1 comment
Assignees
Labels
maint-candidate Issues or pull requests that are candidates for a maintenance release
Milestone

Comments

@gamerson
Copy link
Contributor

gamerson commented Feb 5, 2020

I have a sample workspace here using bnd 5.1.0-SNAPSHOT

https://github.com/gamerson/eclipse-headless-bnd

In this workspace, if you clone it and do the following...

  1. cd eclipse.headless.app
  2. ../gradlew resolve
  3. ../gradlew export

It will fail with the following error:

 Task :eclipse.headless.app:export.app FAILED
error  : Can not find URL for bsn bndtools.runtime.applaunch.eclipse4
error  : bndtools.runtime.applaunch.eclipse4;version=snapshot not found

FAILURE: Build failed with an exception.

If you go to the app.bndrun and remove the following line:

bndtools.runtime.applaunch.eclipse4;version=snapshot

with this line

bndtools.runtime.applaunch.eclipse4

And then try the gradlew export, it will work and correctly exports an executable jar.

This bundle bndtools.runtime.applaunch.eclipse4 is coming from a Bnd workspace Local repository. It has the version of 0.1.0.20141204-0657

@bjhargrave
Copy link
Member

bjhargrave commented Feb 7, 2020

So after some debugging, the issue is that the bndtools.runtime.applaunch.eclipse4 artifact is in a LocalIndexedRepo. That repo type always decorates resources in its index as having come from the workspace. That is, it adds a bnd.workspace.project capability whose bnd.workspace.project attribute has a value of the URI of the index file to the resource.

This is wrong. Only the WorkspaceResourcesRepository should decorate resources with a bnd.workspace.project capability. Resources in a LocalIndexedRepo are in the repo. They may have come from the workspace before being released into the repo. But once they are in the repo, the resource comes from the repo and not the workspace.

@bjhargrave bjhargrave self-assigned this Feb 7, 2020
@bjhargrave bjhargrave added this to the 5.1 milestone Feb 7, 2020
@bjhargrave bjhargrave added the maint-candidate Issues or pull requests that are candidates for a maintenance release label Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maint-candidate Issues or pull requests that are candidates for a maintenance release
Projects
None yet
Development

No branches or pull requests

2 participants