e(fx)clipse 1.2.0 – Helper API to call methods who throw exceptions

by Tom Schindl at January 29, 2015 09:14 PM

Have you ever worked with a library who throws an exceptions but there’s not possible recovery for you and you simply want to move on with a default value or null?

I’ve had the “fun” to work with something like this lately and all the exception handling cluttered my code. I’m using the IMarker-API as an example

private Annotation transform(IMarker m) {
   String type;
   try {
      type = marker.getType();
   } catch(CoreException e) {
      type = "Unknown";
   }
   
   return new Annotation(type,....);
}

In the ideal case IMarker would have similar as it has for getAttribute() a method who allows to define a default instead of throwing the exception but apparently this not the case and could only be fixed when adopting Java8.

So I’ve add a set of helper methods to deal with APIs who throw exceptions and now I can write:

import static org.eclipse.fx.core.function.ExExecutor.*;

private Annotation transform(IMarker m) {
  return new Annotation(
    executeSupplierOrDefault(m::getType, e -> "Unknown"), .....);
}


by Tom Schindl at January 29, 2015 09:14 PM

Java 8 tooling in Eclipse

by Noopur Gupta at January 29, 2015 03:07 PM

A short demo on how to get started with Java 8 in Eclipse presented at Eclipse Demo Camp Bangalore, January 2015.



by Noopur Gupta at January 29, 2015 03:07 PM

Auto-GWT - Boilerplate Free GWT Programming

by Sven Efftinge (noreply@blogger.com) at January 29, 2015 02:14 PM

Maybe not especially new for everybody, but: GWT is NOT dead!

I've been at the GWT.create conference yesterday, a two-day conference on GWT only that took place in San Jose last week and this week in Munich. With over 400 attendees it was sold out. If that is not enough evidence of the liveliness of the project, you may have missed that Google runs huge projects on GWT. The latest one is Google Inbox. Add all the nice improvements (like increased compile speed) the latest releases have to offer and you will conclude that GWT is the best way to write browser apps in Java or any JVM language. The generated JavaScript code is highly optimized and runs even much faster than typical hand-written JavaScript code.

I had the pleasure to present the new Auto-GWT library we have built for GWT together with my colleague Anton. Thanks to all the attendees for the great questions and the overwhelmingly positive feedback. As a kind of wrap up after the conference I have uploaded the slides, the demo and the Auto-GWT project.

You can find all necessary information on the project's website : auto-gwt.org
Forks and pull requests are very welcome!

Auto-GWT in action:

Slides from GWT.create:


by Sven Efftinge (noreply@blogger.com) at January 29, 2015 02:14 PM

OpenSource Week in the Alps

by Maximilian Koegel at January 29, 2015 11:33 AM

Developing, enhancing and using open source frameworks is daily business for us. We create a lot of open source software as committers and contributors for projects at Eclipse.org (e.g. EMF Forms) and for other open source projects (e.g. qb). Our business is to make open source work for our customers.

Although we spend a lot of time on open source in our daily work, we believe it is important for innovation to make room for an extended period of time to take a step back, collect new ideas and try new things.

Once a year we retreat for an open source week from all daily work including customer work and fully focus on defined topics in our open source projects. We will have dedicated blog posts for the results this year to share with you what we have achieved.

This blog post is just a teaser and is also meant to make you a bit jealous about the great location on top of a mountain we are having the OS week at this year icon wink OpenSource Week in the Alps

P1050721 s OpenSource Week in the Alps

P1050742 s1 OpenSource Week in the Alps 


TwitterGoogle+LinkedInFacebook

Leave a Comment. Tagged with eclipse, emf, eclipse, emf


by Maximilian Koegel at January 29, 2015 11:33 AM

e(fx)clipse 1.2.0 – publishing runtime as an R5 bundle repository

by Tom Schindl at January 29, 2015 10:30 AM

