RAP 2.0 Available on Maven Central

5020665036 958795863c RAP 2.0 Available on Maven Central

Hot on the heels of the release of RAP 2.0 the bundles have been uploaded to Maven Central. Time for another coffee break with RAP and Maven.

Before you get your coffee grab the updated sample project from GitHub[1].

$ cd /tmp
$ git clone git://github.com/eclipsesource/rap-maven-examples.git

and trigger the Maven action:

$ cd rap-maven-examples/com.eclipsesource.rap.examples.maven
$ mvn jetty:run

While maven is doing it’s job downloading the new RAP jars you can either go for a coffee or have a quick look at the changes done to migrate the RAP 1.5 based example to RAP 2.

No surprise the version of RAP has been bumped to 2.0.0:

                <dependency>
                        <groupId>org.eclipse.rap</groupId>
                        <artifactId>org.eclipse.rap.rwt</artifactId>
-                       <version>1.5.0</version>
+                       <version>2.0.0</version>
                </dependency>

The Java packages have been renamed from org.eclipse.rwt to org.eclipse.rap.rwt. An organize import will update your java code easily.

-import org.eclipse.rwt.application.Application;
-import org.eclipse.rwt.application.ApplicationConfiguration;
-import org.eclipse.rwt.client.WebClient;
+import org.eclipse.rap.rwt.application.Application;
+import org.eclipse.rap.rwt.application.ApplicationConfiguration;
+import org.eclipse.rap.rwt.client.WebClient;

But do not forget about the other locations like web.xml:

        <listener>
-               <listener-class>org.eclipse.rwt.engine.RWTServletContextListener</listener-class>
+               <listener-class>org.eclipse.rap.rwt.engine.RWTServletContextListener</listener-class>
        </listener>
 
        <servlet>
                <servlet-name>rwtServlet</servlet-name>
-               <servlet-class>org.eclipse.rwt.engine.RWTServlet</servlet-class>
+               <servlet-class>org.eclipse.rap.rwt.engine.RWTServlet</servlet-class>
        </servlet>

The RAP team decided to consolidate the interface names and removed the “I” in interfaces like the IEntryPoint. The interfaces with “I” are still available, but have been marked deprecated.

-import org.eclipse.rwt.lifecycle.IEntryPoint;
+import org.eclipse.rap.rwt.application.EntryPoint;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 
-public class DemoApplication implements IEntryPoint {
+public class DemoApplication implements EntryPoint {

Please have a look at the RAP 2.0 Migration Guide[2] for more details how to migrate your own applications.

In the meantime your console should show something like:

[INFO] Scanning for projects...
...
2013-02-14 09:14:17.272:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.

and the RAP 2.0 standalone application should be available at http://localhost:8080/maven_example

I hope you enjoyed your still hot cup of coffee while following the steps above…

[1] RAP Maven examples – https://github.com/eclipsesource/rap-maven-examples
[2] RAP 2.0 Migration Guide – http://eclipse.org/rap/noteworthy/2.0/migration-guide/

The image is from http://www.flickr.com/photos/stephaniewatson/5020665036/

You may also like...

Share this Post

Twitter5
Google+0
LinkedIn
Facebook

Tags

Comments are closed.

No responses yet

Written by . Published in Categories: Planet Eclipse