genus development environment configuration tutorial

13
Genus development environment configuration Tutorial Lukasz Lechert

Upload: nguyendang

Post on 14-Feb-2017

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Genus development environment configuration Tutorial

Genus development environment configuration

Tutorial

Lukasz Lechert

Page 2: Genus development environment configuration Tutorial

2

Table of contents 1. Get sources ...................................................................................................................................... 3

2. Build sources from the command line (description for Windows only) ......................................... 4

3. Configure and start development from the IDE .............................................................................. 8

References ............................................................................................................................................. 13

Page 3: Genus development environment configuration Tutorial

3

The GENUS development environment configuration – tutorial for beginners

1. Get sources

Install the Java and JDK

Please download and install the Java Development Kit 6 with latest updates. Please take a look at the

resource list (chapter references below) and go to the following link [JAVA_JDK_6_DOWNLOAD].

Install the Tortoise SVN

Please download and install the latest version of the Tortoise SVN [TORTOISE_SVN_DOWNLOAD].

Set up the JAVA_HOME variable

Please set up your local JAVA_HOME system variable. You can run “System variables” windows

clicking on the Control Panel and System properties.

Create the Genus directory structure for sub-projects

Please create following directory structure for Genus project. Please create directories: genus, genus-

bin, genus-doc, genus-src, src and workspace.

Set up your SVN repository access

Please follow description from [GEANT_SVN_ACCESS]. You can use putty tool to access the GENUS

SVN repository [PUTTY_DOWNLOAD].

Check out the genus sources

Page 4: Genus development environment configuration Tutorial

4

Open the genus/genus-src/src directory. Right mouse click in that folder and run the SVN Checkout

command. Use the URL marked red, please.

Click Ok button and checkout the sources HEAD revision. Example destination directory structure is

presented below.

2. Build sources from the command line (description for Windows

only)

Install the Postgres database server

Please install the Postgres database server on your local machine [POSTGRESS_DOWNLOAD]. Use

following description, please [POSTGRES_INSTALLATION].

Create the Genus database

Page 5: Genus development environment configuration Tutorial

5

Run the pgAdmin tool. Please connect to your local Postgres instance using settings defined during

installation process.

Create a new database, please.

Please input settings for new database and click Ok.

Page 6: Genus development environment configuration Tutorial

6

Set up your connection configuration

Open and edit the service.properties file. Change your database.connection.url property and use the

name genusdb for your database. Please note: Do not commit your local configuration settings to the

GEANT and Genus SVN repository.

Path

…/genus/genus-src/src/genus-service/src/main/resources/service.properties

Open and edit the pom.xml file.

Change your dbunit.plugin.configuration.url property (tag <dbunit.plugin.configuration.url >).

Please note: Do not commit your local configuration settings.

Path

…/genus/genus-src/src/genus-service /pom.xml

Page 7: Genus development environment configuration Tutorial

7

You can install and set up another database server e.g. Oracle XE or HSQLDB. Your feedback and

description of configuration is welcome!

Install maven build tool

Please download maven build tool [MAVEN_DOWNLOAD]. Please take a look at the references.

Unpack and copy your maven distribution to the following location: ../genus/genus-bin/maven

Please note: Do not commit any files from maven directory.

Set up your cmd.cmd script

Create and open the cmd.cmd file in genus main directory. The example you find in the

svn+ssh://[email protected]/GEANT/JRA1/Genus/genus-incubator/genus-incubator-doc

directory. Input values for the PRJ_HOME, JAVA_HOME and M3_HOME variables. Example:

set PRJ_HOME= c:\genus

set JAVA_HOME=c:\tool\sdk\jdk

set M3_HOME=c:\genus\genus- bin\maven

Save and close your script. Please note: Do not commit your local settings.

Path

.../genus/cmd.cmd

Please copy jaxws-api-x.x.x.jar file to the …/jdk/jre/lib/endorsed directory. Choose the 2.2.1 version

or higher [MIGRATION_GUIDE]. The problem is described in section “Runtime changes”.

Run your cmd.cmd batch script configured in previous step. Go the defined location below using cd

command.

Path

.../genus/genus-src/src

Please run $mvn install command. First build can take a few minutes.

Page 8: Genus development environment configuration Tutorial

8

3. Configure and start development from the IDE

Please download and install the Eclipse IDE for Java EE Developers or Spring Tool Suite (STS ) on your

local machine [ECLIPSE_DOWNLOAD_3.6] [STS_DOWNLOAD]. Unpack and copy your distribution to

the following location.

Path

.../genus/genus-bin/sts

Start your IDE and choose workspace directory. Please note: Do not commit any files from your

workspace directory.

Page 9: Genus development environment configuration Tutorial

9

Please import the genus sources using the Import Existing Maven Projects feature.

Install Eclipse plugins

If you use the Eclipse IDE, install the maven plugin for Eclipse. Choose the Help->Install New Software

functionality. Click the Add button, input the update site location and click Ok button. You can install

another plugins specified in table below.

Plugin Resource URL

Maven (m2e) U http://m2eclipse.sonatype.org/sites/m2e

Fuse IDE U http://repo.fusesource.com/ide

Emma – code

coverage

U http://update.eclemma.org

ICEfaces D http://www.icefaces.org/main/downloads

Spring IDE U http://springide.org/updatesite

SQL Explorer D http://eclipsesql.sourceforge.net/

Subclipse U http://subclipse.tigris.org/update_1.8.x

