Per-project repositories

30 views
Skip to first unread message

Przemysław Wesołek

unread,
Nov 5, 2016, 11:58:24 AM11/5/16
to bndtools-users
Hi,

In my workspace I need to wrap an ugly JAR from Maven. It is pretty old, uses old dependencies and doesn't play nice with OSGi.

So I wanted to wrap it up in a separate project and hide behind some simple facade, which I export instead.

I created a new MavenBndRepository just for the dependencies of this JAR, filled with the JAR itself and a few rounds of "Add Compile Dependencies" on the dependencies (BTW — Is there a way to add transitive dependencies somehow to MavenBndPlugin?). So far so good.

The problem is that this wrapper's repo is now exposed to all other bundles. What I'm afraid of is that at some point the resolution process will take an old dependency out of this repo.

Is there a way to restrict the repository (or plugin) to a single project? I know that I can restrict repositories in bndrun files, but how to do that for the build process? Also, I'd like to avoid going into every separate bnd file and specify the repositories — the best would be to disable the wrapper's repo for the workspace and enable only in the single wrapper project.

I also don't want to make a separate workspace just for the wrapper and publishing locally. Having the project open in the workspace I have the luxury of debugging my facade, correcting the code online, etc.

Regards,
Przemek

Timothy Ward

unread,
Nov 7, 2016, 11:03:42 AM11/7/16
to bndtool...@googlegroups.com
Hi,

It sounds to me as though you should try defining the repository in the one project that needs it, rather than at cnf level…

Regards,

Tim

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Przemysław Wesołek

unread,
Nov 7, 2016, 7:13:35 PM11/7/16
to bndtools-users
But how? I tried copying "-plugin" instruction from cnf/ project to the project's bnd.bnd, but it doesn't seem to work, I got errors from Bndtools resolving -buildpath.

BJ Hargrave

unread,
Nov 7, 2016, 11:15:55 PM11/7/16
to bndtool...@googlegroups.com
You can only do repository plugins at the workspace level. They won't work at the project level.
--
BJ

Przemysław Wesołek

unread,
Nov 8, 2016, 3:46:18 AM11/8/16
to bndtools-users
So is it possible to configure, on the workspace level, the set of repositories to use for -buildpath and bndrun resolving, and modify it on the project level? If not is it impossible to do due to some architecture decisions, or it "just" needs implementing?

Best regards,
Przemek

Tim Ward

unread,
Nov 8, 2016, 4:08:29 AM11/8/16
to bndtool...@googlegroups.com
I believe that you can have a per project repository as long as you set up that project to use the non-workspace Gradle plugin. Ray Augé would be the person to confirm that. 

Having both plugins in the same Eclipse Workspace may be a bit messy though. It's not something I've ever tried!

Tim

Sent from my iPhone

BJ Hargrave

unread,
Nov 8, 2016, 10:06:51 AM11/8/16
to bndtool...@googlegroups.com
When you are using the workspace model (cnf), then the repositories are at the workspace level. They don't vary by project.

However, I think you can use -standalone in the bndrun file to "disconnect" it from the workspace and then it can have different repositories than the workspace. (Disclaimer, I have not tried this myself, so I may be completely wrong :-)
--
BJ

Peter Kriens

unread,
Nov 8, 2016, 1:11:09 PM11/8/16
to bndtool...@googlegroups.com
Yes, if you supply the -standalone then the bndrun file == workspace AND project.

Kind regards,

Peter Kriens
Reply all
Reply to author
Forward
0 new messages