View source | Discuss this page | Page history | Printable version   

Installation environement de développement sous eclipse

Contents

INSTALLATION D'OPENBRAVO SOUS ECLIPSE

Version des logiciels utilisées

  eclipse-jee-galileo-SR2-linux-gtk
  Linux ubuntu 9.10
  Java 1.6
  Tomcat 6.0.26

Mode opératoire

Installer PostgreSQL database

 - Install the package using:

sudo apt-get install postgresql-8.3 sudo apt-get install postgresql-contrib-8.3

 - Set the postgres password using:

sudo su - postgres -c psql alter role postgres with password 'new_password'; \q

Installer JDK

 - Install the package 

sudo apt-get install sun-java6-jdk

 - Create the JAVA_HOME variable

echo 'JAVA_HOME="/usr/lib/jvm/java-6-sun"' | sudo tee -a /etc/environment

Installer Tomcat

 -Sur le site: http://tomcat.apache.org, dans la partie "Download", sélectionne Tomcat 6.x 
 -Dans la partie "Binary Distribution", dans la sous partie "Core" télécharger le ".zip". 
 -Décompresser l'archive. 
 -Dans le dossier "conf" à la racine de Tomcat modifier le fichier "tomcat-users.xml": enlever les commentaires et ajouter un role "manager":

<tomcat-users>

 <role rolename="tomcat"/>
 <role rolename="role1"/>
 <role rolename="admin"/>
 <role rolename="manager"/>
 <user username="tomcat" password="tomcat" roles="tomcat,admin"/>
 <user username="both" password="tomcat" roles="tomcat,role1"/>
 <user username="role1" password="tomcat" roles="role1"/>
 <user username="admin" password="admin" roles="tomcat,admin,manager"/>

</tomcat-users>

Installer Apache Ant

 - Install the package

sudo apt-get install ant ant-optional

 - Set the ANT_HOME variable

echo 'ANT_HOME="/usr/share/ant"' | sudo tee -a /etc/environment

 - Make the ANT_HOME variable available in your current terminal run

source /etc/environment

 - To make the ANT_HOME variable available system wide, restart the user session. 

Installer Eclipse Galileo IDE for Java EE Developers (Eclipse 3.5.2)

 - Télécharger Eclipse sur le site: http://www.eclipse.org/download.php,file=/technology/epp/downloads/release/galileo/SR2
 - Décompresser l'archive.
 - Lancer Eclipse et créer un nouvel espace de travail (ex: workspace_openbravo)

Installer Mercurial

 - Installer Mercurial:

sudo apt-get install mercurial meld.

Configuration d'Eclipse

 - Modifier la commande dans les propriétés d'Eclipse (clic droit sur l'icone).

Chemin_du_répertoire_d_eclipse -vm /usr/lib/jvm/java-6-sun/bin/java

(ex: /home/myriam/Bureau/Eclipse/eclipse/eclipse -vm /usr/lib/jvm/java-6-sun/bin/java)

 - Editer le fichier "eclipse.ini" qui se trouve dans le répertoire d'installation d'Eclipse

-showsplash

org.eclipse.platform

-framework plugins/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx1024m -XX:MaxPermSize=256m

 - Télécharger le fichier workbench.xml http://wiki.openbravo.com/wiki/images/8/8a/Workbench.xml


 - Copier ce fichier dans your_workspace_path/.metadata/.plugins/org.eclipse.ui.workbench 

Un fichier de même nom existe déjà dans ce répertoire il faut l'écraser, si le fichier téléchargé commence par une majuscule il faut le renommer en minuscules, c'est-à-dire comme le fichier existant dans ce répertoire.

 - Télécharger le fichier openbravo-eclipse-prefs.epf http://wiki.openbravo.com/wiki/images/c/cd/Openbravo-eclipse-prefs_235_240.epf
 - Relancer Eclipse (toujours avec le workspace créé précédemment)
 - Cliquer sur File > Import puis sélectionner General > Preferences dans le menu de gauche 

