Welcome, Guest. Please Login or Register
WebLab Project
  WebLab project is now officialy hosted in the OW2 Forge!
  Warning ! This forum is now locked, new posts have been disabled. If you want to contact us about a problem or have question, please use the following mailing list:
user@weblab-project.org !
  HomeHelpSearchLoginRegister  
 
 
Page Index Toggle Pages: 1
Send Topic Print
Setting up an eclipse plus maven environment. (Read 1505 times)
26.07.2011 at 16:40:57

Jérémie Doucy   Offline
WebLab Administrator
Every nights I dream about
WebLab ...
Elancourt

Gender: male
Posts: 92
*****
 
OLD FASHION:
Linking eclipse with maven. To do this, eclipse have to know where is your maven repository (where maven download all the needed jar files).
In Eclipse go to Window / Preferences. Start typing the word "classpath" in the search field and select Classpath Variables. In the window preference, choose "New ..." in name put M2_REPO and click on Folder ... to select the maven repository folder (/home/<username>/.m2/repository by default).
Click on Ok and eclipse will now know your maven jars repository.

To import a maven java project in Eclipse, go to this folder and type the command : mvn eclipse:eclipse. It will generate eclipse artifact using the M2_REPO previously declared variable. After in eclipse, select file->import... and start typing "existing" in the search field and select existing projects into workspace. Point to the folder service-stubs, and import.

When you update a pom.xml file (project dependencies) you must relaunch the command : mvn eclipse:eclipse and refresh your eclipse project (F5 or right click->refresh).
 
IP Logged
 
Reply #1 - 26.07.2011 at 16:56:35

Gérard Dupont   Offline
WebLab Administrator
WebLab addict.

Posts: 69
*****
 
XXI century fashion :

1- install eclipse indigo
2- install m2eclipse from eclipse installation wizard (see http://m2eclipse.sonatype.org/installing-m2eclipse.html).
3- checkout the WebLab project you want (or create one using the weblab maven generation plugin)
4- import the project in eclipse : right click in package explorer, Import > Maven project > Existing Maven Projects ; then browse to the folder were the project is and import it

If everything went fine, m2eclipse should read the pom, get the dependencies and prepare the project for eclipse.

Note that this need a connection to the Web (to get the maven dependencies from online repository) and that it will only work on stable version. SNAPSHOT versions are not published on public maven repositories so if you want to use it add the OW2 maven repository to your maven settings.
« Last Edit: 26.07.2011 at 19:08:43 by Jérémie Doucy »  
IP Logged
 
Reply #2 - 26.07.2011 at 16:56:42

Matthijs Douze   Offline
WebLab Newbies
I Love WebLab

Posts: 1
*
 
Thanks for the tutorial

Since the project builds with maven, what is Eclipse needed for?

Thanks
 
IP Logged
 
Reply #3 - 26.07.2011 at 19:11:16

Jérémie Doucy   Offline
WebLab Administrator
Every nights I dream about
WebLab ...
Elancourt

Gender: male
Posts: 92
*****
 
You are right, to get the WebLab working you don't need eclipse, but to look at the code samples, and to quickly test it, it's better to have an IDE. So if you need to develop a service, first you can have a look to the services samples.
 
IP Logged
 
Reply #4 - 08.08.2011 at 11:16:32

Yann Mombrun   Offline
WebLab Administrator
I Love WebLab
Val de Reuil, France

Gender: male
Posts: 79
*****
 
I should add that since it builds with Maven, you can use NetBeans / IntelliJ IDEA quite directly.
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print