wiki:TutorialMaven

Version 5 (modified by vegasm, 10 years ago) (diff)

--

Thredds development with eclipse

We have to follow some steps to develop Thredds project with Eclipse IDE and Java Environment. Thredds is a project that uses Maven so we will configurate Maven in our pc too.

Setting up java envionment in your pc:

1- Download JDK (Java Development Kit) latest release 1.7, Maven and eclipse

JDK: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
MAVEN: http://apache.rediris.es/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.zip
Eclipse Juno for Java EE Developers:  http://www.eclipse.org/downloads/ 

JDK is necessary to install and the others only unzip the folders where you prefer.

2- Configuration of Java Environtment variables in our system

PATH = C:\Program Files\Java\jdk1.7.0\bin (Necessary to exec javac command)
JAVA_HOME = C:\Program Files\Java\jdk1.7.0

3- Configuration of Apache Maven Environment variables

MAVEN_HOME = C:\Program Files\apache-maven-3.0.4
PATH = C:\Program Files\Java\jdk1.7.0\bin;%MAVEN_HOME%\bin; (Necessary to exec mvn command)

4- Check if your configuration is OK

Go to Start menu => execute => type cmd Type mvn-version and you should see something like this:

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: C:\Program Files\apache-maven-3.0.4\bin\..
Java version: 1.7.0, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0\jre
Default locale: es_ES, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

How to download thredds project and compile it with Maven

Download thredds from here by clicking Zip button and unzip wherever you want: https://github.com/Unidata/thredds

Then is time to test out maven installation. Open cmd and go to the main folder project. Execute mvn install and you should see something like this:

[INFO] Parent THREDDS and CDM modules .................... SUCCESS [0.413s]
[INFO] udunits ........................................... SUCCESS [1.731s]
[INFO] NetCDF-Java Library ............................... SUCCESS [7.892s]
[INFO] BUFR IOSP ......................................... SUCCESS [2.338s]
[INFO] GRIB IOSP and Feature Collection .................. SUCCESS [4.176s]
[INFO] OPeNDAP ........................................... SUCCESS [1.208s]
[INFO] DAP Test Server (DTS) webapp ...................... SUCCESS [5.381s]
[INFO] VisAD-based IOSPs ................................. SUCCESS [10.800s]
[INFO] UI Module ......................................... SUCCESS [26.342s]
[INFO] THREDDS Data Server (TDS) ......................... SUCCESS [14.164s]
[INFO] THREDDS Data Manager (TDM) ........................ SUCCESS [5.220s]
[INFO] WMO tables webapp ................................. SUCCESS [5.628s]
[INFO] CDM validator webapp .............................. SUCCESS [16.842s]
[INFO] Test CDM (upc/share - Unidata only) ............... SUCCESS [1.050s]
[INFO] Test Integration .................................. SUCCESS [2.224s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:45.999s
[INFO] Finished at: Wed Dec 05 13:04:12 CET 2012
[INFO] Final Memory: 31M/448M
[INFO] ------------------------------------------------------------------------

How to integrate Maven in eclipse and import Thredds project

Maven integration

First of all download m2eclipse plugin. Go to Help > Install > New software

In work with you have to paste this url: http://download.eclipse.org/technology/m2e/releases

Click on add and type the name (Maven it could be perfect)

Check on Maven Integration for Eclipse and follow the steps

Restart eclipse

Import thredds project

Go to File > Import > Maven > Existing Maven Projects > Select thredds folder

At this point you can select all the subprojects that you want because thredds includes a lot of subprojects such as tds, tdm, etc.

Wait for building and validation

Dirección subversion del proyecto de ejemplo: https://www.meteo.unican.es/svn/repos/documentos/trunk/software