04. Configuring IntelliJ IDEA With Versioning System

Overview

If you want to setup an IntelliJ IDEA workspace with the Pentaho Reporting Classic Engine source code, the following instructions will get you started.

NOTE: While IntelliJ IDEA is nice and somewhat easy for development, it is by no means required to develop on or against the Pentaho Reporting Engine Classic code.

Install IntelliJ IDEA

This walk-through was created with IntelliJ IDEA 7.0.1, but should work in a similar fashion for other versions.

Create a New Project 

  • In IDEA, select New Project... from the File menu

  • On the New Project dialog, make sure the Create project from scratch option is selected and click Next >


  • Enter the name of the project (pentaho-reporting as an example)
  • Enter the location of the project (c:\code\pentaho-reporting as an example)
  • Uncheck the Create Module check box
  • Click on the Finish button
    After the project is created, the Project Settings dialog will appear. Perform the following tasks:
  • Add one JDKs to the list (if there are none)

  • In the General settings, select the Project JDK and the Project language level

  • Leave the Modules section blank (for now)

    Check Out the Source Code from the Subversion Repository

  • From the Version Control menu, select Checkout from Version Control and then Subversion

  • Click on the Add Repository Location icon

  • Enter the repository location:svn://source.pentaho.org/pentaho-reporting and click OK
  • Select the to the svn://source.pentaho.org/pentaho-reporting/engines/classic/core/trunk directory and click on the Checkout button

  • When prompted, create and select the destination directory (and all the directories down to it): ${project.home}/engines/classic/core

  • Accept the default checkout options

  • After the checkout has completed, select NO when asked if IDEA should create a new project for the source that was just checked out

Repeat the above steps for the following projects:

  • /engines/classic/core/trunk (done in the walk-though above)
  • /engines/classic/extensions/trunk
  • /engines/classic/demo/trunk
  • /libraries/jcommon-serializer
  • /libraries/libfonts/trunk
  • /libraries/libformula/trunk
  • /libraries/libloader/trunk
  • /libraries/librepository/trunk
  • /libraries/libxml/trunk
  • /libraries/pixie/trunk

Setup Modules

Once all the source code has been checked out of subversion, it is time to create and setup the modules.

  • Click on the Settings toolbar icon to bring up the Settings dialog

  • Select the Project Settings dialog and select Modules...

  • Select the Add New Modules button (plus icon)
  • On the Add Module dialog, select the Create module from scratch radio button

  • In the Content root text field, select the directory where the core source was checked out and placed. This should automatically select the Module file location and the Name of the module. Once selected, click the Next button.

  • Verify the selected source files and then select Next

  • There is no need to select any of the desired technologies, so just click on the Finish button.

Repeat the above steps to add the following modules:

  • core (from the steps above)
  • extensions
  • demo
  • jcommon-serializer
  • libfonts
  • libformula
  • libloader
  • librepository
  • libxml
  • pixie

After the modules has all been created, make a few minor "tweaks"

  • In all the modules, make sure the only directory displayed as a source directory is the directory named source (for example, in the libformula module, remove the test directory as a source directory)

Add Dependencies

Once the modules are all created, it is time to define the modules and libraries that each will use.

  • Select the Core module and click on the Dependencies tab
  • Click on the Add... button
  • Select Module Dependency...

  • Select the modules libfonts, libformula, libloader, librepository, libxml, pixie and click OK
  • Back on the Project Settings dialog with the core module's Dependency tab selected, click on the Add... button and select Single-Entry Module Library...
  • Navigate to the ${project.home}/engines/classic/core/lib directory, and select the following libraries:
    • bsf-2.3.0.jar
    • bsh-1.3.0.jar
    • jcommon-serializer-0.2.0.jar
    • poi-3.0.1-jdk122-final-20071014.jar
  • And click OK

  • Back on the Project Settings dialog with the core module's Dependencies tab selected, click (to add a checkmark) next to all the items in the list which have a checkbox for Export. (This will allow all modules dependent on the core module to automatically be dependent upon everything that the core module is dependent upon).

  • Repeat the above steps for each module using the dependency table below:

Module

Dependent Modules

Dependent Libraries

pixie

(none)

.../libraries/pixie/lib/jcommon-1.0.12.jar

libformula

(none)

.../libraries/libformula/lib/jcommon-1.0.12.jar

librepository

(none)

.../libraries/librepository/lib/jcommon-1.0.12.jar

libloader

pixie

.../libraries/libloader/lib/optional/ehcache-1.2.4.jar
 .../libraries/libloader/lib/optional/commons-logging-1.0.4.jar
 .../libraries/libloader/lib/optional/oscache-2.3-compat.jar

libfonts

libloader

.../libraries/libfonts/lib/itext-1.5.2.jar
 .../libraries/libfonts/lib/junit.jar

libxml

libloader

.../libraries/libxml/lib/gnujaxp.jar

core

jcommon-serializer
 libfonts
 libformula
 libloader
 librepository
 libxml
 pixie

.../engines/classic/core/lib/bsf-2.3.0.jar
 .../engines/classic/core/lib/bsh-1.3.0.jar
 .../engines/classic/core/lib/jcommon-serializer-0.2.0.jar
 .../engines/classic/core/lib/poi-3.0.1-jdk122-final-20071014.jar

extensions

core

.../engines/classic/extensions/hibernate3.jar
 .../engines/classic/extensions/js.jar
 .../engines/classic/extensions/svgsalamander.jar

demo

core
 extensions

.../engines/classic/demo/jfreechart-1.0.5.jar

  • Once completed, close all open dialogs and perform one big recompile (Build menu, Rebuild All item)