Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Creating an Update Site(Update Sites with source bundles - there doesn't seem to be any official documentation)
Creating an Update Site [message #1638156] Fri, 27 February 2015 02:30 Go to next message
Marian Schedenig is currently offline Marian SchedenigFriend
Messages: 18
Registered: July 2012
Junior Member
For the past years I've been developing a handful of Eclipse plug-ins, which I distribute via an update site. I've never been entirely sure how to *correctly* manage an update site, but mostly mine has been working well enough, with the occasional hiccup now and then. However, I've once again hit a problem I can't seem to fix, and as a result I'm once again questioning my whole process. The main problem with all this is that there seems to be no useful documentation on update sites at all - or if there is, I haven't been able to find it.

My specific problem has to do with providing source code for extension plug-ins, but instead of focusing on that, I'll describe my overall deployment process, in the hope of once and for all getting it right. My main issue with the whole thing (to which I'll get back at the end of my description) is the generation of source features.

This is how I've been creating my update site for a few years:

I have several plug-ins, mostly unrelated (though there are a few dependencies). For each plug-in there's the plug-in project, a feature project and a German translation plug-in project with a matching feature project (I'm considering dropping these, as they're tedious to maintain and I rather doubt anyone is actually using them - I'm not using them myself). There's also a source feature project for the plug-in itself, though I'm no longer sure this is even necessary or correct (it's been working for me though - until now).

The source feature has the following lines in its build.properties file:

individualSourceBundles=true
generateSourceBundle=true
generate.plugin@name.schedenig.eclipse.grepconsole.source=name.schedenig.eclipse.grepconsole


For all these projects, I have two update site projects, one for the official update site (containing only release builds) and one for my own testing purposes, containing alphas, betas and release candidates so I can easily install them in my Eclipse instances at home at at work.

The update site has a category for each individual plug-in, which contains the features for the plug-in itself, the German translation and the source code. This looks like this in the site.xml:

   <feature url="features/name.schedenig.eclipse.grepconsole_3.6.2.alpha1.jar" id="name.schedenig.eclipse.grepconsole" version="3.6.2.alpha1">
      <category name="grepconsole"/>
   </feature>
   <feature url="features/name.schedenig.eclipse.grepconsole.german_3.6.2.alpha1.jar" id="name.schedenig.eclipse.grepconsole.german" version="3.6.2.alpha1">
      <category name="grepconsole"/>
   </feature>
   <feature url="features/name.schedenig.eclipse.grepconsole.source_3.6.2.alpha1.jar" id="name.schedenig.eclipse.grepconsole.source" version="3.6.2.alpha1">
      <category name="grepconsole"/>
   </feature>

   <category-def name="grepconsole" label="Grep Console">
      <description>
         Grep Console highlights console lines according to fully customisable regular expressions.
      </description>
   </category-def>


Whenever I want to deploy a new release (on the official update site) or a pre-release version (on my own private update site), I update the version numbers of all plug-ins and features, update them version number references in the site.xml and then click "Build all" in the Site Map tab of the site.xml file in the editor. This generates all the new jars for the features and plugins, and updated artfiacts.jar and content.jar files in my project in the file system. I then manually copy the new feature and plugin jars to my web server, and finally also the artifacts.jar, content.jar and site.xml, overwriting the three old files already on the server.

A long time ago I tried to figure out how to automate this for a headless console build, but without much success. I would like to have it, but as long as a button in Eclipse works, I can live with that.

(Incidentally, whenever something goes wrong - e.g. I mistype a version number reference and the build is missing a file - I have to update all the version numbers yet again to get Eclipse to produce any new artifacts. I understand that this is necessary for actual deployments, but for half-broken builds it's rather annoying).

This has been working resonably well, but now I added an extension point to one of my plug-ins and created two new plug-ins providing extensions for it. For some reason, I haven't been able to get the update site to build the source features for these new plug-ins, even though all my descriptor files seem to be consistent with my other projects where it's been working for years. Using Eclipse's "Export/Deployable features" wizard to export my plug-ins and features to the file system works, including sources (using "Generate source bundles") - but for that, I don't even need source features.

It seems clear to me that there's something very (or possibly entirely) wrong with the way I've been handling the generation of source artifacts, but somehow it's been working (until now), and all the (few) bits and pieces I've been able to dig up on this on the internet and in the Eclipse documentation make it work even less - and in fact rarely refer to update sites at all.

It would be VERY helpful if anyone can explain what I'm doing wrong and how to do it right, or even just point me in the direction of ANY reasonably up to date documentation for generating update sites with sources. Bonus points for hints on headless builds. But as long as it works, I'm happy either way.

Thanks in advance,
Marian.
Re: Creating an Update Site [message #1638936 is a reply to message #1638156] Fri, 27 February 2015 11:19 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 27/02/2015 03:30, Marian Schedenig wrote:
> A long time ago I tried to figure out how to automate this for a
> headless console build, but without much success. I would like to have
> it, but as long as a button in Eclipse works, I can live with that.

you might want to give headless building tools, such as Buckminster or
Maven/Tycho, another try :)

Everything will be much easier and automatic.

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: Creating an Update Site [message #1641973 is a reply to message #1638936] Sat, 28 February 2015 22:08 Go to previous messageGo to next message
Marian Schedenig is currently offline Marian SchedenigFriend
Messages: 18
Registered: July 2012
Junior Member
Thanks. I've had another look at Buckminster - without specific pointers, I wasn't even sure where to look amongst the dozens of Eclipse projects.

It leads me back to my original problem, though: Barely useful documentation. Once I found the right tutorials, it was pretty easy to setup a feature (with feature.xml and build.properties) that I can use to produce a P2 update site from within Eclipse. Easier to maintain than the old update site project, and much quicker at building, too.

However, I haven't been able to run a headless build so far. After more digging, I found some tutorials that explain how to install the headless version of Buckminster with the necessary features. But it fails to build my project:

$ ./buckminster -data ~/projects/java/workspaces/java perform -P ~/projects/java/workspaces/java/schedenig_p2_unstable/buckminster.properties name.schedenig.eclipse.p2.unstable#site.p2
No component named org.eclipse.ui:osgi.bundle is known to Buckminster


Google doesn't turn up anything useful for that error message.

There's some heavily in-depth documentation (mainly the BuckyBook) that might explain everything I need to know, but to be perfectly honest, it starts out with descriptions of so many terms and concepts that I don't even fully understand the scope of the whole thing (other than that it can do much more than I need). Surely headlessly building a simple update site for plug-ins is enough of a standard use case that one could expect some straightforward documentation for that specific scenario? I appreciate that the tool is powerful, but I don't want to learn an entire build tool - I'd like to keep the effort for publishing my plug-ins lower than that actual effort for developing them. Wink

Is there anything that can guide me through this without having to read an entire book?

Thx!
Re: Creating an Update Site [message #1644983 is a reply to message #1641973] Mon, 02 March 2015 09:14 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I wrote a tutorial some time ago

http://www.lorenzobettini.it/2013/01/building-an-eclipse-rcp-product-with-buckminster/

as I said, the alternative is Maven/Tycho...

cheers
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: Creating an Update Site [message #1652494 is a reply to message #1644983] Thu, 05 March 2015 22:35 Go to previous messageGo to next message
Marian Schedenig is currently offline Marian SchedenigFriend
Messages: 18
Registered: July 2012
Junior Member
Thanks Lorenzo, that does look helpful.

I use Maven at work. We don't get along. I try to avoid it when I can. Wink
Re: Creating an Update Site [message #1677688 is a reply to message #1652494] Mon, 16 March 2015 00:46 Go to previous messageGo to next message
Marian Schedenig is currently offline Marian SchedenigFriend
Messages: 18
Registered: July 2012
Junior Member
It's a good article, as far as I can tell, but it didn't help me much in the end. Most howtos I've seen rely very much on deploying products, and therefore on the reader having knowledge about product development. I've never gone beyone standalone plug-ins and features.

I've tried to come up with a more precise set of questions here.
Re: Creating an Update Site [message #1678486 is a reply to message #1677688] Mon, 16 March 2015 08:04 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 16/03/2015 01:46, Marian Schedenig wrote:
> It's a good article, as far as I can tell, but it didn't help me much in
> the end. Most howtos I've seen rely very much on deploying products, and
> therefore on the reader having knowledge about product development. I've
> never gone beyone standalone plug-ins and features.
>
> I've tried to come up with a more precise set of questions
> https://www.eclipse.org/forums/index.php/m/1677623.

You don't need to create/understand product: you can stop at the part
where the update site is created :)

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Category information is not added to content.xml
Next Topic:java.util.zip.ZipError exception during sign.p2.repository in headless build
Goto Forum:
  


Current Time: Thu Apr 18 02:32:35 GMT 2024

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

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

Back to the top