http://subclipse.tigris.org/servlets/ProjectProcess;jsessionid=2

0DA6511E6FDCD2D583B1767E1FCD6E1?pageID=p4wYuA

Page 10: Genus development environment configuration Tutorial

10

JIRA Plugin U http://update.atlassian.com/atlassian-eclipse-plugin/e3.6

http://update.atlassian.com/atlassian-eclipse-plugin/e3.7

More information on the site

http://confluence.atlassian.com/display/IDEPLUGIN/Installing+

the+Eclipse+Connector

and in the JRA1-T4-GENUS-JIRAEclipseIntegrationTutorial.txt

file

*U – update site, D – download page. Please install from archive manually.

When you want to develop the genus project with the latest Eclipse Indigo or Juno IDE, please install

the maven plugin choosing the Help->Install New Software functionality.

1. Select the Indigo - http://download.eclipse.org/releases/indigo entry from the Work with:

drop-down box,

2. Select the Collaboration option,

3. Mark the m2e maven integration for Eclipse and click Next button twice,

4. Accept the terms of the license agreement and click Finish button,

5. Wait for results and restart your Eclipse IDE.

Set up your Java Development Kit (JDK) under Eclipse

1. Run the Window->Preferences->Java->Installed JREs->Add functionality.

2. Specify your JRE Type e.g. Standard VM and click Next button,

3. Click Directory button and point to the home directory of your JDK local installation,

4. Click the Finish button.

5. Mark new JRE configuration and remove old default JRE,

6. Finish clicking Ok button.

Page 11: Genus development environment configuration Tutorial

11

Import and build the genus sources under Eclipse IDE

1. Turn “Build automatically” option off. Switch the Project->Build automatically option from

menu,

You can turn off that option permanently through Window->Preferences->General-

>Workspace->Build automatically.

2. Import your local maven project to the Eclipse IDE,

Choose the File->Import functionality. Input filter text: maven and choose the “Existing

Maven Projects” wizard. Click Next button. Point to the location of the pom.xml and genus-

common main directory and click Finish button.

3. Set up the JRE System Library

Click e.g. on the genus-common project. Right mouse click and choose the “Properties”

option. Click on the “Java Build Path” property. Select the “Libraries” tab. Remove your old

Page 12: Genus development environment configuration Tutorial

12

JRE library and add new using the “Add Library” button. Choose the “JRE System Library”

position and click the Next, Finish and Ok buttons.

4. Build and install your local copy of the genus project

Click on the pom.xml from the genus project. Right mouse click and run the Run as->Maven

install the functionality. Wait until your local project will be built properly.

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.206s [INFO] Finished at: Mon Jan 02 12:25:00 CET 2012 [INFO] Final Memory: 7M/18M [INFO] ------------------------------------------------------------------------

Page 13: Genus development environment configuration Tutorial

13

References

1. [JAVA_JDK_6_DOWNLOAD] JDK SE 6 download page (with updates) -

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. [TORTOISE_DOWNLOAD] - http://tortoisesvn.net/downloads.html

3. [PUTTY_DOWNLOAD] - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

4. [GEANT_SVN_ACCESS] -

https://intranet.geant.net/sites/Services/SA4/T3/FAQs/How%20to%20configure%20Eclipse%

20with%20Subversion.aspx

5. Configure SVN+SSH http://www.woodwardweb.com/java/000155.html

6. Postgres Version >9.0 [POSTGRESS_DOWNLOAD] - http://www.postgresql.org/download/

7. Postgres installation - http://www.postgresql.org/docs/9.1/interactive/tutorial-install.html

8. [MAVEN_5_MINUTES] “Maven in 5 minutes” - http://maven.apache.org/guides/getting-

started/maven-in-five-minutes.html

9. Maven 3.0.3 [MAVEN_DOWNLOAD] - http://maven.apache.org/download.html

10. Active MQ 5.5.1 [ACTIVEMQ_DOWNLOAD] - http://activemq.apache.org/download.html

11. [ACTIVEMQ_GETTING_STARTED] - http://activemq.apache.org/getting-started.html

12. [SOLUTION_PRESENTATION] – Bartosz Belter, Lukasz Lechert “GENUS integration –

recommended solution”

13. Tomcat 6.0.35 [TOMCAT_DOWNLOAD] - http://tomcat.apache.org/download-60.cgi

14. Tomcat Web Application Manager [TOMCAT_MANAGER] - http://tomcat.apache.org/tomcat-

6.0-doc/manager-howto.html

15. Eclipse resources - http://www.eclipse.org/resources/

16. Eclipse and Java for Total Beginners -

http://www.eclipse.org/resources/resource.php?id=392

17. Eclipse Helios IDE 3.6 SR2 [ECLIPSE_DOWNLOAD_3.6] -

http://www.eclipse.org/downloads/packages/release/helios/sr2

18. Eclipse Indigo IDE 3.7 [ECLIPSE_DOWNLOAD_3.7] -

http://www.eclipse.org/downloads/packages/release/indigo/r

19. SpringSource Tool Suite - http://www.springsource.com/landing/best-development-tool-

enterprise-java

20. [MIGRATION_GUIDE] - http://cxf.apache.org/docs/23-migration-guide.html

21. HSQLDB - http://hsqldb.org/

22. Oracle XE - http://www.oracle.com/technetwork/products/express-

edition/overview/index.html

23. NetBeans - http://netbeans.org/

24. STS, Spring Tool Suite [STS_DOWNLOAD] - http://www.springsource.org/sts