Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Eclipse RCP Tip of the Day: p2 Touchpoint Instructions

DZone's Guide to

Eclipse RCP Tip of the Day: p2 Touchpoint Instructions

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

A very common use case in a domain specific RCP app is to update itself using p2. When deploying this app, it would be very convenient if a list of predefined update sites could be available for the application at the first start. This was possible (but not trivial) even with Eclipse 3.4. But now, with Eclipse 3.5.1, it is very easy to do:

  1. Put your product configuration file in a bundle (plug-in project), not in a feature
  2. Create a file at top level and name it p2.inf
  3. Put the following content in the file:
    instructions.configure=\
    addRepository(type:0,location:YOUR METADATA REPOSITORY);\
    addRepository(type:1,location:
    YOUR ARTIFACT REPOSITORY);
  4. Don’t forget to include p2.inf in the build.properties

You find a working example in my MP3 Manager demo application:

instructions.configure=\
addRepository(type:0,location:http${#58}//max-server.myftp.org/mp3m/repository);\
addRepository(type:1,location:http${#58}//max-server.myftp.org/mp3m/repository);

If you want to test is with file locations rather than Internet locations, you could use locations like

file${#58}/c:/repository

The above location works for Windows, mind that in the file case there is only one / after the colon.

A list of all available p2 touchpoint instructions you find in the Eclipse Wiki.

From http://www.toedter.com/blog

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}