In other posts I already outlined that our effort beside creating new features is to make the e(fx)clipse runtime a better citizen of the OSGi community / ecosystem.

Starting with 1.2.0 we are not only providing a p2 repository – for people using PDE and Tycho – but also an R5 bundle repository you can use with bnd and bnd-tools (if you are an eclipse user).

Publishing our runtime as an R5 bundle repository in theory would allow you to use other IDEs as well to make use of our runtime – I say in theory because if not mistaken IntelliJ IDEA nor Netbeans yet support bnd directly.

I tried to get something working with IntelliJ IDEA, gradle and bnd but failed miserably which might be because I’m a newbie at gradle and IntelliJ IDEA – so if someone can give me a lending hand I’m happy to document the steps at our wiki and even add project setup support to our project wizards in future versions so that you are able to generate multi IDE projects.

So if a Netbeans or IntelliJ IDEA user is reading this I would really appreciate your input because I want our runtime used as much as possible without you leaving and forcing you into a specific IDE is not the way to go.



by Tom Schindl at January 29, 2015 10:30 AM

IoT Day 2015 – IoT Security, Device Management and IoT APIs

by Ian Skerrett at January 28, 2015 05:08 PM

This year at EclipseCon we are hosting an IoT Day on March 11 at the San Francisco Airport Hyatt Regency in Burlingame, CA. IoT Day is meant for people who might not want to spend an entire week learning about all things Eclipse but are definitely interested in IoT. We did this event last year and it was a great success so we are doing it again!

This year the themes for IoT Day are Security, Device Management and IoT APIs. These are incredibly important topics for the IoT industry so I am thrilled to have talks about them during IoT Day.  Here is a brief synposis of what the day will look like:

– The day starts with Benjamin Cabe providing an overview of the Eclipse Open IoT Stack.   The Eclipse IoT community is making great progress of providing the open building blocks any software developer needs to build an IoT solution.  This will be a good introduction.

– IoT device management is one of the key trends in the IoT industry for 2015. Therefore, we are lucky to have Marco Carrer and Julien Vermillard discuss the solutions for device management from Eclipse IoT.

– Lot of people are in the process of building IoT soutions, One aspect is designing an API for your solution. Two speakers from Zebra Technologies will share their experience of designing an IoT API.

– Security is always one of the key concerns for deploying IoT solutions. Open source and Eclipse IoT have a lot to offer developers looking to secure their IoT solution. Julien Vermillard will show how Eclipse IoT, lightweight M2M and DTLS can be used to secure your IoT solution.

– One of the innovative new projects at Eclipse IoT is called Vorto. The Vorto project leaders from Bosch will talk about their vision of IoT device integration with Vorto. 

– MQTT has become an important and widely adopted IoT standard. MQTT-SN is a version of MQTT for sensor networks. Ian Craggs, the Eclipse Paho project leader, will show how MQTT-SN can make MQTT possible over UDP, Zygbee and other transports.

– The day will close with a number of lightning talks from speakers in our community.

It is a great agenda and a great way to learn about some key topics for IoT. The cost to register for the IoT Day is just $200. Find out more and register today.

Special thank you to 2lemetry for being a sponsor of IoT Day.



by Ian Skerrett at January 28, 2015 05:08 PM

e(fx)clipse 1.2.0 – StyledTextArea improvements

by Tom Schindl at January 28, 2015 01:04 PM

A lot of time has been spent on StyledTextArea and so it has improved a lot.

Many many bugs have been fixed one of the most interesting features from an API point of view is most likely support for custom graphic nodes as part of the LineRuler column.

This new API allows you to e.g. show errors like you know them from your favorite IDE.

screen

screen_2

Still there are many many bugs to fix so it’s going to be a long way to match all the features of e.g. SWT-StyledText.



by Tom Schindl at January 28, 2015 01:04 PM

Diapason, MDE cutting-edge solutions for the correct design of complex Cyber-Physical Systems Part1

