p2 repository in the local file system

36 views
Skip to first unread message

Dirk Fauth

unread,
Oct 26, 2017, 9:15:38 AM10/26/17
to bndtools-users
Hi,

I would like to use a p2 repository from the local file system. For example like this:

-plugin.5.Equinox: \
aQute.bnd.repository.p2.provider.P2Repository; \
name = Equinox; \
url = equinox-SDK-Oxygen.1a.zip!

In p2 the ending exclamation mark is saying that the repository is in an archive file.

I know that this is maybe too p2 specific. But would it be possible to use a local directory like this?

-plugin.5.Equinox: \
aQute.bnd.repository.p2.provider.P2Repository; \
name = Equinox; \
local = ${build}/equinox-SDK-Oxygen.1a

When I do this I get an error that the url parameter has to be set. And if I change local to url, well then I get a UndeclaredThrowableException

From my understanding it should be the same whether the p2 repo is accessed from the web or from the local file system. And especially for Equinox this would be nice, as the download is provided separately, but the p2 site is part of the whole Oxygen release train.

Greez,
Dirk

BJ Hargrave

unread,
Oct 26, 2017, 9:20:21 AM10/26/17
to bndtool...@googlegroups.com
I am not sure what the issue is. You may need to look into the code and possibly propose a PR to enable this.

--
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.
--
BJ

Dirk Fauth

unread,
Oct 26, 2017, 9:27:28 AM10/26/17
to bndtools-users
Do you have any pointer where to start looking at? I am not very familiar with the bndtools code structure.

BJ Hargrave

unread,
Oct 26, 2017, 9:31:58 AM10/26/17
to bndtool...@googlegroups.com

Dirk Fauth

unread,
Oct 26, 2017, 9:42:10 AM10/26/17
to bndtools-users
Thanks!

From a first look it seems there is a strong dependency to HttpClient.

Maybe I'll need to talk to Peter Kirschner about his solution and probably get it merged to also support local indexing by default.

Raymond Auge

unread,
Oct 27, 2017, 3:48:56 AM10/27/17
to bndtool...@googlegroups.com
Have you tried explicitly using the url field along with a literal file protocol value?

E.g.

-plugin.5.Equinox: \
aQute.bnd.repository.p2.provider.P2Repository; \
name = Equinox; \
url = "file:${build}/equinox-SDK-Oxygen.1a"

- Ray

To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

BJ Hargrave

unread,
Oct 27, 2017, 3:52:21 AM10/27/17
to bndtool...@googlegroups.com
They have a zip file; not files in a directory on the file system. 

And use the ${fileuri} macro instead of trying to make your own file url. Then it will work on windows. 😊
--
BJ

Raymond Auge

unread,
Oct 27, 2017, 4:01:13 AM10/27/17
to bndtool...@googlegroups.com


On Oct 27, 2017 09:52, "BJ Hargrave" <b...@bjhargrave.com> wrote:
They have a zip file; not files in a directory on the file system. 

Peter did mention using a directory in his second example... That's what I was making a suggestion against.

- Ray
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
BJ

--
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-users+unsubscribe@googlegroups.com.

Dirk Fauth

unread,
Oct 27, 2017, 6:56:07 AM10/27/17
to bndtools-users
Thanks for the pointers. Peter Kirschner gave me the similar advice, with additional hints to create a local indexed repo. But I skipped that for my simple example now.

Actually my solution is to do this:

I downloaded the p2 repositories as ZIP files to my local machine. While ECF is also available as p2 repo online, Equinox does only provide a separate archive file but the update site is only included in the Eclipse Release repo (at least I haven't found a separate one).
The usage of a ZIP file with the exclamation mark as suffix did not work. Probably too p2 specific. But that is okay, as it would only be some convenience. So I unpacked the archive file and placed it into the cnf folder. Then I referenced it using the fileuri macro to make it also work on Windows. ;)

-plugin.5.Equinox_local: \
aQute.bnd.repository.p2.provider.P2Repository; \
name = Equinox Local; \
url = ${fileuri;${build}}/equinox-SDK-Oxygen.1a
-plugin.6.ECF_local: \
aQute.bnd.repository.p2.provider.P2Repository; \
name = ECF SDK Local; \
url = ${fileuri;${build}}/org.eclipse.ecf.sdk_3.13.8

Actually that is pretty nice to show my ECF remote services example in bndtools on Felix. The Equinox dependencies can be resolved automatically (especially core.jobs, common and supplement) and I can start and use it easily.

That definitely becomes part of my upcoming blog post.

Thanks again for your help!
Dirk
Reply all
Reply to author
Forward
0 new messages