Eclipse Newsletter - Eclipse for Science

January 27, 2015 04:44 PM

This month's newsletter is all about Science! Read it now.

January 27, 2015 04:44 PM

Thanks for the fixing the Eclipse Internal Browser on Linux!

by aurelien.pupier at January 27, 2015 01:00 PM

I'd like to offer a few words to say thank you to the folks who worked to make the Eclipse Internal browser work by default on Linux since Eclipse 4.4.

There was a known workaround which required User intervention, such as the one explained on our own community blog.

But it was broken for a such a loooong time. So long, that it was even the subject of a talk at one of the EclipseCon conferences called a journey of getting HTML to work inside Eclipse.

Thanks to your fix, the next release (6.5.0) of our product will have a Welcome page working by default!

Bonita BPM 6.5 home page - Ubuntu 14.04


by aurelien.pupier at January 27, 2015 01:00 PM

NatTable with custom scrollbars

by Dirk Fauth at January 26, 2015 07:26 PM

When talking about styling a SWT control via CSS, one issue is raised quite early. The scrollbars can not be styled! Looking at a dark theme, the importance on that issue becomes obvious, as you can see in the following screenshot.

NatTable_dark_default_scrollbars

Using NatTable the scrolling capabilities are via the ViewportLayer. With NatTable 1.1 the possibility was added to set custom scrollbars to the ViewportLayer. This enables for example to have multiple ViewportLayer in a layer composition (split viewport) or to create UI layouts with special scrolling interactions.

With the possibility to use a custom scrollbar implementation, it is possible to style a NatTable completely with a dark theme. As an example for a stylable scrollbar we use the FlatScrollBar from Code Affine.

Since the scrollbars of the Canvas, which is the base class of NatTable, can’t be exchanged directly, we need to create a wrapper composite for the NatTable. This way the scrollbars can be attached beneath the NatTable instead of being part inside the NatTable.

NatTable_wrapper

To create the above layout, a GridLayout with two columns can be used, where the NatTable will take all the available space.

// NatTable and scrollbar container
Composite container = new Composite(parent, SWT.NONE);
GridLayoutFactory
    .swtDefaults()
    .numColumns(2)
    .margins(0, 0)
    .spacing(0, 0)
    .applyTo(container);

// NatTable as main control
NatTable natTable = new NatTable(container, viewportLayer);
GridDataFactory
    .fillDefaults()
    .grab(true, true)
    .applyTo(natTable);

The vertical scrollbar is attached to the right, and the horizontal scrollbar is attached to the bottom. To ensure that the layout doesn’t break, the FlatScrollBar is wrapped into a Composite. This way we are also able to set a fixed width/height, while telling the FlatScrollBar to fill the available space.

// vertical scrollbar wrapped in another composite for layout
Composite verticalComposite =
    new Composite(container, SWT.NONE);
GridLayoutFactory
    .swtDefaults()
    .margins(0, 0)
    .spacing(0, 0)
    .applyTo(verticalComposite);
GridData verticalData = GridDataFactory
    .swtDefaults()
    .hint(14, SWT.DEFAULT)
    .align(SWT.BEGINNING, SWT.FILL)
    .grab(false, true)
    .create();
verticalComposite.setLayoutData(verticalData);

FlatScrollBar vertical =
    new FlatScrollBar(verticalComposite, SWT.VERTICAL);
GridDataFactory
    .fillDefaults()
    .grab(true, true)
    .applyTo(vertical);

// horizontal scrollbar wrapped in another composite for layout
Composite horizontalComposite =
    new Composite(container, SWT.NONE);
GridLayoutFactory
    .swtDefaults()
    .margins(0, 0)
    .spacing(0, 0)
    .applyTo(horizontalComposite);
GridData horizontalData = GridDataFactory
    .swtDefaults()
    .hint(SWT.DEFAULT, 14)
    .align(SWT.FILL, SWT.BEGINNING)
    .grab(true, false)
    .create();
horizontalComposite.setLayoutData(horizontalData);

FlatScrollBar horizontal =
    new FlatScrollBar(horizontalComposite, SWT.HORIZONTAL);
GridDataFactory
    .fillDefaults()
    .grab(true, true)
    .applyTo(horizontal);

To be independent of the scrollbar implementation, the IScroller<T> interface was introduced in NatTable. The two default implementations ScrollBarScroller and SliderScroller are shipped with NatTable Core to be able to set custom scrollbars using SWT default implementations. Using this abstraction it is also possible to use another scrollbar implementation, like the FlatScrollBar. The following code shows the implementation of a FlatScrollBarScroller.

class FlatScrollBarScroller
    implements IScroller<FlatScrollBar> {

    private FlatScrollBar scrollBar;

    public FlatScrollBarScroller(FlatScrollBar scrollBar) {
        this.scrollBar = scrollBar;
    }

    @Override
    public FlatScrollBar getUnderlying() {
        return scrollBar;
    }

    @Override
    public boolean isDisposed() {
        return scrollBar.isDisposed();
    }

    @Override
    public void addListener(int eventType, Listener listener) {
        scrollBar.addListener(eventType, listener);
    }

    @Override
    public void removeListener(int eventType, Listener listener) {
        scrollBar.removeListener(eventType, listener);
    }

    @Override
    public int getSelection() {
        return scrollBar.getSelection();
    }

    @Override
    public void setSelection(int value) {
        scrollBar.setSelection(value);
    }

    @Override
    public int getMaximum() {
        return scrollBar.getMaximum();
    }

    @Override
    public void setMaximum(int value) {
        scrollBar.setMaximum(value);
    }

    @Override
    public int getPageIncrement() {
        return scrollBar.getPageIncrement();
    }

    @Override
    public void setPageIncrement(int value) {
        scrollBar.setPageIncrement(value);
    }

    @Override
    public int getThumb() {
        return scrollBar.getThumb();
    }

    @Override
    public void setThumb(int value) {
        scrollBar.setThumb(value);
    }

    @Override
    public int getIncrement() {
        return scrollBar.getIncrement();
    }

    @Override
    public void setIncrement(int value) {
        scrollBar.setIncrement(value);
    }

    @Override
    public boolean getEnabled() {
        return scrollBar.getEnabled();
    }

    @Override
    public void setEnabled(boolean b) {
        scrollBar.setEnabled(b);
    }

    @Override
    public boolean getVisible() {
        return scrollBar.getVisible();
    }

    @Override
    public void setVisible(boolean b) {
        scrollBar.setVisible(b);
    }

}

Using the above FlatScrollBarScroller, the created FlatScrollBar instances can be set to the ViewportLayer.

As the layout will always show the space for the scroller with the GridData instances above, we need to register a listener that hides the wrapper Composites of the FlatScrollBar instances in case the FlatScrollBar is hidden, and a listener that shows the Composites again in case the FlatScrollBar becomes visible again. This is done by setting a GridLayoutData with a matching exclude flag.

// create the vertical scroller
FlatScrollBarScroller verticalScroller =
    new FlatScrollBarScroller(vertical);

// register the hide/show listener
verticalScroller.addListener(SWT.Hide, new Listener() {
    @Override
    public void handleEvent(Event event) {
    	GridDataFactory
            .createFrom(verticalData)
            .exclude(true)
            .applyTo(verticalComposite);
    	GridDataFactory
            .createFrom(horizontalData)
            .span(2, 1)
            .applyTo(horizontalComposite);
    }
});
verticalScroller.addListener(SWT.Show, new Listener() {
    @Override
    public void handleEvent(Event event) {
    	verticalComposite.setLayoutData(verticalData);
    	horizontalComposite.setLayoutData(horizontalData);
    }
});

// create the horizontal scroller
FlatScrollBarScroller horizontalScroller =
    new FlatScrollBarScroller(horizontal);

// register the hide/show listener
horizontalScroller.addListener(SWT.Hide, new Listener() {
    @Override
    public void handleEvent(Event event) {
    	GridDataFactory
            .createFrom(verticalData)
            .span(1, 2)
            .applyTo(verticalComposite);
    	GridDataFactory
            .createFrom(horizontalData)
            .exclude(true)
            .applyTo(horizontalComposite);
    }
});
horizontalScroller.addListener(SWT.Show, new Listener() {
    @Override
    public void handleEvent(Event event) {
    	verticalComposite.setLayoutData(verticalData);
    	horizontalComposite.setLayoutData(horizontalData);
    }
});

// set the custom IScroller to the ViewportLayer
viewportLayer.setVerticalScroller(verticalScroller);
viewportLayer.setHorizontalScroller(horizontalScroller);

The last part is to set the style information to the NatTable and the FlatScrollBar instances.

// set a dark background to the wrapper container
container.setBackground(GUIHelper.COLOR_BLACK);