by Eclipse Foundation at January 28, 2015 09:58 AM

Diapason is a framework of cutting-edge solutions for design, analysis and development of Cyber-Physical Systems (CPS). Diapason is the result of conducting core research in the application of model-driven engineering methods and tools to the development of complex CPSs together with maintaining close working relationships with major academic and industrial players. It consists of: Papyrus, an enabler of authoring models: Papyrus is providing an integrated and user-consumable environment for authoring UML model and any kind of profiled UML models, such as SysML for system engineering and MARTE for embedded and real-time domains. In addition, Papyrus offers also a set of powerful customization mechanisms which can be leveraged to create and deploy user-defined Papyrus configuration and give it the same facilities as a "pure" DSL editor while also benefiting advantages of standard solutions. Diversity for testing, verifying & validating formally your systems: Diversity is a tool for formal model-based verification, validation and test of complex systems including real-time applications. It provides facilities to check if a system is correct and satisfies safety and reliability requirements. Diversity supports UML models and is fully integrated within Papyrus, but it also supports other modeling formalisms such as Matlab Simulink models and SDL formalism using RTDS tool. Sophia for ensuring safety and security of systems: Sophia is a tool for model-based risk analysis of complex systems. It is based on the Papyrus/Eclipse platform and can be easily customized with different modules referring to the specific user needs. Sophia enables: model annotations with the dysfunctional behavior according to the specific type of analysis; performs risk analysis on the annotated model by using various methods such as Hazard & Risk Analysis, FTA, FME(C)A, Requirement Maintenance or Model Checking; generate specific analysis report accounting for the specific type of analysis and related safety standards (e.g., IEC and ISO26262); and display results using dedicated profiles, editors, tables. Automatically generate reports. Moka for executing/simulating your Papyrus models: Moka is a Papyrus module for execution of UML models, which natively includes an execution engine complying with OMG standards fUML and PSCS (which deal with execution semantics of UML). Moka is integrated with the Eclipse debug framework to provide control, observation and animation facilities over executions. Moka can be easily extended to support alternative execution semantics, and thereby be adapted to multiple usage scenarios and domains. Qompass for optimizing, generating and deploying solutions: The Qompass tool suite consists of two modules, the Architect and the Designer. Qompass Architect is a model-based tool for QoS assessment and optimization of real-time architectures. QoS refers to the system’s delivery of non-functional properties at run-time and reflects the ability of allocating underlying resources properly. Qompass Architect explores non-functional properties of real-time architectures to finally synthesize an optimized architecture. Qompass Designer allows you to deploy your design on a specific platform (e.g., AUTOSAR and DDS) and generate code for each node in your system. ARTiMon for simulation & runtime verification: ARTiMon is a tool which analyses on-the-fly a flow of dated observations in order to detect hazards (negation of requirements) expressed in its formal entry language. Sequoia for dealing with both variability and products line concerns: the main issue behind the development of product line is to factor the development work associated with a set of design models presented. Sequoia assists designers in the one hand to build and use a generic system model to produce different product models, and in the other hand to master the complexity involved by the variability of products. Darwin for supporting requirement engineering: Darwin is a SysML-based tool for requirement management and traceability. It is designed as a specific Papyrus configuration and it offers requirement decomposition taxonomy and uses specific attributes for different types of requirements. It also provides import and export facilities with other requirement engineering tools via the ReqIF standard.

by Eclipse Foundation at January 28, 2015 09:58 AM

MQTT enabling the smallest "things"

by eclipsefdn at January 28, 2015 09:50 AM

The MQTT and MQTT-SN (see mqtt.org) protocols are being widely used for IoT applications because of their simplicity and low overheads. The Paho embedded client libraries for MQTT and MQTT-SN have been designed to minimize size and avoid dependencies on system libraries. This makes them suitable for use in just about any environment with a C or C++ compiler, regardless of operating system or networking library. This session will describe the libraries; how they are split into layers of varying size and helpfulness, and how they can be ported to the environment of your choice. It will be illustrated with examples of use on platforms such as mbed and Arduino. As these libraries are so portable, I am hoping I won't need to write MQTT or MQTT-SN client libraries in C or C++ ever again! Presenter: Ian Craggs [IBM]