Modifier le champ "From preference File" par le chemin du fichier "openbravo-eclipse-prefs.epf" qui vient d'être téléchargé. Sélectionner "Import All" puis cliquer sur Finish.

 - Télécharger stax-api-1.0.1.jar http://dist.codehaus.org/stax/jars/stax-api-1.0.1.jar|stax-api-1.0.1.jar 
 - Télécharger wstx-asl-3.0.2.jar http://repository.codehaus.org/org/codehaus/woodstox/wstx-asl/3.0.2/wstx-asl-3.0.2.jar 
 - Copier ces fichiers dans le répertoire "lib" d'Eclipse (eclipse/plugins/org.apache.ant/lib)
 - CLiquer sur Window > Preferences

Sélectionner Ant > Runtime > Ant Home Entries dans le menu de gauche. Cliquer sur "Add External JARS". Ajouter les deux fichiers "stax-api-1.0.1.jar" et "stax-api-1.0.1.jar"

 -Sélectionner Validation dans le menu de gauche

Décocher "Allow projectsto override these preference settings" Cocher "Suspend all validators"

 -Sélectionner Java > Compiler dans le menu de gauche.

Vérifier que le champ "Compiler compliance level" a pour valeur "1.6".

 - Sélectionner General > Content Types

Sélectionner Text > XML.

Cliquer sur le bouton "Add". Dans le champ "File Type" ajouter "*.xsql" puis valider. Refaire cette opération pour ajouter "*.jrxml" et "*.fo"

 -Sélectionner General > Workspace