// set a dark styling to the scrollbars
vertical.setBackground(GUIHelper.COLOR_BLACK);
vertical.setPageIncrementColor(GUIHelper.COLOR_BLACK);
vertical.setThumbColor(GUIHelper.COLOR_DARK_GRAY);

horizontal.setBackground(GUIHelper.COLOR_BLACK);
horizontal.setPageIncrementColor(GUIHelper.COLOR_BLACK);
horizontal.setThumbColor(GUIHelper.COLOR_DARK_GRAY);

// set a dark styling to NatTable
natTable.setBackground(GUIHelper.COLOR_BLACK);
natTable.setTheme(new DarkNatTableThemeConfiguration());

Doing the steps described above it is possible to create a completely dark themed NatTable using custom scrollbars as shown in the picture below.

NatTable_dark_custom_scrollbars

At the time writing this blog post, there is no wrapper or adapter implementation in NatTable for creating a NatTable with custom scrollbars. But it might be added in the future, based on the above explanations.

The full example code is available here.


by Dirk Fauth at January 26, 2015 07:26 PM

EclipseCon 2015 - Register by February 2

January 26, 2015 04:49 PM

Join us in sunny California for EclipseCon 2015! Register by February 2 for the best price.

January 26, 2015 04:49 PM

The Open IoT Challenge has officially started!

by Benjamin Cabé at January 26, 2015 10:09 AM

The Open IoT Challenge has received an incredible amount of interest so far, and it is 45 projects in total who entered the challenge! They now have about a month to work on their solution and demonstrate why they deserve to win.

We expect all the challengers to document the evolution of their projects and it will be interesting to see the variety of technologies and open-source projects being used.
You can follow what is happening thanks to the Tumblr that we created for the occasion: http://openiotchallenge.tumblr.com.

open iot challenge tumblr

Finally, last week, we have selected 10 projects that have been awarded with a $150 gift card to help buy hardware parts for their solution. Here are the names of the lucky winners:

  • Davide De Cesaris
  • Ravi Butani
  • Franz Schnyder
  • Lotte Steenbrink
  • Tobiasz Dworak
  • Abhishek
  • Emir Ercan Ayar
  • Sergey Vasiliev
  • Markus Fischer
  • Arne Jenssen

by Benjamin Cabé at January 26, 2015 10:09 AM

Eclipse Hackathon 2015/01 – Hamburg

by eselmeister at January 26, 2015 07:59 AM

We had our first 2015 Eclipse Hackathon last friday in Hamburg. The next one will follow approximately in April.

Eclipse-Hackathon-HH-2015

It was a great meeting and I’d like to encourage others to do the same :-).


by eselmeister at January 26, 2015 07:59 AM

e(fx)clipse 1.2.0 – New service to observe a filesystem path

by Tom Schindl at January 25, 2015 11:53 AM

With 1.2.0 the e(fx)clipse core runtime bundle comes with a service who is able to track filesystem modifications. Since Java7 there’s an API to observe filesystem paths and so has the Eclipse Core Resources System which is used inside your Eclipse IDE.

The service we created looks like this:

public interface FilesystemService {
  public enum Kind {
    CREATE,
    MODIFY,
    DELETE
  }
  public Subscription observePath(URI path, BiConsumer<Kind, URI> consumer);
  public Subscription observePath(Path path, BiConsumer<Kind, Path> consumer);
  public boolean applies(URI uri);
}

and you use it like this:

import org.eclipse.fx.core.Util;
import org.eclipse.fx.core.FilesystemService;
import org.eclipse.fx.core.URI;

public class Sample {
   private static Optional<Subscription> void observe(String pathUri, Consumer<Kind,URI> c) {
    URI uri = URI.createURI(pathUri);
    return Util.lookupService(FilesystemService.class)
       .stream()
       .filter(fs -> fs.applies(uri))
       .findFirst()
       .map(fs -> fs.observe(uri,c));
   }

   public static void main(String[] args) {
     observe("file:/User/tomschindl", 
       (kind,uri) -> System.out.println( kind + " => " + uri));
   }
}

Things to notice:

  • There can be multiple Filesystem Services depending on the URI you want to observe
  • This whole stuff works in plain Java as well as it does in an OSGi-Environment
  • The system is extensible so you could plug-in your own filesystem service for you special filesystem and register it using the Java built-in service loader and the OSGi-Service registry


by Tom Schindl at January 25, 2015 11:53 AM

Customize Perspective is back

by Andrey Loskutov at January 24, 2015 09:12 PM

After 3 years of absence "Customize Perspective Dialog" is coming back to Eclipse - will be in Eclipse 4.5 M5. The dialog itself was of course always there, but starting with Eclipse 4.2 it has lost half of the content compared with the Eclipse 3.8 and was in most cases not functional or lead to strange effects. You can read what was broken in detail in the bug 420956 and linked bugs. But a picture is worth a thousand words, below are screenshots before and after my patches.

Menu tab before:


Menu tab after: 


Toolbar tab before: 