by eclipsefdn at January 28, 2015 09:50 AM

SWT Look and Feel: Customize FlatScrollBar Color and More

by Frank Appel at January 28, 2015 04:30 AM

Written by Frank Appel

Recently I introduced a custom slider control useful for improving the SWT look and feel of more subtle view layouts. Happily it seems the widget already found early adopters outside of the Code Affine world. Which led to some enhancements that will be presented in the following sections.

SWT Look and Feel of Scrollbars

‘SWT is a thin abstraction layer on top of native OS widgets. This is a very good thing if you intent that your applications integrate well with the OS look and feel. But as a trade-off this approach limits styling capabilities significantly’ (to quote myself from Sacrilege, …)

In particular I perceive the native SWT scrollbars often as disruptive. But being part of native controls their SWT look and feel is not customizable at all. Hence I created a custom SWT slider widget called FlatScrollBar.

As it is also not feasible to replace the native SWT scrollbar of controls like trees or tables, I introduced a ScrollableAdapter that works around this limitations with overlays. So far I have adapters for tree and tables available and a prototype for ScrolledComposite as work in progress.

Color …

When it comes down to styling, colors are very important. So it is not surprising that the first enhancement request was about the ability of changing the colors of the various slider elements. Because of this I introduced the three properties incrementColor, pageIncrementColor and thumbColor to allow apropriate adjustments:

The following snippet…

FlatScrollBarTable table = [...]
table.setPageIncrementColor( getColor( SWT.COLOR_INFO_BACKGROUND ) );
table.setThumbColor( getColor( SWT.COLOR_WIDGET_LIGHT_SHADOW ) );

… renders the scrollbars like this (getColor retrieves the system color from the current display):

SWT Look and Feel: Scrollbar Color Settings

As native scrollbars on Mac OS look acceptable out of the box the adapter refrains from custom overlays on that platform. Only Gtk and MS Windows platforms are affected. However the FlatScrollBar control itself works well on OS X too.

 

…and More

The attentive reader might wonder what the incrementColor is useful for as the picture shows only three slider elements. It is possible to display increment buttons using the incrementButtonLength:

FlatScrollBarTable table = [...]
table.setIncrementButtonLength( 7 );
table.setIncrementColor( getColor( SWT.COLOR_WIDGET_DARK_SHADOW ) );
[...]

SWT Look and Feel: Increment Button

Neat, isn’t it? ;-)

The last enhancement is not style related but nevertheless noteworthy. It adds untyped event handling to the FlatScrollBar. So if you happen to use Java 8, scrollbar selection observation can be handled as shown here:

FlatScrollBar scrollBar = new FlatScrollBar( parent, SWT.HORIZONTAL );
scrollbar.addListener( SWT.Selection, event -> handleEvent() );

 

Conclusion

Using the FlatScrollBar and the ScrollableAdapter in one of our projects looks promising so far. I am curious to see how sustainable this approach will be and if it is possible to adapt also to text and/or styled text controls. The controls are part of the com.codeaffine.eclipse.swt feature of the Xiliary P2 repository:

http://fappel.github.io/xiliary

In case you want to have a look at the code or file an issue you might also have a look at the Xiliary GitHub project. Look for FlatScrollbarDemo, FlatScrollBarTreeDemo and FlatScrollBarTableDemo for usage examples:

https://github.com/fappel/xiliary

For everything else feel free to use the commenting section below.

The post SWT Look and Feel: Customize FlatScrollBar Color and More appeared first on Code Affine.


by Frank Appel at January 28, 2015 04:30 AM

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

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

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

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