Modifier les sélections telles que: Build automatically (non coché), Refresh automatically (coché),Save automatically (non coché), Workspace save interval (5), Open referenced projects when a project is opened (Prompt), Text file encoding (Other:UTF-8), New text file line delimiter (Other:UNIX

 - Valider toutes ces modifications en cliquant sur "OK".


Récupérer le code d'Openbravo en ligne de commande avec Mercurial

 - hg clone http://code.openbravo.com/erp/devel/pi chemin_vers/openbravo
 - Obtenir la liste des versions disponible <code>

hg tags

 - Si on le souhaite, revenir à un tag "stable", par exemple <code>

hg up 2.50MP13 -y

 - positionner le code source dans le workspace d'eclipse

configuration sous eclipse

 - Cliquer sur File > Import
 - Sélectionner General > Existings Project into Workspace.
 - Modifier le champ "Select Root Directory": chemin d'accès au dossier openbravo.
 - Répéter l'opération pour "src-core", "src-wad' puis "src-trl".
 - Valider en cliquant sur "OK".
 - Editer le fichier ".classpath" qui se trouve à la racine (openbravo dans le workspace ctrl+h pour voir les fichier cacher):

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

<classpathentry including="**/*.ext|**/*.hbm.xml|**/*.java|**/*.oaw|**/*.properties|**/*.xml|**/*.xpt|**/*.xslt" kind="src" path="src"/>

<classpathentry kind="src" path="build/javasqlc/srcAD"/>

<classpathentry kind="src" path="src-diagnostics/src"/>

<classpathentry kind="src" path="build/javasqlc/src"/>

<classpathentry kind="src" path="src-test"/> <classpathentry excluding="eclipse/" including="quartz.properties" kind="src" path="config"/>

<classpathentry kind="src" path="src-gen"/>

<classpathentry including="**/*.java" kind="src" path="srcAD"/>

<classpathentry kind="lib" path="lib/runtime/org.openarchitectureware.core.workflow_4.3.1.20080910-1400PRD.jar"/>

<classpathentry kind="lib" path="lib/build/junit.jar"/>

<classpathentry kind="lib" path="lib/build/js.jar"/>

<classpathentry exported="true" kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

<classpathentry kind="lib" path="src-wad/lib/openbravo-wad.jar" sourcepath="src-wad/src"/>

<classpathentry kind="output" path="build/classes"/>

</classpath>

 - Editer le fichier "Openbravo.properties" (openbravo/config)

Modifier la valeur de "bbdd.systemPassword" : new_password.

 - Cliquer sur File > Import,

Sélectionner General > Existings Project into Workspace. Modifier le champ "Select Root Directory": chemin d'accès au dossier "src-core" aui se trouve à la racine du dossier openbravo. Répéter l'opération pour "src-wad' puis "src-trl". Valider en cliquant sur "OK".

 - Télécharger un plugin de Tomcat pour Eclipse:tomcatPluginV321.zip http://www.eclipsetotale.com/tomcatPlugin/tomcatPluginV321.zip
 - Décompresser l'archive.
 - Copier le dossier décompressé dans le dossier "Plugins" d'Eclipse.
 - Modifier le fichier "org.eclipse.wst.common.component" (dans openbravo/.settings ctrl+h pour fichier cacher), remplacer son contenu par

<?xml version="1.0" encoding="UTF-8"?>

<project-modules id="moduleCoreId" project-version="1.5.0">

<wb-module deploy-name="openbravo">

<wb-resource deploy-path="/" source-path="/WebContent"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/srcAD"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/build/javasqlc/srcAD"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/build/javasqlc/src"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/src-gen"/>

<wb-resource deploy-path="/WEB-INF/classes" source-path="/src-test"/>

<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/OpenbravoCore/OpenbravoCore">

<dependency-type>uses</dependency-type>

</dependent-module>

<property name="java-output-path" value="build/classes"/>

<property name="context-root" value="openbravo"/>

</wb-module>

</project-modules>

 - Aller dans les propriétés du projet openbravo et sélectionner "Resource" dans le menu de gauche

Modifier les sélections telles que: Text file encoding (inherited from container (UTF-8)), New text file line delimiter (inherited from container)

 - Vérifier que dans l'explorateur de projet se trouvent:

openbravo project OpenbravoCore project OpenbravoTrl project OpenbravoWAD project

 - Vérifier que les Ant tasks suivants sont présents dans Run > External Tools:

eclipse.install.source create.database eclipse.trl.lib eclipse.wad.lib eclipse.compile.complete

If any Ant task is missing from Run > External Tools list, select Run > External Tools > Organize Favorites... and Add them to the list. If you were not able to add the missing Ant tasks to Run > External Tools list, open Ant tab by selecting Window > Show View > Other... > Ant then drag build.xml file (inside general folder) to Ant tab. You will be able to execute Ant tasks by selecting them and click on Run the Selected Target icon Image:Run_icon.png.

   - Ajouter le serveur Tomcat
   - Sélectionner l'onglet Servers (en bas de la page Eclipse).
   - Faire un clic droit, puis New > Server.
   - Sélectionner Apache > Tomcat 6.0.26 > pointer sur la racine /serveur/apache-tomcat-6.0.26
   - Cliquer sur "Next".
   - Sélectionner le projet openbravo et faire "Add".
   - Cliquer sur "Finish".
 - Faire un clic droit > open sur le server qui vient d'être définit.
   -Dans la partie "Server Location".
   -Cocher "Use custom location".
   -Server Path : tomcat.
   -Deply path : webapps.
   -Dans la partie "Server Options".
   -Cocher "Serve modules without publishing".
   -Sauvegarder ces paramètres puis quitter.
 - restart the user session.
 - Sélectionner tous les projets,
 - Cliquer sur Run > External Tools > eclipse.install.source.
 - Le traitement doit se finir par "BUILD SUCCESSFUL".
 - Lancer Tomcat (via l'icone dans la barre des tâches)
 - Aller sur http://localhost:8080/openbravo/ 
 Username: Openbravo
 password: openbravo

http://www.preciturn-group.com/

http://www.axege.com/

Retrieved from "http://wiki.openbravo.com/wiki/Installation_environement_de_d%C3%83%C2%A9veloppement_sous_eclipse"

This page has been accessed 4,134 times. This page was last modified on 30 April 2010, at 15:27. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.