ERP 2.50:Developers Guide/Development Environment/Setting up Development Environment with Eclipse IDE/it
Languages: |
Contents |
Preparare l'ambiente di sviluppo
![]() | 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:
- your OS user has read/write access to your tomcat installation home directory (CATALINA_HOME).
- environment variables (e.g. ANT_OPTS, CATALINA_OPTS, JAVA_HOME, etc) are declared in the proper categories (i.e. System/User variables) (windows only)
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:
- the Openbravo ERP database has to be created and populated with some initial values
- sources have to be generated
- all sources have to compiled to binaries which later can be executed on a WEB server (Tomcat).
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. 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:
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:
Set :
- in General Information
- click on Open launch configuration
- add the following line at the end of VM arguments
-Djava.awt.headless=true -Xms384M -Xmx512M -XX:MaxPermSize=256M
- in Server options
- check the Serve modules without publishing
- in Timeouts
- set start and stop timeouts to 120 seconds
After changing all, save your server configuration.
The next step is to set the standard preferences used in the development of Openbravo.
- Import workspace preferences clicking on File > Import, then select General > Preferences and click on Next button.
- The preferences file is located in the config/eclipse folder
- Browse to openbravo-eclipse-prefs.epf file, select Import all radio button and click on Finish button.
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:
- username - Openbravo
- password - openbravo
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
![]() | 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:
- Using the Module Management Console.
- Manual installation.
Module Management Console
You can always install Openbravo ERP modules via the Module Management Console using your Eclipse IDE environment:
- Install the module(s) selected via the Module Management Console.
- When the installation finishes, select Don't do anything now. I will reload the Openbravo application manually later.
- Inside Eclipse IDE, stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- Build the openbravo project.
- Start the Eclipse Tomcat server.
Manual
Despite the Module Management Console automates some of the installation steps, you can still install a module manually:
- Check out the module source code into XXX\opensource\openbravo\erp\devel\main\modules\ directory.
- If the source code of the module that you want to install is stored in a Mercurial repository type:
hg clone [REPOSITORY_URL]
- If the source code of the module that you want to install is stored in a Subversion repository type:
svn co [REPOSITORY_URL]
- If the source code of the module that you want to install is stored in a Mercurial repository type:
- After the code has been downloaded, move one directory up (XXX\opensource\openbravo\erp\devel\main\) and execute
ant smartbuild -Dlocal=no
- This will install the module by changing database (structure and Application Dictionary data) and recompile the necessary parts of source code.
- When the target execution is finished go back to Eclipse and stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- You need to add src folder of the module as a Source folder to the openbravo project class path.
- Build the openbravo project.
- Start the Eclipse Tomcat server.
At the end, for both installation methods, you should have something like this in your project explorer:
Modificare Modulo Openbravo ERP
![]() | 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:
- Using the Module Management Console.
- Manual installation.
Module Management Console
You can always update Openbravo ERP modules via the Module Management Console using your Eclipse IDE environment:
- Update your module(s) via the Module Management Console.
- When the update finishes, select Don't do anything now. I will reload the Openbravo application manually later.
- Inside Eclipse IDE, stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- Build the openbravo project.
- Start the Eclipse Tomcat server.
Manuale
Despite the Module Management Console automates some of the update steps, you can still update a module manually:
- Move to the directory of the module that you want to update.
- If the source code of the module that you want to update is stored in a Mercurial repository type:
hg pull
hg update
- If the source code of the module that you want to update is stored in a Subversion repository type:
-
svn up
-
- If the source code of the module that you want to update is stored in a Mercurial repository type:
- After the code has been updated, move one directory up (XXX\opensource\openbravo\erp\devel\main\) and execute
-
ant smartbuild -Dlocal=no
-
- This will update the module by changing database (structure and Application Dictionary data) and recompile the necessary parts of source code.
- When the target execution is finished go back to Eclipse and stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- Build the openbravo project.
- Start the Eclipse Tomcat server.
Modificare Core Openbravo ERP
![]() | 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:
- Using the Module Management Console.
- Manual installation.
Module Management Console
You can always update Openbravo ERP core via the Module Management Console using your Eclipse IDE environment:
- Update you Openbravo ERP core via the Module Management Console.
- Do not rebuild Openbravo ERP via the Module Management Console!
- Inside Eclipse IDE, stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- Launch update.database task.
- Build the OpenbravoCore project.
- Launch eclipse.wad.lib task.
- Launch eclipse.trl.lib task.
- Launch eclipse.compile.complete task.
- 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:
- Move to the main directory of Openbravo ERP and type:
-
hg pull
-
hg update
-
- Inside Eclipse IDE, stop the Eclipse Tomcat server.
- Refresh the openbravo project.
- Launch update.database task.
- Build the OpenbravoCore project.
- Launch eclipse.wad.lib task.
- Launch eclipse.trl.lib task.
- Launch eclipse.compile.complete task.
- Start the Eclipse Tomcat server.
Languages: |