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

ERP 2.50:Developers Guide/Development Environment/Setting up Development Environment with Eclipse IDE/it


Contents

Preparare l'ambiente di sviluppo

Bulbgraph.png   Note that the newest version of Eclipse has not been tested yet, so it is recommended that you use this one: http://www.eclipse.org/downloads/packages/release/galileo/sr2

First of all you need to install and configure different components of the Openbravo ERP environment as it's described in Openbravo Environment Installation guide. In order to comply to development requirements some of those components have to be additionally adjusted according to Development Stack Setup. After completing all of the steps in the aforementioned guides, please make sure that:

Now check out Openbravo ERP source code from the repository.

Download del codice sorgente

The source code can be checked out using any Mercurial client. There is no any restrictions on the read access so you wouldn't need any credentials to access the repository. The detailed procedure of the source code check out is described in Mercurial Manual for Openbravo Developers. As it's explained in the guide it's normally considered as a good practice to have a pristine clone and working one, so we would strongly encourage you to follow that 'rule'. It is also highly advisable to clone the repository into a destination directory which is outside of Eclipse workspace.

Installazione Openbravo

The Openbravo ERP installation is performed in several steps.

Configurare le proprietà

So, first of all you have to configure the Openbravo ERP by specifying some general properties, e.g. Tomcat installation directory, database connection details, etc. This can (and in fact must) be done via a special GUI application which has to be downloaded first. For that, go to the directory with the working clone of the repository (XXX\opensource\openbravo\erp\devel\main\) and execute

ant setup

The invocation of this ant target will download an executable file called setup-properties-[OS_NAME].[EXT] in config subdirectory. Move into this subdirectory and launch the executable file to start the GUI configuration application. By going through the wizard pages provide all requested information and click Finish to apply the changes and close the application. As a result of these actions a new file Openbravo.properties, containing specified settings, will be created in config subdirectory. More about the properties can be found at Openbravo properties. Now the Openbravo ERP is ready to be installed.

Installare dai sorgenti

In order to install the Openbravo ERP three main procedures have to be accomplished:

All this is done by invoking

ant install.source

from the root of the working clone (XXX\opensource\openbravo\erp\devel\main\). This process can take quite long time (up to 25 min) depending on hardware configuration. It's always a good idea to redirect the output of the task execution to a log file which then can be analyzed or sent to the support team in case of problems. After the task has completed the log should not contain any error or exception massages as well as it should have BUILD SUCCESSFUL message at the end of the file. (if you are under Linux use grep command to check whether the file contains any exceptions). After successful installation the next step can be taken - importing to Eclipse IDE.

Import nel IDE di Eclipse

Launch Eclipse.
Bulbgraph.png   After Eclipse has started go to Project menu and disable Build Automatically option there.
Now 4 projects need to be imported in the workspace (by menu File=>Import..., Existing Projects into Workspace). Here they are:
openbravo        XXX\opensource\openbravo\erp\devel\main\
OpenbravoCore    XXX\opensource\openbravo\erp\devel\main\src-core
OpenbravoTrl     XXX\opensource\openbravo\erp\devel\main\src-trl
OpenbravoWAD     XXX\opensource\openbravo\erp\devel\main\src-wad

Then open Servers view and create a new instance of Tomcat server:

Tomcat.server.JPG

While going through the wizard select openbravo and add it to configured resources. Then click "Finish". The created instance should appear in the view. Double click on it to change its settings in the form depicted on the picture below: Tomcat.server.2.JPG

Set :

 -Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M 

After changing all, save your server configuration.

The next step is to set the standard preferences used in the development of Openbravo.

ImportPreferences1.jpg

ImportPreferences2.jpg

Once finished, select all the projects, refresh them, and rebuild them. You should get warnings, but not errors.

Lanciare da Eclipse

Now start the Tomcat server by right-clicking on the server instance in the Servers view and choosing Start option in the popup menu. Wait until the server is started (can take up to 2 minutes) and visit http://localhost:8080/openbravo/ in your internet browser. If everything was configured and installed properly you will get to the Openbravo ERP log in page. Use these credentials to log in:

both are case sensitive. That's it, the core installation is over! In order to install additional Openbravo ERP modules, please, refer the next paragraph.

Passi di Configurazione Addizionali per la Modularità

Openbravo ERP core functionality can be easily extended by installing additional modules. More information about modularity and its application in Openbravo ERP can be found in Openbravo Main Development Concepts.

Configurare Server Tomcat

Open Project Explorer view and go into the Servers folder. Expand your server instance and open server.xml file. Find the following line the file

 <Context docBase="openbravo" path="/openbravo" reloadable="true" source="org.eclipse.jst.j2ee.server:openbravo"/>

and change reloadable value to false.

Now, in the same folder, open context.xml file. Comment out the following line

<WatchedResource>WEB-INF/web.xml</WatchedResource>

Safe both changed files. Now, install Openbravo ERP module(s).

This same configuration can be done without the need of editing config files but using eclipse UI.

Right click on Tomcat server and select Open. Inside Overview section of tomcat server, Go to Publishing section and select "Never publish automatically" and save. Change tab in the same screen selecting Modules. Click on edit button and then unflag "Auto reloading enabled".

