RAP 2.0 Available on Maven Central

February 14, 2013 | 2 min Read

 

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:

                
                        org.eclipse.rap
                        org.eclipse.rap.rwt
- 1.5.0
+                       2.0.0
                

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:

        
- org.eclipse.rwt.engine.RWTServletContextListener
+               org.eclipse.rap.rwt.engine.RWTServletContextListener
        
 
        
                rwtServlet
- org.eclipse.rwt.engine.RWTServlet
+               org.eclipse.rap.rwt.engine.RWTServlet
        

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 [email protected]:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.

and the RAP 2.0 standalone application should be available at https://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 - https://eclipse.dev/rap/noteworthy/2.0/migration-guide/

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