Toolbar tab after (doesn't fit on a single window): 



Action set tab before (right two panes are pretty empty): 



Action set tab  after: 



The patch (or the series of them) itself wasn't big, but without any documentation I had to reverse engineer and step through with the debugger the entire window/toolbar creation code, which currently consists of a funny mix of the "legacy" 3.x and "modern" e4 paradigms. It cost me nearly two weeks around Christmas and some time afterwards on polishing the patches during the reviews. Many thanks to everyone helped me on the way, but especially to Lars Vogel, Paul Webster, Noopur Gupta.


by Andrey Loskutov at January 24, 2015 09:12 PM

e(fx)clipse 1.2.0 – RRobot learned to generate declarative services

by Tom Schindl at January 24, 2015 02:16 PM

In my last blog post I described that the way you define themes has changed – pre 1.2.0 you used extension points, now with 1.2.0 you are supposed to use OSGi-Services (preferably through the use of declarative services).

I guess most people don’t know that but when they are using one for the project wizards we provide the code responsible to do setup is not handcrafted Java code but we are using a DSL named RRobot who holds the setup description in files named .rtask. RRobot has not dependencies to other e(fx)clipse stuff so it can be used by your eclipse plug-in as well to automate the creation of projects.

All the wizard does at the end does is:

public class NewProjectStructureWizard extends Wizard implements INewWizard {
  // ....

  @Override
  public boolean performFinish() {
    Bundle b = FrameworkUtil.getBundle(getClass());
    BundleContext ctx = b.getBundleContext();
    ServiceReference<RRobot> ref = ctx.getServiceReference(RRobot.class);
    RRobot r = ctx.getService(ref);

    FileLoader loader = FileLoader.createLoader();
    RobotTask task = loader.loadTask(
      URI.createPlatformPluginURI("/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask", true));
    Map<String,Object> additionalData = new HashMap<>();

    try {
      getContainer().run(true, true,
        (monitor) -> r.executeTask(monitor, task, additionalData));
    } catch (Throwable e) {
       // Handle it ....
    }
    return true;
}

The following is the part of rtask-File used when you use the e4 Application wizard for JavaFX in 1.1.0:

screen_ext

With the change to the runtime we had to extend the feature set of rrobot to allow setting up DS-Components so the setup has change to this in 1.2.0:
screen_ds



by Tom Schindl at January 24, 2015 02:16 PM

Publish an Eclipse p2 repository on Sourceforge with rsync

by Lorenzo Bettini at January 24, 2015 11:51 AM

This can be seen as a follow-up post of my previous post on building Eclipse p2 composite repositories. In this blog post I’ll show an automatic way for publishing an Eclipse p2 (composite) repository (a.k.a. update site) on Sourceforge, using rsync for synchronization. You may find online many posts about publishing update sites on Github pages and recently on bintray. (as a reminder, rsync is a one-way synchronization tool, and we assume that the master replica is the one on sourceforge; rysnc, being a synchronization tool, will only transfer the changed files during synchronization).

I prefer sourceforge for some reasons:

  • you have full and complete access to the files upload system either with a shell or, most importantly for the technique I’ll describe here, with rsync. From what I understand, instead, bintray will manage the binary artifacts for you;
  • in order to create and update a p2 composite site you must have access to the current file system layout of the p2 update site, which I seem to understand is not possible with bintray;
  • you have download statistics and your artifacts will automatically mirrored in sourceforge’s mirrors.

By the way: you can store your git repository anywhere you want, and publish the binaries on sourceforge. (see this page and this other page).

I’ll reuse the same example of the previous post, the repository found here https://github.com/LorenzoBettini/p2composite-example, where you find all the mechanisms for creating and updating a p2 composite repository.

The steps of the technique I’ll describe here can be summarized as follows: when it comes to release a new child in the p2 composite update site (possibly already published on Sourceforge), the following steps are performed during the Maven/Tycho build

  1. Use rsync to get an update local version of the published p2 composite repository somewhere in your file system (this includes the case when you never released a version, so you’ll get a local empty directory)
  2. Build the p2 repository with Tycho
  3. Add the above created p2 repository as a new child in the local p2 composite repository (this includes the case where you create a new composite repository, since that’s your first release)
  4. Use rsync to commit the changes back to the remote p2 composite repository

Since we use rsync, we have many opportunities:

  • we’re allowed to manually modify (i.e., from outside the build infrastructure) the p2 composite repository, for instance by removing a child repository containing a wrong release, and commit the changes back;
  • we can release from any machine, notably from Jenkins or Hudson, since we always make sure to have a synchronized local version of the released p2 composite repository.

Prepare the directory on Sourceforge

This assumes that you have an account on Sourceforge, that you have registered a project. You need to create the directory that will host your p2 composite repository in the “Files” section.

For this example I created a new project eclipseexampleshttps://sourceforge.net/projects/eclipseexamples/, and I plan to store the p2 composite in the sourceforge file system on this path: p2composite.example/updates.

So I’ll create the directory structure accordingly (using the “Add Folder” button:

sourceforge create folder structure 1 sourceforge create folder structure 2 sourceforge create folder structure 3

Ant script for rsync

I’m using an ant script since it’s easy to call that from Maven, and also manually from the command line. This assumes that you have already rsync installed on your machine (or in the CI server from where you plan to perform releases).

This ant file is meant to be completely reusable.

Here’s the ant file

<?xml version="1.0" encoding="UTF-8"?>
<project name="Rsync from Ant" basedir=".">

	<!-- local source directory for rsync (read from this directory) -->
	<!-- <property name="rsync.remote.dir" value="lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/"/> -->

	<!-- remote rsync host -->
	<!-- <property name="rsync.local.dir" value="${user.home}/p2.repositories/updates/"/> -->

	<!-- pass "-n" to perform a trial run with no changes made -->
	<!-- <property name="dryrun" value="-n"/> -->

	<target name="rsync-update">
		<rsync source="${rsync.remote.dir}" dest="${rsync.local.dir}" />
	</target>

	<target name="rsync-commit">
		<rsync source="${rsync.local.dir}" dest="${rsync.remote.dir}" />
	</target>

	<!-- = = = = = = = = = = = = = = = = =
          macrodef: rsync          
         = = = = = = = = = = = = = = = = = -->
	<macrodef name="rsync">
		<attribute name="source" />
		<attribute name="dest" />
		<sequential>
			<echo message="Rsync source:" />
			<echo message="@{source}" />
			<echo message="Rsync destination:" />
			<echo message="@{dest}" />
			<exec dir="." executable="rsync">
				<arg value="-azvc" />

				<!-- exclude all hidden files and directories -->
				<arg line="--exclude='.*'" />

				<!-- use ssh -->
				<arg line="-e ssh" />

				<!-- use ssh -->
				<arg line="--delete" />

				<!-- use ssh -->
				<arg line="${dryrun}" />

				<!-- source for the rsync -->
				<arg value="@{source}" />

				<!-- destination for rsync -->
				<arg value="@{dest}" />
			</exec>
		</sequential>
	</macrodef>

</project>

We have a macro for invoking rsync with the desired options (have a look at rsync documentation for understanding their meaning, but it should be straightforward to get an idea).

In particular, the transfer will be done with ssh, so you must have an ssh key pair, and you must have put the public key on your account on sourceforge. Either you created the key pair without a passphrase (e.g., for releasing from a CI server of your own), or you must make sure you have already unlocked the key pair on your local machine (e.g., with an ssh-agent, or with a keyring, depending on your OS).

The arguments source and dest will depend on whether we’re doing an update or a commit (see the two ant targets). If you define the property dryrun as -n then you can simulate the synchronization (both for update and commit); this is important at the beginning to make sure that you synchronize what you really mean to synchronize. Recall that when you perform an update, specifying the wrong local directory might lead to a complete deletion of that directory (the same holds for commit and the remote directory). Moreover, source and destinations URLs in rsync have a different semantics depending on whether they terminate with a slash or not, so make sure you understand them if you need to customize this ant file or to pass special URLs.

The properties rsync.remote.dir and rsync.local.dir will be passed from the Tycho build (or from the command line if you call the ant script directly). Once again, please use the dryrun property until you’re sure that you’re synchronizing the right paths (both local and remote).

Releasing during the Tycho build

Now we just need to call this ant’s targets appropriately from the Tycho build; I’ll do that in the pom.xml of the project that builds and updates the composite p2 repository.

Since I don’t want to push a new release on the remote site on each build, I’ll configure the plugins inside a profile (it’s up to you to decide when to release): here’s the new part:

<profiles>
	<profile>
		<id>release-composite</id>
		<activation>
			<activeByDefault>false</activeByDefault>
		</activation>
		
		<properties>
			<!-- local source directory for rsync (read from this directory) -->
			<rsync.remote.dir>lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/</rsync.remote.dir> 
			<!-- remote rsync host -->
			<rsync.local.dir>${user.home}/p2.repositories/updates/</rsync.local.dir>
			<!-- pass "-n" to perform a trial run with no changes made -->
			<dryrun></dryrun>
		</properties>
		
		<build>
			<plugins>
				<plugin>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>${maven-antrun-plugin.version}</version>
					<executions>
						<execution>
							<id>update-local-repository</id>
							<phase>prepare-package</phase>
							<configuration>
								<target>
									<ant antfile="${basedir}/rsync.ant"
									target="rsync-update">
									</ant>
								</target>
							</configuration>
							<goals>
								<goal>run</goal>
							</goals>
						</execution>
						
						<execution>
							<id>deploy-repository</id>
							<phase>verify</phase>
							<configuration>
								<target>
									<ant antfile="${basedir}/rsync.ant"
									target="rsync-commit">
									</ant>
								</target>
							</configuration>
							<goals>
								<goal>run</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

			</plugins>
		</build>
	</profile>
</profiles>

Now the URL to access a remote path on sourceforge with ssh has the following shape

<username>,<project>@frs.sourceforge.net:/home/frs/project/<project>/<path>

So in my case I specified (again, the final / is crucial for what we want to synchronize with rsync, see the note above):

lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/

The local URL specifies where the local p2 composite site is stored (see the previous post), in this example it defaults to

${user.home}/p2.repositories/updates/

Again, the final / is crucial.

We configured the maven-antrun-plugin with two executions:

  1. before updating the p2 composite update site (phase prepare-package) we make sure we have a synchronized local version of the repository
  2. after updating the p2 composite update site (phase verify) we commit the changes to the remote repository
  3. That’s all :)

Let’s try it

Of course, if you want to try it, you need a project on sourceforge and a directory on that project’s Files section (and you’ll have to change the URLs accordingly in the pom file).

To perform a release we need to call the build enabling the profile release-composite, and specify at least verify as goal:

mvn clean verify -Prelease-composite

Let’s say we still haven’t released anything.

Since the remote directory is empty, in our local file system we’ll simply have the directory created. In the end of the build, the composite site is created and the remote directory will be synchronized with our local contents:

[INFO] --- maven-antrun-plugin:1.7:run (update-local-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-update:
     [echo] Rsync source:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [echo] Rsync destination:
     [echo] /home/bettini/p2.repositories/updates/
     [exec] receiving incremental file list
     [exec] created directory /home/bettini/p2.repositories/updates
     [exec] ./
     [exec] 
     [exec] sent 35 bytes  received 54 bytes  11.87 bytes/sec
     [exec] total size is 0  speedup is 0.00
[INFO] Executed tasks
[INFO] 
[INFO] --- target-platform-configuration:0.22.0:target-platform (default-target-platform) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-categories (default-publish-categories) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:attach-artifacts (default-attach-artifacts) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:assemble-repository (default-assemble-repository) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:archive-repository (default-archive-repository) @ p2composite.example.site ---
[INFO] Building zip: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/p2composite.example.site-1.0.0-SNAPSHOT.zip
[INFO] 
[INFO] --- tycho-source-feature-plugin:0.22.0:source-feature (source-feature) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-plugin:0.22.0:p2-metadata (attach-p2-metadata) @ p2composite.example.site ---
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (copy-to-root-target) @ p2composite.example.site ---
[INFO] Executing tasks

main:
     [echo] 
     [echo] Repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Built version: 1.0.0.v20150121-1828
     [echo] 
     [copy] Copying 6 files to /home/bettini/work/eclipse/p2composite/p2composite-example/target/repository
[INFO] Executed tasks
[INFO] 
[INFO] --- tycho-eclipserun-plugin:0.22.0:eclipse-run (add-p2-composite-repository) @ p2composite.example.site ---
[INFO] Expected eclipse log file: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/data/.metadata/.log
[INFO] Command line:
	[/usr/lib/jvm/java-7-oracle/jre/bin/java, -jar, /media/app/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20140415-2008/org.eclipse.equinox.launcher-1.3.0.v20140415-2008.jar, -install, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work, -configuration, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/configuration, -application, org.eclipse.ant.core.antRunner, -buildfile, packaging-p2composite.ant, p2.composite.add, -Dsite.label=Composite Site Example, -Dproject.build.directory=/home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target, -DunqualifiedVersion=1.0.0, -DbuildQualifier=v20150121-1828]
Buildfile: packaging-p2composite.ant

getMajorMinorVersion:

compute.child.repository.data:

p2.composite.add:
     [echo]  
     [echo] Source repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Copying to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1828/...
    [mkdir] Created dir: /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1828
     [copy] Copying 6 files to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1828
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates/1.0
     [echo] Composite name             : Composite Site Example 1.0
     [echo] Adding child repository    : 1.0.0.v20150121-1828
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates
     [echo] Composite name             : Composite Site Example All Versions
     [echo] Adding child repository    : 1.0
BUILD SUCCESSFUL

BUILD SUCCESSFUL
Total time: 0 seconds
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (deploy-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-commit:
     [echo] Rsync source:
     [echo] /home/bettini/p2.repositories/updates/
     [echo] Rsync destination:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [exec] sending incremental file list
     [exec] ./
     [exec] compositeArtifacts.xml
     [exec] compositeContent.xml
     [exec] p2.index
     [exec] 1.0/
     [exec] 1.0/compositeArtifacts.xml
     [exec] 1.0/compositeContent.xml
     [exec] 1.0/p2.index
     [exec] 1.0/1.0.0.v20150121-1828/
     [exec] 1.0/1.0.0.v20150121-1828/artifacts.jar
     [exec] 1.0/1.0.0.v20150121-1828/content.jar
     [exec] 1.0/1.0.0.v20150121-1828/features/
     [exec] 1.0/1.0.0.v20150121-1828/features/p2composite.example.feature.source_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/features/p2composite.example.feature_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/plugins/
     [exec] 1.0/1.0.0.v20150121-1828/plugins/p2composite.example.plugin.source_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/plugins/p2composite.example.plugin_1.0.0.v20150121-1828.jar
     [exec] 
     [exec] sent 13,086 bytes  received 271 bytes  1,406.00 bytes/sec
     [exec] total size is 17,310  speedup is 1.30
[INFO] Executed tasks

Let’s have a look at the remote directory, it will contain the create p2 composite site

sourceforge uploaded artifacts 1

sourceforge uploaded artifacts 2

Let’s perform another release; Our local copy is up-to-date so we won’t receive anything during the update phase, but then we’ll commit another release

[INFO] --- maven-antrun-plugin:1.7:run (update-local-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-update:
     [echo] Rsync source:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [echo] Rsync destination:
     [echo] /home/bettini/p2.repositories/updates/
     [exec] receiving incremental file list
     [exec] 
     [exec] sent 32 bytes  received 720 bytes  88.47 bytes/sec
     [exec] total size is 17,310  speedup is 23.02
[INFO] Executed tasks
[INFO] 
[INFO] --- target-platform-configuration:0.22.0:target-platform (default-target-platform) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-categories (default-publish-categories) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:attach-artifacts (default-attach-artifacts) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:assemble-repository (default-assemble-repository) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:archive-repository (default-archive-repository) @ p2composite.example.site ---
[INFO] Building zip: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/p2composite.example.site-1.0.0-SNAPSHOT.zip
[INFO] 
[INFO] --- tycho-source-feature-plugin:0.22.0:source-feature (source-feature) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-plugin:0.22.0:p2-metadata (attach-p2-metadata) @ p2composite.example.site ---
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (copy-to-root-target) @ p2composite.example.site ---
[INFO] Executing tasks

main:
     [echo] 
     [echo] Repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Built version: 1.0.0.v20150121-1832
     [echo] 
     [copy] Copying 6 files to /home/bettini/work/eclipse/p2composite/p2composite-example/target/repository
[INFO] Executed tasks
[INFO] 
[INFO] --- tycho-eclipserun-plugin:0.22.0:eclipse-run (add-p2-composite-repository) @ p2composite.example.site ---
[INFO] Expected eclipse log file: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/data/.metadata/.log
[INFO] Command line:
	[/usr/lib/jvm/java-7-oracle/jre/bin/java, -jar, /media/app/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20140415-2008/org.eclipse.equinox.launcher-1.3.0.v20140415-2008.jar, -install, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work, -configuration, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/configuration, -application, org.eclipse.ant.core.antRunner, -buildfile, packaging-p2composite.ant, p2.composite.add, -Dsite.label=Composite Site Example, -Dproject.build.directory=/home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target, -DunqualifiedVersion=1.0.0, -DbuildQualifier=v20150121-1832]
Buildfile: packaging-p2composite.ant

getMajorMinorVersion:

compute.child.repository.data:

p2.composite.add:
     [echo]  
     [echo] Source repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Copying to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1832/...
    [mkdir] Created dir: /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1832
     [copy] Copying 6 files to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1832
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates/1.0
     [echo] Composite name             : Composite Site Example 1.0
     [echo] Adding child repository    : 1.0.0.v20150121-1832
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates
     [echo] Composite name             : Composite Site Example All Versions
     [echo] Adding child repository    : 1.0
BUILD SUCCESSFUL

BUILD SUCCESSFUL
Total time: 0 seconds
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (deploy-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-commit:
     [echo] Rsync source:
     [echo] /home/bettini/p2.repositories/updates/
     [echo] Rsync destination:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [exec] sending incremental file list
     [exec] ./
     [exec] 1.0/
     [exec] 1.0/compositeArtifacts.xml
     [exec] 1.0/compositeContent.xml
     [exec] 1.0/1.0.0.v20150121-1828/
     [exec] 1.0/1.0.0.v20150121-1828/features/
     [exec] 1.0/1.0.0.v20150121-1828/plugins/
     [exec] 1.0/1.0.0.v20150121-1832/
     [exec] 1.0/1.0.0.v20150121-1832/artifacts.jar
     [exec] 1.0/1.0.0.v20150121-1832/content.jar
     [exec] 1.0/1.0.0.v20150121-1832/features/
     [exec] 1.0/1.0.0.v20150121-1832/features/p2composite.example.feature.source_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/features/p2composite.example.feature_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/plugins/
     [exec] 1.0/1.0.0.v20150121-1832/plugins/p2composite.example.plugin.source_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/plugins/p2composite.example.plugin_1.0.0.v20150121-1832.jar
     [exec] 
     [exec] sent 12,800 bytes  received 245 bytes  1,373.16 bytes/sec
     [exec] total size is 32,526  speedup is 2.49
[INFO] Executed tasks

Let’s have a look at sourceforge and see the new release

sourceforge uploaded artifacts 3

Let’s remove our local copy and try to perform another release, this time the update phase will make sure our local composite repository is synchronized with the remote site (we’ll get the whole composite site we had already released), so that when we add another composite child we’ll update our local composite repository; then we’ll commit the changes to the server (again, by uploading only the modified files, i.e., the compositeArtifacts.xml and compositeContent.xml and the new directory with the new child repository:

[INFO] --- maven-antrun-plugin:1.7:run (update-local-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-update:
     [echo] Rsync source:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [echo] Rsync destination:
     [echo] /home/bettini/p2.repositories/updates/
     [exec] receiving incremental file list
     [exec] ./
     [exec] compositeArtifacts.xml
     [exec] compositeContent.xml
     [exec] p2.index
     [exec] 1.0/
     [exec] 1.0/compositeArtifacts.xml
     [exec] 1.0/compositeContent.xml
     [exec] 1.0/p2.index
     [exec] 1.0/1.0.0.v20150121-1828/
     [exec] 1.0/1.0.0.v20150121-1828/artifacts.jar
     [exec] 1.0/1.0.0.v20150121-1828/content.jar
     [exec] 1.0/1.0.0.v20150121-1828/features/
     [exec] 1.0/1.0.0.v20150121-1828/features/p2composite.example.feature.source_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/features/p2composite.example.feature_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/plugins/
     [exec] 1.0/1.0.0.v20150121-1828/plugins/p2composite.example.plugin.source_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1828/plugins/p2composite.example.plugin_1.0.0.v20150121-1828.jar
     [exec] 1.0/1.0.0.v20150121-1832/
     [exec] 1.0/1.0.0.v20150121-1832/artifacts.jar
     [exec] 1.0/1.0.0.v20150121-1832/content.jar
     [exec] 1.0/1.0.0.v20150121-1832/features/
     [exec] 1.0/1.0.0.v20150121-1832/features/p2composite.example.feature.source_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/features/p2composite.example.feature_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/plugins/
     [exec] 1.0/1.0.0.v20150121-1832/plugins/p2composite.example.plugin.source_1.0.0.v20150121-1832.jar
     [exec] 1.0/1.0.0.v20150121-1832/plugins/p2composite.example.plugin_1.0.0.v20150121-1832.jar
     [exec] 
     [exec] sent 417 bytes  received 24,162 bytes  2,891.65 bytes/sec
     [exec] total size is 32,526  speedup is 1.32
[INFO] Executed tasks
[INFO] 
[INFO] --- target-platform-configuration:0.22.0:target-platform (default-target-platform) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-products (default-publish-products) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:publish-categories (default-publish-categories) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-publisher-plugin:0.22.0:attach-artifacts (default-attach-artifacts) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:assemble-repository (default-assemble-repository) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-repository-plugin:0.22.0:archive-repository (default-archive-repository) @ p2composite.example.site ---
[INFO] Building zip: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/p2composite.example.site-1.0.0-SNAPSHOT.zip
[INFO] 
[INFO] --- tycho-source-feature-plugin:0.22.0:source-feature (source-feature) @ p2composite.example.site ---
[INFO] 
[INFO] --- tycho-p2-plugin:0.22.0:p2-metadata (attach-p2-metadata) @ p2composite.example.site ---
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (copy-to-root-target) @ p2composite.example.site ---
[INFO] Executing tasks

main:
     [echo] 
     [echo] Repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Built version: 1.0.0.v20150121-1837
     [echo] 
     [copy] Copying 6 files to /home/bettini/work/eclipse/p2composite/p2composite-example/target/repository
[INFO] Executed tasks
[INFO] 
[INFO] --- tycho-eclipserun-plugin:0.22.0:eclipse-run (add-p2-composite-repository) @ p2composite.example.site ---
[INFO] Expected eclipse log file: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/data/.metadata/.log
[INFO] Command line:
	[/usr/lib/jvm/java-7-oracle/jre/bin/java, -jar, /media/app/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.3.0.v20140415-2008/org.eclipse.equinox.launcher-1.3.0.v20140415-2008.jar, -install, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work, -configuration, /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/eclipserun-work/configuration, -application, org.eclipse.ant.core.antRunner, -buildfile, packaging-p2composite.ant, p2.composite.add, -Dsite.label=Composite Site Example, -Dproject.build.directory=/home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target, -DunqualifiedVersion=1.0.0, -DbuildQualifier=v20150121-1837]
Buildfile: packaging-p2composite.ant

getMajorMinorVersion:

compute.child.repository.data:

p2.composite.add:
     [echo]  
     [echo] Source repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Copying to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1837/...
    [mkdir] Created dir: /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1837
     [copy] Copying 6 files to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150121-1837
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates/1.0
     [echo] Composite name             : Composite Site Example 1.0
     [echo] Adding child repository    : 1.0.0.v20150121-1837
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates
     [echo] Composite name             : Composite Site Example All Versions
     [echo] Adding child repository    : 1.0
BUILD SUCCESSFUL

BUILD SUCCESSFUL
Total time: 1 second
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (deploy-repository) @ p2composite.example.site ---
[INFO] Executing tasks

main:

rsync-commit:
     [echo] Rsync source:
     [echo] /home/bettini/p2.repositories/updates/
     [echo] Rsync destination:
     [echo] lbettini,eclipseexamples@frs.sourceforge.net:/home/frs/project/eclipseexamples/p2composite.example/updates/
     [exec] sending incremental file list
     [exec] ./
     [exec] 1.0/
     [exec] 1.0/compositeArtifacts.xml
     [exec] 1.0/compositeContent.xml
     [exec] 1.0/1.0.0.v20150121-1828/
     [exec] 1.0/1.0.0.v20150121-1828/features/
     [exec] 1.0/1.0.0.v20150121-1828/plugins/
     [exec] 1.0/1.0.0.v20150121-1832/
     [exec] 1.0/1.0.0.v20150121-1832/features/
     [exec] 1.0/1.0.0.v20150121-1832/plugins/
     [exec] 1.0/1.0.0.v20150121-1837/
     [exec] 1.0/1.0.0.v20150121-1837/artifacts.jar
     [exec] 1.0/1.0.0.v20150121-1837/content.jar
     [exec] 1.0/1.0.0.v20150121-1837/features/
     [exec] 1.0/1.0.0.v20150121-1837/features/p2composite.example.feature.source_1.0.0.v20150121-1837.jar
     [exec] 1.0/1.0.0.v20150121-1837/features/p2composite.example.feature_1.0.0.v20150121-1837.jar
     [exec] 1.0/1.0.0.v20150121-1837/plugins/
     [exec] 1.0/1.0.0.v20150121-1837/plugins/p2composite.example.plugin.source_1.0.0.v20150121-1837.jar
     [exec] 1.0/1.0.0.v20150121-1837/plugins/p2composite.example.plugin_1.0.0.v20150121-1837.jar
     [exec] 
     [exec] sent 13,217 bytes  received 275 bytes  1,420.21 bytes/sec
     [exec] total size is 47,739  speedup is 3.54
[INFO] Executed tasks

Again, the remote site is correctly updated

sourceforge uploaded artifacts 4

Providing the URL of your p2 repository

Now that you have your p2 repository on sourceforge, you only need to give your users the URL to use for installing your features in Eclipse.

You have two forms for the URL

  • This will use the mirror infrastructure of sourceforge: http://sourceforge.net/projects/<project>/files/<path>
  • This will bypass mirrors: http://master.dl.sourceforge.net/project/<project>/<path>

If you use the mirror form, when installing in Eclipse (or provisioning a target platform) you’ll see warnings on the console of the shape

WARNING: Invalid cookie header: "Set-Cookie: VISITOR=54c382b9c3d3bc3420ac8ac2; expires="Tue, 21-Jan-2025 11:32:09 GMT"; httponly; Max-Age=315360000; Path=/". Unable to parse expires attribute: "Tue, 21-Jan-2025 11:32:09 GMT"
Jan 24, 2015 12:32:10 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: VISITOR=54c382b9c3d3bc3420ac8ac2; expires="Tue, 21-Jan-2025 11:32:08 GMT"; httponly; Max-Age=315360000; Path=/". Unable to parse expires attribute: "Tue, 21-Jan-2025 11:32:08 GMT"
Jan 24, 2015 12:32:10 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: sf_mirror_attempt="eclipseexamples:netcologne:p2composite.example/updates/1.0/1.0.0.v20150121-1837/content.jar"; expires=120; Path=/". Unable to parse expires attribute: 120

But it’s safe to ignore them.

For our example the URL can be one of the following:

  • With mirrors: http://sourceforge.net/projects/eclipseexamples/files/p2composite.example/updates/
  • Main site: http://master.dl.sourceforge.net/project/eclipseexamples/p2composite.example/updates/

You may want to try them both in Eclipse.

Please keep in mind that you may hit some unavailability errors now and then, if sourceforge sites are down for maintenance or unreachable for any reason… but that’s not much different when you hit a bad Eclipse mirror, or the main Eclipse download site is down… I guess no hosting site is perfect anyway ;)

I hope you find this blog post useful, Happy releasing! :)

 

Be Sociable, Share!

by Lorenzo Bettini at January 24, 2015 11:51 AM

e(fx)clipse 1.2.0 – Themes are OSGi services

by Tom Schindl at January 23, 2015 11:18 PM

e(fx)clipse 1.2.0 is trying to get a better OSGi citizen and so we try to remove more and more Equinox/Eclipse specific stuff which means that we want to get rid of the Extension Registry in our/your code.

In 1.1.0 themes have been defined using the theme extension point org.eclipse.fx.ui.theme where you’ve been able to:

  • Define a theme
  • Contribute Stylesheets to themes

In 1.2.0 we deprecated the extension point in favor of making Themes and Stylesheets OSGi-Services you e.g. contribute through declarative services.

There are 2 main advantages:

  • We get dynamics for free so themes and stylesheets can be installed/updated/uninstalled in a running application
  • You have much more control over contributing a Stylesheet e.g. whether it applies to a given theme

A disadvantage if you want to find one is that it is a bit more work to define the theme and looks like this

<?xml version="1.0" encoding"UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.code.compensator.app.default-theme">
  <implementation 
    class="org.eclipse.fx.code.compensator.app.DefaultTheme"/>
   <service>
      <provide 
       interface="org.eclipse.fx.ui.services.theme.Theme"/>
   </service>
   <reference 
     bind="registerStylesheet" 
     cardinality="0..n" 
     interface="org.eclipse.fx.ui.services.theme.Stylesheet" 
     name="Stylesheet" 
     policy="dynamic" unbind="unregisterStylesheet"/>
</scr:component>
package org.eclipse.fx.code.compensator.app;

import org.eclipse.fx.ui.services.theme.Theme;
import org.eclipse.fx.ui.theme.AbstractTheme;
import org.osgi.service.component.annotations.Component;

public class DefaultTheme extends AbstractTheme {
  public DefaultTheme() {
    super("default", "Default Theme", 
      DefaultTheme.class.getClassLoader().getResource("css/default.css"));
  }
}


by Tom Schindl at January 23, 2015 11:18 PM

Hip Hip Hurray - Eclipse Demo Camp 2015 - Winter Edition @ Bangalore

by Its_Me_Malai (noreply@blogger.com) at January 23, 2015 12:25 PM

Eclipse Demo Camp 2015 - Winter Edition was awesomely organised @ Cerner Corporation, Bangalore. 22nd Jan 2015 @ 3.00pm with a half hall, Prasanna walked up and said time to start and keynote address started by Sumit Rao, Cerner. Thanks to him, he was a motivational speaker and also offered the Cerner Hall for all the Eclipse Events here on. Kudos to the man, coz i know the difficulty of finding a hall to organise such events.

Followed by that was my screwed up talk where my laptop decided not to listen to me and interrupted me from showing any demo. But definitely did talk and managed to complete the talk on time, which generally i am bad at, KEEPING TIME. Few people did turn up after the talk to enquire how to fork our repositories. :)



Then we had a series of talk by the IBM Folks Noopur, Vikas, Sravan. Our all time favourite speakers. They did a good job in telling us about their work @ IBM as part of the Eclipse Platform Team. But next time i have decided to put a constraint on these speakers that they cannot repeat topics :p And to definitely add Noopur has really taken up the Eclipse Ecosystem building activity seriously and I really am happy to see people like Prasanna and Noopur taking the lead on. At the end of the event now a days we need to wait to see who is going to commit the next event will it be Prasanna and Noopur. IBM folks started to talk about Eclipse Day 2015 Edition and suddenly the idea moved to Hackathon instead of an Eclipse Day 2015 and Prasanna was all exicted and ready to offer the space immediately. What enthusiasm ?? I missed this for long years and good to see that happening now.

Then for a change it was good to have new speakers from BOSCH. Good Job guys. Subbu was there, this time i managed to pull in Karthikeyan to present along with me. I hope we did motivate lot of people to get few new faces as speakers instead of we pulling people from the crowd to talk.

Then Cerner, the organisers did a line up of talks without which the show wouldnt hav been complete. They did take the courage to show their UI Screenshots which a lot of corporates wouldnt do when we are talking about proprietary softwares. And to add to the cream, i was surprised to find so many architects of Cerner in the hall listening to young chaps with a calm head and a smiley face. I definitely do people that Cerner is a truly growing open minded eclipse company.

I am waiting to see that addiction spread to other companies and lot of companies decide to do what Cerner and IBM has started to do. It was good to meet a lot of people again as usual at this event Saurav from SAP was there, Sadiq, Vyas from MBRDI, Chapmaka Ramachandran from Veriqwest [Qualcomm], Karthik from FIS to name a few.

And now a days Intalio team is around in all the CAMPs Subbu, Amrutha, Rahul :)

To end it all i would like to thank Prasanna and his team for having organised such a wonderful evening with lots of knowledge share and networking ... I did love that.

I am now eagerly waiting for someone to announce the Hackathon :) Happy Eclipsing until then.

by Its_Me_Malai (noreply@blogger.com) at January 23, 2015 12:25 PM

XtextDay and EclipseCon San Francisco 2015

by Sven Efftinge (noreply@blogger.com) at January 23, 2015 12:01 PM

In case you've missed it, we are organizing a so called XtextDay co-located with EclipseCon 2015. The program is already online for a couple of weeks:

Sebastian and I will start the day talking about the newest developments (e.g. Intellij IDEA support, web editor support, incremental standalone builders, etc.). After that we will hear how Xtext languages are used to design REST APIs. In the afternoon we have in-depth sessions on Xbase, performance and scoping, and after the coffee break we will learn how a silicon valley company use Xtext to build a commercial product for designing systems on a chip (IoT). The full program details can be found here. But that's not all..

Additional Xtext content at EclipseCon

Although it's possible to register only for the XtextDay, I recommend to book the whole EclipseCon conference as it is not only an awesome community event where you will find many new friends, but in addition to the XtextDay, there is some Xtext-related content there as well. It starts with a beginner's tutorial on Monday, which is a good preparation for the technically deeper talks following. In addition to the XtextDay and the tutorial we have:

So quite some content in addition to XtextDay. If you consider using Xtext for something or you are already using it, then you should definitely come and join the sessions, discussions and party! :-)


by Sven Efftinge (noreply@blogger.com) at January 23, 2015 12:01 PM

Cloud Workshop

by Eclipse Foundation at January 22, 2015 07:38 AM

There are a number of efforts underway around Cloud in the OSGi Enterprise Expert Group, such as the Cloud Ecosystems RFC, REST management, Distributed Eventing and others. In the upcoming Cloud Workshop we'd like to get input from interested attendees, check whether we took previous suggestions on board the right way and see if we can do some brainstorming on how to best address today's cloud needs given that the cloud industry has moved on in general, so people's problems will have changed too. The session will start with a short presentation outlining where the current OSGi cloud work is, after which people attending are invited to talk about their cloud issues and how they see OSGi could help them. Ideas are gathered during the workshop, discussed and ultimately used as input in the OSGi specification process. Presenter: David Bosschaert, Raymond Auge [Liferay, Inc.]

by Eclipse Foundation at January 22, 2015 07:38 AM

Build bundles in the cloud - How Cloudyle PaaS+ helps creating OSGi applications in the cloud

by Eclipse Foundation at January 22, 2015 07:35 AM

Platform as a service (PaaS) provides a ready to use development or deployment environment and lets a developer quickly start coding instead of wasting time for setup and configuration. The PaaS manages the underlying O/S, provides database installations, language runtimes and application frameworks almost instantly. The developer can immediately focus on the data model and application logic, and therefore deliver a solution to the market in less time. This talks gives an introduction to our open PaaS+ Cloud Platform for modular OSGi applications based on OpenShift [1]. PaaS+ is a modular and scalable Java PaaS that features a modular build and deployment mechanism and helps to speed up application development while also making it more robust. We will show how PaaS+ supports OSGi application developers in the complete application lifecycle from development to production to achieve a faster time to market. Because the PaaS environment used in development, testing and production is the same, there is less overhead or problems staging the application from development to QA to productive deployment. The platform comes with a build in Apache Karaf server runtime enhanced by OSGi enabled base services such as Authentication, Rules Engine, Business Process Engine, Polyglot Persistence, Search and Indexing and an integrated OBR. These services are available through a consistent API and are orchestrated by the integrated OSGi framework. The OSGi PaaS+ platform is based on research results from the TRESOR - Trusted Ecosystem for Standardized and Open cloud-based Resources – project to provide an open ecosystem for cloud applications for the health care sector [2]. TRESOR is part of the Trusted Cloud initiative [3], funded by the German Federal Ministry of Economics and Technology. Topics covered: Benefits of Cloud and Platform as a Service Overview of the OSGi PaaS+ Cloud Benefits of OSGi for modular cloud platforms Cloud deployment and distributed services PaaS+ Enterprise API Presenter: Alexander Grzesik [Cloudyle GmbH], Torsten Frank [Cloudyle GmbH]

by Eclipse Foundation at January 22, 2015 07:35 AM

Look Inside Your OSGi Bundles and Build them Block by Block

by Eclipse Foundation at January 22, 2015 07:32 AM

OSGi provides the infrastructure to build applications from components and services, provided as bundles. But how can we work equally structured also within bundles? We show how to build OSGi bundles with Reactive Blocks, by plugging together building blocks. This makes it easy to handle concurrency, reuse behavior and find intricate concurrency errors automatically. Let’s have a look at a typical OSGi application, for instance one that runs on a residential gateway. It needs to coordinate behavior of several other bundles, listen to incoming messages, respond in time, handle remote configuration changes and react on its own bundle life cycle. Also, the bundle should react properly when the network goes down or when required services get unavailable. When so much happens in parallel, it get’s complicated. Concurrent programming is still a delicate art form. Code with lots of concurrency is hard to write and debug (race conditions, anyone?). The code is also hard to understand for any other developer that inherits it. Reactive Blocks is a tool integrated with the Java tools in Eclipse. With it, Java code is organized in the form of building blocks, which can be plugged together using graphical data flows. The data flows make it easy to handle concurrency and synchronize behavior. But Reactive Blocks does not try to replace Java programming. Graphics and code work together. The data flows simply describe when Java operations are called. Libraries of building blocks provide functions that are often used. As an example, libraries for OSGi provide building blocks to listen to other services and OSGi events. It's also possible to make new building blocks. Applications are constructed by connecting building blocks. An automatic analysis checks the behavior of the application. You can detect, for instance, that a bundle contains logic that drives it into a deadlock instead of nicely shutting down. The structure with building blocks makes it easier to keep the overview of an application, even if it is highly concurrent and complicated. Suddenly you can look inside your OSGi application bundle! Frank Alexander Kraemer [Bitreactive AS]

by Eclipse Foundation at January 22, 2015 07:32 AM

Reminder: Releng 2015 submissions due Friday, January 23

by Kim Moir (noreply@blogger.com) at January 21, 2015 08:36 PM

Just a reminder that submissions for the Releng 2015 conference are due this Friday, January 23. 

It will be held on May 19, 2015 in Florence Italy.

If you've done recent work like
  • migrating your build or test pipeline to the cloud
  • switching to a new build system
  • migrating to a new version control system
  • optimized your configuration management system or switched to a new one
  • implemented continuous integration for mobile devices
  • reduced end to end build times
  • or anything else build, release, configuration and test related
we'd love to hear from you.  Please consider submitting a talk!

In addition, if you have colleagues that work in this space that might have interesting topics to discuss at this workshop, please forward this information. I'm happy to talk to people about the submission process or possible topics if there are questions.

Il Duomo di Firenze by ©eddi_07, Creative Commons by-nc-sa 2.0


Sono nel comitato che organizza la conferenza Releng 2015 che si terrà il 19 Maggio 2015 a Firenze. La scadenza per l’invio dei paper è il 23 Gennaio 2015.

http://releng.polymtl.ca/RELENG2015/html/index.html

se avete competenze in:
  • migrazione del sistema di build o dei test nel cloud
  • aggiornamento del processo di build
  • migrazione ad un nuovo sistema di version control
  • ottimizzazione o aggiornamento del configuration management system
  • implementazione di un sistema di continuos integration per dispositivi mobili
  • riduzione dei tempi di build
  • qualsiasi cambiamento che abbia migliorato il sistema di build/test/release
e volete discutere della vostra esperienza, inviateci una proposta di talk!

Per favore inoltrate questa richiesta ai vostri colleghi e alle persone interessate a questi argomenti. Nel caso ci fossero domande sul processo di invio o sui temi di discussione, non esitate a contattarmi.

(Thanks Massimo for helping with the Italian translation).

More information
Releng 2015 web page
Releng 2015 CFP now open


by Kim Moir (noreply@blogger.com) at January 21, 2015 08:36 PM

Security and bugfix release for Luna

by akazakov at January 21, 2015 11:06 AM

A new maintenance update of JBoss Tools 4.2.2 and Red Hat JBoss Developer Studio 8.0.2 for Eclipse Luna has been released.

It is recommended everyone, especially those using git install this update!

jbosstools jbdevstudio blog header

Installation

JBoss Developer Studio 8.0.2

This is an updatesite-only update. If you have JBoss Tools 4.2.x or JBoss Developer Studio 8.0.x already installed, just run:

Help > Check for updates

JBoss Tools 4.2.2 and JBoss Developer Studio Bring-Your-Own-Eclipse (BYOE)

JBoss Tools and JBoss Developer Studio Bring-Your-Own-Eclipse (BYOE) require at least Eclipse 4.4 (Luna) but we recommend using the Eclipse Luna SR1a Java EE Bundle since then you get most of the dependencies preinstalled. Once you have installed Eclipse, you can find us on Eclipse Marketplace under "JBoss Tools (Luna)" or "JBoss Developer Studio (Luna)".

For JBoss Tools you can also use our update site directly if you are up for it.

http://download.jboss.org/jbosstools/updates/stable/luna/

What is new ?

This is a JBoss Developer Studio/JBoss Tools maintenance update for Eclipse Luna with critical security and performance bug fixes.

Eclipse Luna SR1a Git Security Release

JBoss Developer Studio 8.0.2 includes Eclipse Luna SR1a Git Security Release which has a fix for a serious security vulnerability in JGit client. You can read more here.

JBoss Central Software page performance fixes

JBoss Central software page had a performance regression that caused the page to take several pages to load where it should only be a few miliseconds. That is fixed.

And we fixed it so Early Access features (like integration stack) can now contribute wizards to central when users have enabled Early access.

Updated Forge 2 Runtime

The included Forge 2 runtime is now 2.13.0.Final. See the release notes here.

What is Next

We are working on the next update witch will be based on Eclipse Luna SR2 and the first milestone (Alpha) for Eclipse Mars is coming soon.

Enjoy!

Alexey Kazakov


by akazakov at January 21, 2015 11:06 AM

Eclipse Community Awards 2015 Voting

January 21, 2015 08:18 AM

The nominations are in and it's time to vote!

January 21, 2015 08:18 AM

Creating p2 composite repositories during the build

by Lorenzo Bettini at January 20, 2015 06:32 PM

I like to build p2 composite repositories for all my Eclipse projects, to keep all the versions available for consumption.

Quoting from https://wiki.eclipse.org/Equinox/p2/Composite_Repositories_(new)

The goal of composite repositories is to make this task easier by allowing you to have a parent repository which refers to multiple children. Users are then able to reference the parent repository and the children’s content will transparently be available to them.

The nice thing of composite repositories is that they can be nested at any level. Thus, I like to have nested composite repositories according to the major.minor, major.minor.service.qualifier.

Thus the layout of the p2 composite repository should be similar to the following screenshot

p2composite1

Note that the name of the directories that contain a standard p2 repository have the same name of the contained feature.

The key points of a p2 composite repository are the two files compositeArtifacts.xml and compositeContent.xml. Their structure is simple, e.g.,

<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Composite Site Example All Versions' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
  <properties size='2'>
    <property name='p2.timestamp' value='1421600341270'/>
    <property name='p2.atomic.composite.loading' value='true'/>
  </properties>
  <children size='3'>
    <child location='1.0'/>
    <child location='1.1'/>
    <child location='2.0'/>
  </children>
</repository>

Note that a child location is intended relative to the path of these files; you can also specify absolute paths, not to mention http urls to other remote p2 sites.

The structure is not that complex, so you can also create it by hand; but keeping it up to date might not be that trivial. With that respect, p2 provides some ant tasks for managing composite repositories (creating, adding an entry, removing an entry), and that’s my favorite way to deal with composite repositories. I’ll detail what I usually do in this blog post, in particular, how to create (or update) a p2 composite repository with a new entry during the build.

The ant file is completely reusable and customizable by passing properties; you can reuse it as it is, after you setup your pom.xml as detailed below.

In this blog post I’ll show how to do that with Maven/Tycho, but the same procedure can be done in a Buckminster build (as I’ll hint at the end).

I’ll use a simple example, https://github.com/LorenzoBettini/p2composite-example, consisting of a plug-in project, a feature project, a project for the site, and a releng project (a Maven/Tycho parent project). The plug-in and feature project are not interesting in this context: the most interesting one is the site project (a Tycho eclipse-repository packaging type).

Of course, in order to run such ant tasks, you must run them using the org.eclipse.ant.core.antRunner application. Buckminster, as an Eclipse product, already contains that application. With Tycho, you can use the tycho-eclipserun-plugin, to run an Eclipse application from Maven.

We use this technique for releasing a new version of our EMF-Parsley Eclipse project. We do that directly from our Hudson HIPP instance; the idea is that the location of the final main composite site is the one that will be served through HTTP from the download.eclipse.org. We have a dedicated Hudson job that will release a new version and put it in the composite repository.

The ant file

The internal details of this ant files are not necessary to reuse it, so you can skip the first part of this section (you only need to know the main properties to pass). Of course, if you read it and you have suggestions for improve it, I’d be very grateful :)

The ant file consists of some targets and macro definitions.

The main macro definition is the one invoking the p2 ant task:

<macrodef name="add.composite.repository.internal">
    <attribute name="composite.repository.location" />
    <attribute name="composite.repository.name" />
    <attribute name="composite.repository.child" />
    <sequential>

        <echo message=" " />
        <echo message="Composite repository       : @{composite.repository.location}" />
        <echo message="Composite name             : @{composite.repository.name}" />
        <echo message="Adding child repository    : @{composite.repository.child}" />

        <p2.composite.repository>
            <repository compressed="false" location="@{composite.repository.location}" name="@{composite.repository.name}" />
            <add>
                <repository location="@{composite.repository.child}" />
            </add>
        </p2.composite.repository>

        <echo file="@{composite.repository.location}/p2.index">version=1
metadata.repository.factory.order=compositeContent.xml,\!
artifact.repository.factory.order=compositeArtifacts.xml,\!
</echo>

    </sequential>
</macrodef>

Note that we’ll also create a p2.index file. I prefer not to compress the compositeArtifacts.xml and compositeContent.xml files for easier inspection or manual modification, but you can compress them setting the “compressed” to “true” property above.

This macro will be called twice in the main task

<target name="p2.composite.add" depends="compute.child.repository.data">
    <property name="source.repository" location="${project.build.directory}/repository"/>

    <echo message=" " />

    <echo message="Source repository path: ${source.repository}" />

    <echo message="Copying to ${child.repository.directory}..." />

    <mkdir dir="${child.repository.directory}"/>
    <copy todir="${child.repository.directory}" overwrite="true">
        <fileset dir="${source.repository}" />
    </copy>

    <add.composite.repository.internal
		composite.repository.location="${composite.repository.directory}"
		composite.repository.name="${site.composite.name}"
		composite.repository.child="${child.repository}"
	/>

    <add.composite.repository.internal
		composite.repository.location="${main.composite.repository.directory}"
		composite.repository.name="${main.site.composite.name}"
		composite.repository.child="${majorMinorVersion}"
	/>

</target>

First of all, this task will copy the p2 repository created during the build in the correct place inside the nested p2 composite repository.

Then, it will create or update the composite site for the nested repository major.minor, and then it will create or update the composite site for the main site (the one storing all the versions). The good thing about these ant tasks is that if you add a child location that already exists they won’t complain (though you can set a property to make them fail in such situations); this is crucial for updating the main repository, since most of the time you will not release a new major.minor.

This target calls (i.e., depends on) another target to compute the properties to pass to the macrodef, according to the information passed from the pom.xml

<!--
	site.label			The name/title/label of the created composite site
	unqualifiedVersion 	The version without any qualifier replacement
	buildQualifier		The build qualifier
-->
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
    <property name="full.version" value="${unqualifiedVersion}.${buildQualifier}" />

    <property name="software.download.area" location="${user.home}/p2.repositories" />
    <property name="updates.dir" value="updates" />

    <property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
    <property name="main.site.composite.name" value="${site.label} All Versions" />

    <property name="main.composite.repository.directory" location="${software.download.area}/${updates.dir}" />

    <property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
    <property name="child.repository" value="${full.version}" />
    <property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
</target>

Default properties (that can be modified by passing a value from the pom.xml file):

  • software.download.area: the absolute path of the parent folder for the composite p2 site (default is “p2.repositories” in your home directory)
  • updates.dir: the relative path of the composite p2 site (default is “updates”); this is relative to software.download.area

Thus, by default, the main p2 composite update site will end in ${user.home}/p2.repositories/updates. As hinted in the beginning, this can be any absolute local file system path; in EMF-Parsley Eclipse, since we release from Hudson, it will be the path served by the Eclipse we server download.eclipse.org. So we specify the two above properties accordingly.

These are the properties that must be passed from the pom.xml file

  • site.label: the main label that will appear in the composite site (and that will be recorded in the “Eclipse available sites”). The final label will be “${site.label} All Versions” for the main site and “${site.label} <major.minor>” for the nested composite sites.
  • project.build.directory: the location of the p2 repository created during the build (usually of the shape <project.id>/target/repository)
  • unqualifiedVersion: the version without qualifier (e.g., 1.1.0)
  • buildQualifier: the replaced qualifier in the built version

Note that except for the first property, the other ones have exactly the same name as the ones in Tycho (and are set by Tycho directly during the build, so we’ll reuse them).

The ant file will use an additional target (not shown here, but you’ll find it in the sources of the example) to extract the major.minor part of the passed version.

Calling the ant task from pom.xml

Now, we only need to execute the above ant task from the pom.xml file of the eclipse-repository project,

ATTENTION: in the following snipped, for the sake of readability, I split the <appArgLine> into several lines, but in your pom.xml it must be exactly in one (long) line.

<plugin>
	<groupId>org.eclipse.tycho.extras</groupId>
	<artifactId>tycho-eclipserun-plugin</artifactId>
	<version>${tycho-version}</version>
	<configuration>
		<!-- IMPORTANT: DO NOT split the arg line -->
		<appArgLine>
		-application org.eclipse.ant.core.antRunner 
		-buildfile packaging-p2composite.ant p2.composite.add 
		-Dsite.label="Composite Site Example" 
		-Dproject.build.directory=${project.build.directory}
		-DunqualifiedVersion=${unqualifiedVersion}
		-DbuildQualifier=${buildQualifier}
		</appArgLine>
		<repositories>
			<repository>
				<id>luna</id>
				<layout>p2</layout>
				<url>http://download.eclipse.org/releases/luna</url>
			</repository>
		</repositories>
		<dependencies>
			<dependency>
				<artifactId>org.eclipse.ant.core</artifactId>
				<type>eclipse-plugin</type>
			</dependency>
			<dependency>
				<artifactId>org.apache.ant</artifactId>
				<type>eclipse-plugin</type>
			</dependency>
			<dependency>
				<artifactId>org.eclipse.equinox.p2.repository.tools</artifactId>
				<type>eclipse-plugin</type>
			</dependency>
			<dependency>
                <artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
                <type>eclipse-feature</type>
            </dependency>
            <dependency>
                <artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
                <type>eclipse-feature</type>
            </dependency>
            <dependency>
                <artifactId>org.eclipse.equinox.ds</artifactId>
                <type>eclipse-plugin</type>
            </dependency>
		</dependencies>
	</configuration>
	<executions>
		<execution>
			<id>add-p2-composite-repository</id>
			<phase>package</phase>
			<goals>
				<goal>eclipse-run</goal>
			</goals>
		</execution>
	</executions>
</plugin>

As I said, you should pass site.label as you see fit (for the other properties you can use the default).

You may want to put this plugin specification inside a Maven profile, that you activate only when you are actually doing a release (see, e.g., what we do in this pom.xml, taken from our EMF-Parsley Eclipse project).

Try the example

Let’s simulate some releases:

To see what you get, just clone the repository found here https://github.com/LorenzoBettini/p2composite-example, cd to p2composite.example.tycho and run

mvn clean verify

After Maven finished downloading all the dependencies you should see something like

2.composite.add:
     [echo]  
     [echo] Source repository path: /home/bettini/work/eclipse/p2composite/p2composite-example/p2composite.example.site/target/repository
     [echo] Copying to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150118-1820/...
    [mkdir] Created dir: /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150118-1820
     [copy] Copying 6 files to /home/bettini/p2.repositories/updates/1.0/1.0.0.v20150118-1820
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates/1.0
     [echo] Composite name             : Composite Site Example 1.0
     [echo] Adding child repository    : 1.0.0.v20150118-1820
     [echo]  
     [echo] Composite repository       : /home/bettini/p2.repositories/updates
     [echo] Composite name             : Composite Site Example All Versions
     [echo] Adding child repository    : 1.0
BUILD SUCCESSFUL

And here’s the directory layout of your ${user.home}/p2.repositories

p2composite2Run the command again, and you’ll get another child in the nested composite repository 1.0 (the qualifier has been replaced automatically with the new timestamp):

p2composite3Let’s increase the service number, i.e., 1.0.1, (using the tycho-versions-plugin) and rebuild:

mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=1.0.1-SNAPSHOT
mvn clean verify

and the new child will still be in 1.0 folder:

p2composite4Let’s increase the minor number, i.e., 1.1.0 and rebuild

mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=1.1.0-SNAPSHOT
mvn clean verify

and you’ll get another major.minor child repository

p2composite5Let’s increase the major number, i.e., 2.0.0

mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=2.0.0-SNAPSHOT
mvn clean verify

and you’ll get another major.minorp2composite6and so on :)

With Buckminster

As I hinted before, with Buckminster you can directly call the p2 ant tasks, since they are included in the Buckminster headless product. You will only need to add custom actions in the .cspec (or in the .cspex if you’re inside a plugin or feature project) that call the ant task passing the right properties. An example can be found here. This refers to a slightly different ant file from the one shown in this blog post, but the idea is still the same.

Possible Improvements

You may want to add another nesting level, e.g., major -> major.minor etc… This should be straightforward: you just need to call the macrodef another time, and compute the main update site directory differently.

Hope this helps.

 

 

Be Sociable, Share!

by Lorenzo Bettini at January 20, 2015 06:32 PM