Installare Modulo Openbravo ERP

Bulbgraph.png   If you are developing a module, make sure that you do not overwrite your development by setting your module in development and exporting it before continuing.

Additional modules can be installed in two different ways:

  1. Using the Module Management Console.
  2. Manual installation.

Module Management Console

You can always install Openbravo ERP modules via the Module Management Console using your Eclipse IDE environment:

  1. Install the module(s) selected via the Module Management Console.
  2. When the installation finishes, select Don't do anything now. I will reload the Openbravo application manually later.
  3. Inside Eclipse IDE, stop the Eclipse Tomcat server.
  4. Refresh the openbravo project.
  5. Build the openbravo project.
  6. Start the Eclipse Tomcat server.


Manual

Despite the Module Management Console automates some of the installation steps, you can still install a module manually:

  1. Check out the module source code into XXX\opensource\openbravo\erp\devel\main\modules\ directory.
    1. If the source code of the module that you want to install is stored in a Mercurial repository type:
      hg clone [REPOSITORY_URL]
    2. If the source code of the module that you want to install is stored in a Subversion repository type:
      svn co [REPOSITORY_URL]
  2. After the code has been downloaded, move one directory up (XXX\opensource\openbravo\erp\devel\main\) and execute
    ant smartbuild -Dlocal=no
  3. This will install the module by changing database (structure and Application Dictionary data) and recompile the necessary parts of source code.
  4. When the target execution is finished go back to Eclipse and stop the Eclipse Tomcat server.
  5. Refresh the openbravo project.
  6. You need to add src folder of the module as a Source folder to the openbravo project class path.
  7. Build the openbravo project.
  8. Start the Eclipse Tomcat server.

At the end, for both installation methods, you should have something like this in your project explorer:

Eclipse.module.JPG


Modificare Modulo Openbravo ERP

Bulbgraph.png   If you are developing a module, make sure that you do not overwrite your development by setting your module in development and exporting it before continuing.

Modules present in your workspace can be updated in two different ways:

  1. Using the Module Management Console.
  2. Manual installation.

Module Management Console

You can always update Openbravo ERP modules via the Module Management Console using your Eclipse IDE environment:

  1. Update your module(s) via the Module Management Console.
  2. When the update finishes, select Don't do anything now. I will reload the Openbravo application manually later.
  3. Inside Eclipse IDE, stop the Eclipse Tomcat server.
  4. Refresh the openbravo project.
  5. Build the openbravo project.
  6. Start the Eclipse Tomcat server.


Manuale

Despite the Module Management Console automates some of the update steps, you can still update a module manually:

  1. Move to the directory of the module that you want to update.
    1. If the source code of the module that you want to update is stored in a Mercurial repository type:
      hg pull
      hg update
    2. If the source code of the module that you want to update is stored in a Subversion repository type:
      svn up
  2. After the code has been updated, move one directory up (XXX\opensource\openbravo\erp\devel\main\) and execute
    ant smartbuild -Dlocal=no
  3. This will update the module by changing database (structure and Application Dictionary data) and recompile the necessary parts of source code.
  4. When the target execution is finished go back to Eclipse and stop the Eclipse Tomcat server.
  5. Refresh the openbravo project.
  6. Build the openbravo project.
  7. Start the Eclipse Tomcat server.


Modificare Core Openbravo ERP

Bulbgraph.png   If you are developing a module, make sure that you do not overwrite your development by setting your module in development and exporting it before continuing.

Openbravo ERP core can be updated in two different ways:

  1. Using the Module Management Console.
  2. Manual installation.

Module Management Console

You can always update Openbravo ERP core via the Module Management Console using your Eclipse IDE environment:

  1. Update you Openbravo ERP core via the Module Management Console.
  2. Do not rebuild Openbravo ERP via the Module Management Console!
  3. Inside Eclipse IDE, stop the Eclipse Tomcat server.
  4. Refresh the openbravo project.
  5. Launch update.database task.
  6. Build the OpenbravoCore project.
  7. Launch eclipse.wad.lib task.
  8. Launch eclipse.trl.lib task.
  9. Launch eclipse.compile.complete task.
  10. Start the Eclipse Tomcat server.


Manuale

Despite the Module Management Console automates some of the update steps, you can still update Openbravo ERP core manually:

  1. Move to the main directory of Openbravo ERP and type:
    hg pull
    hg update
  2. Inside Eclipse IDE, stop the Eclipse Tomcat server.
  3. Refresh the openbravo project.
  4. Launch update.database task.
  5. Build the OpenbravoCore project.
  6. Launch eclipse.wad.lib task.
  7. Launch eclipse.trl.lib task.
  8. Launch eclipse.compile.complete task.
  9. Start the Eclipse Tomcat server.


Retrieved from "http://wiki.openbravo.com/wiki/ERP_2.50:Developers_Guide/Development_Environment/Setting_up_Development_Environment_with_Eclipse_IDE/it"

This page has been accessed 4,188 times. This page was last modified on 30 June 2011, at 20:00. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.