Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » How to read a JAR from an SVN-Repository ?
How to read a JAR from an SVN-Repository ? [message #755676] Wed, 09 November 2011 09:41 Go to next message
Jakob Braeuchi is currently offline Jakob Braeuchi
Messages: 69
Registered: July 2009
Location: Switzerland
Member
we have some components that are provided as jars (bundles) checked in to our svn-repository. when materializing i would like to have these bundles in the target platform.

i have defined the following searchpath in the rmap:

  <rm:searchPath name="sl_translations">
    <rm:provider componentTypes="buckminster,osgi.bundle" readerType="svn">
      <rm:uri format="http://myrepo.xyz.ch/repo/sl/sl_translations/trunk/">
        <bc:propertyRef key="buckminster.component"/>
      </rm:uri>
    </rm:provider>
  </rm:searchPath>


but when materializing i get the following error:


Errors and Warnings
E [0001] : No suitable provider for component ch.rtc.sl.common.events:osgi.bundle was found in resourceMap file:/D:/Eclipse_Workspaces/SoftwareLoftTEST/ch.xyz.sl.rmap/sl.rmap
E   [0001] : No suitable provider for component ch.rtc.sl.common.events:osgi.bundle was found in searchPath sl_translations
E     [0001] : Rejecting provider svn(http://myrepo.xyz.ch/repo/sl/sl_translations/trunk/[http://myrepo.xyz.ch/repo/sl/sl_translations/trunk/]): No component match was found



seems like buckminster does not open the jar to look for the manifest in this case.

thanks
jakob

[Updated on: Wed, 09 November 2011 09:42]

Report message to a moderator

Re: How to read a JAR from an SVN-Repository ? [message #755760 is a reply to message #755676] Wed, 09 November 2011 14:04 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
I don't think Buckminster supports that (someone please correct me if I'm wrong).

The way we handle .jars is to have them in a separate directory in our repository, and then we have a job that publishes the contents of that repository as a p2 site. This requires atwo additional feature projects. One feature project simply specifies (as plugin dependencies in the feature.xml) all the jars to publish. The second feature project, known as a site project, simply points to the first feature and is used to publish it as a p2 site. The publish only needs to be done if the jars change. We have a Jenkins job to do this.

The RMap then uses a "p2" reader type to materialize the components. All you need is the URL (1 per p2 site, not 1 per jar).

My understanding (again, someone please correct me if I'm wrong) is that this is the "correct" 2011 way of doing things.
Re: How to read a JAR from an SVN-Repository ? [message #755838 is a reply to message #755760] Wed, 09 November 2011 18:46 Go to previous messageGo to next message
Philipp Nanz is currently offline Philipp Nanz
Messages: 46
Registered: February 2010
Member
Alternatively, you could also fetch the JARs from a maven repo.
Re: How to read a JAR from an SVN-Repository ? [message #755859 is a reply to message #755760] Wed, 09 November 2011 20:34 Go to previous messageGo to next message
Jakob Braeuchi is currently offline Jakob Braeuchi
Messages: 69
Registered: July 2009
Location: Switzerland
Member
hi matthew,

actually i also want to publish these jars in a p2 repository. we already use the "correct" two-feaures-solution to publish source based bundles.
but i do not know who to get the .jars out of svn ?

the .jars all reside in the same directory in svn; let's say
http://myrepo.xyz.ch/repo/sl/sl_translations/trunk/ and have the form symbolicname_version.jar .

thanks
jakob
Re: How to read a JAR from an SVN-Repository ? [message #755936 is a reply to message #755760] Thu, 10 November 2011 09:08 Go to previous messageGo to next message
Jesper Eskilson is currently offline Jesper Eskilson
Messages: 131
Registered: July 2009
Senior Member
Matthew Webber skrev 2011-11-09 15:04:
> I don't think Buckminster supports that (someone please correct me if
> I'm wrong).
>
> The way we handle .jars is to have them in a separate directory in our
> repository, and then we have a job that publishes the contents of that
> repository as a p2 site. This requires atwo additional feature projects.
> One feature project simply specifies (as plugin dependencies in the
> feature.xml) all the jars to publish. The second feature project, known
> as a site project, simply points to the first feature and is used to
> publish it as a p2 site. The publish only needs to be done if the jars
> change. We have a Jenkins job to do this.

Can you elaborate on this? I'm trying to do the exact same thing. I can
setup the two features, but when I try to resolve my cquery, Buckminster
just complains about "No suitable provider ..." when it attempts to
resolve the jars. How do I tell Buckminster where to take the jars from?

--
/Jesper
Re: How to read a JAR from an SVN-Repository ? [message #756218 is a reply to message #755936] Fri, 11 November 2011 14:27 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
Here's a rough description of how we do it.

To build the p2 site, I check out from my (subversion) repository (using Jenkins), and end up with:

(1) A project at ${workspace_loc}/thirdparty
A project containing the .jars I want to publish to my p2 site.

(2) A project at ${workspace_loc}/features/p2.site. This includes these files (plus some others):
feature.xml - a feature that consists of p2.feature
p2.site.cquery - a cquery which has advisor nodes for p2.site, p2.feature, all the plugin names. The last advisor node is ".*" and has "skip component" selected, this is so only the exact plugins I want get published to the p2 site, but not any of their dependencies.

(3) A project at ${workspace_loc}/features/p2.feature. This include these files:
feature.xml - lists all the plugins I want to publish
p2.target - a target definition that consists of the directory ${workspace_loc}/thirdparty

Now, with the appropriate bits of the repository checked out, I turn the subversion working copy into an Eclipse workspace by passing the following script to buckminster:
importtargetdefinition --active features/p2.feature/p2.target
import features/p2.site/p2.site.cquery
clean
perform -Dbuckminster.output.root=${buckminster_output_root} -Dbuckminster.temp.root=${buckminster_temp_root} -P features/p2.site/buckminster.properties p2.site#site.p2


That creates the files for the p2 site, which I then copy to my web server.

=====

Now, as a completely separate operation, a developer who needs those .jars will just materialize their product feature, which references the plugin names (not the jar names). The RMap will direct them to the p2 site, and the .jars get downloaded and materialized into the target platform.

Note the the developers never see the p2.site and p2.feature projects. They are just used by me (build engineer) to create the p2 site.

I hope that clarifies things, please let me know of you need more details.

Matthew
Re: How to read a JAR from an SVN-Repository ? [message #756309 is a reply to message #756218] Fri, 11 November 2011 21:27 Go to previous messageGo to next message
Jakob Braeuchi is currently offline Jakob Braeuchi
Messages: 69
Registered: July 2009
Location: Switzerland
Member
hi matthew,

thanks for your detailed description.
what i'm looking for is a cquery for step (1).

jakob

[Updated on: Fri, 11 November 2011 21:27]

Report message to a moderator

Re: How to read a JAR from an SVN-Repository ? [message #756624 is a reply to message #756309] Mon, 14 November 2011 14:28 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
I don't use a CQuery, and I don't think you can. I simply check out from subversion. As build engineer I'm the only person who needs to do this, and I do it just once; all the developers use a CQuery which points to the p2 site I create.
Matthew
Re: How to read a JAR from an SVN-Repository ? [message #756795 is a reply to message #756624] Tue, 15 November 2011 07:07 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas Hallgren
Messages: 3229
Registered: July 2009
Senior Member
On 2011-11-14 15:28, Matthew Webber wrote:
> I don't use a CQuery, and I don't think you can. I simply check out from subversion. As build engineer I'm the only
> person who needs to do this, and I do it just once; all the developers use a CQuery which points to the p2 site I create.
> Matthew
>
Most SVN's can be accessed using plain http. Perhaps that would be an option when using a CQuery?

- thomas
Re: How to read a JAR from an SVN-Repository ? [message #756808 is a reply to message #756624] Tue, 15 November 2011 08:44 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
Matthew Webber wrote on Mon, 14 November 2011 14:28
I don't use a CQuery, and I don't think you can. I simply check out from subversion.


I don't know why I wrote that. There is a simple solution we use all the time. In subversion we have a directory called thirdparty/ which contains various .jars from various places. I want to publish a subset of those jars to a p2 site, from which developers can (via a CQuery) materialize into their target platform.

All I do is ensure that thirdparty/ contains:
(1) a .project file to define an Eclispe project with no builders nor natures
(2) a buckminster.cspec file which says name="thirdparty" componentType="buckminster"

Then all you need is an entry in your RMap to locate this in subversion, and a CQuery to materialize a component named thirdparty/.

Hope that helps.
Matthew

Re: How to read a JAR from an SVN-Repository ? [message #756966 is a reply to message #756218] Tue, 15 November 2011 18:19 Go to previous messageGo to next message
Jesper Eskilson is currently offline Jesper Eskilson
Messages: 131
Registered: July 2009
Senior Member
Matthew Webber skrev 2011-11-11 15:27:

> I hope that clarifies things, please let me know of you need more details.

A question about the jars: are they plugin-jars or just any thirdparty
jar? The jars I need to deal with are ready-built plugin-jars (with a
META-INF and plugin.xml file in them, but no .project).

--
/Jesper
Re: How to read a JAR from an SVN-Repository ? [message #757050 is a reply to message #756966] Wed, 16 November 2011 09:18 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
I think this works for any type of .jar. They don't need a .project, because they are not Eclipse projects at any point in my processing chain.
Matthew
Re: How to read a JAR from an SVN-Repository ? [message #757210 is a reply to message #757050] Thu, 17 November 2011 07:00 Go to previous messageGo to next message
Jakob Braeuchi is currently offline Jakob Braeuchi
Messages: 69
Registered: July 2009
Location: Switzerland
Member
hi matthew,

thanks for your hint with the thirdparty-folder.
by adding the thirparty-folder to the cspec buckminster will checkout the whole folder.
i wanted to pick specific jars only, but i'll check if this works for us as well.

thank
jakob
Re: How to read a JAR from an SVN-Repository ? [message #757400 is a reply to message #757210] Fri, 18 November 2011 09:36 Go to previous message
Jakob Braeuchi is currently offline Jakob Braeuchi
Messages: 69
Registered: July 2009
Location: Switzerland
Member
hi,

it worked !

i did what matthew said:

1) checked in my jars (bundles not just plain jars) in the svn repository as a plain project
2) wrote a cspec for this project
3) wrote an rmap and a cquery to materialize this project
4) implemented a p2-feature project with a p2-cquery and a feature.xml referencing the bundles of step 1)

these are the steps to build a p2-site containing the jars:

1) materialize the cquery. buckminster will materialize the project containing the jars into your eclipse workspace
2) switch the target platform to point to the materialized project !
3) checkout the p2-feature and invoke buckminster action "site.p2"


jakob
Re: How to read a JAR from an SVN-Repository ? [message #758012 is a reply to message #756966] Tue, 15 November 2011 20:26 Go to previous message
Jesper Eskilson is currently offline Jesper Eskilson
Messages: 131
Registered: July 2009
Senior Member
Jesper Eskilson skrev 2011-11-15 19:19:
> Matthew Webber skrev 2011-11-11 15:27:
>
>> I hope that clarifies things, please let me know of you need more
>> details.
>
> A question about the jars: are they plugin-jars or just any thirdparty
> jar? The jars I need to deal with are ready-built plugin-jars (with a
> META-INF and plugin.xml file in them, but no .project).
>
> --
> /Jesper
>

This turned out to be easier than I thought. I can just import the
plugin jars using "Import -> Plug-in Development -> Plug-ins and
fragments", and then commit them as regular source plugins.

Thanks anyway.

--
/Jesper
Previous Topic:Resolve plugin and package errors in headless build
Next Topic:How to Convert Feature names
Goto Forum:
  


Current Time: Fri Sep 19 05:50:42 GMT 2014

Powered by FUDForum. Page generated in 0.02399 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software