Introduction

The Josas development environment has been designed to be executed on any platform. It has been fully tested on Windows Vista and Linux.

The Josas development environment is based on using the following tools:

  • The J2SE Java development environment
  • Maven including the following plugins:
    • All the plugins used traditionally to compile, unit test the code and generated the project site.
    • the checkstyle plugin is used to check the source coding style
    • the clover plugin is used to verify the coverage of the unit test suite
  • Eclipse can be used to edit, compile, test and debug the code. For this the following plugins have been used:
    • the maven plugin ensures that dependencies recorded into the maven pom file will be taken into account during the build phase.
    • the checkstyle plugin allows to check the code style as it is written.
    • the subclipse plugin to interface with the subversion repository on sourceforge.
  • Netbeans is not very integrated with maven. As a consequence, it has not been used as the main purpose integrated development environment for Josas. However, Netbeans provides two very interesting features not provided by eclipse :
    • The database management interface which is used bor the database preparation and maintenance.
    • The matisse interface for creating swing components.

Environment installation and configuration

Java J2SE development environment

The J2SE installation and configuration does not need any specific action. Just follow installation instructions including setting the JAVA_HOME environment variable and adding $JAVA_HOME/bin in the PATH.

It is recommended to use the latest release of JDK 6.

Maven

In order to install maven, just follow installation instructions including setting the MAVEN_HOME environment variable and adding $MAVEN_HOME/bin in the PATH.

Josas uses some libraries which are not automatically downloaded from the ibiblio repository. This encompasses: Maven will give you instructions on how to install these libraries into your local repository once you will have downloaded them manually.

You can verify proper maven installation just by trying to generate the Josas development site. Of course, this means that you already downloaded Josas sources. During this first build, ignore errors in test execution: the database has not been configured yet.

Eclipse

Although not required, the Eclipse IDE is a very convenient tool to develop Josas. After standard installation, the following plugins have to be installed:
  • The maven eclipse integration plugin will ensure that dependencies defined in the POM will be taken into account by eclipse for the build. In addition, it will be possible to invoke maven from eclipse The maven eclipse integration plugin does not provide all information to the eclipse project. As a consequence, the following actions have to be made :
    • In the build path dialog box you will have to add a personal library that includes the toplink.essential jar file.
    • In the build path dialog box you will have to setup the source folders for :
      • Josas/src/main/java
      • Josas/src/main/resources
      • Josas/src/test/java
      • Josas/src/test/java
      Don't forget to set the output directory to target/classes for the application source and to target/test-classes for the tests.
  • The subclipse plugin will allow to use the subversion repository on sourceforge.
  • The checkstyle plugin is used to get checkstyle comments as a code is writen. Note that, due to a not yet fixed bug in checkstyle related to generics, the configuration rules have to be loaded from the checkstyle.xml file available in the Josas source tree.

Derby

In order to install derby, just follow installation instructions including setting the DERBY_HOME environment variable and adding $DERBY_HOME/bin in the PATH.

Netbeans

In order to install Netbeans, just follow installation instructions.

Building and testing

database

For development and unit testing, the database has to be created in the database folder inside the Josas build tree. The database is created either using the ij tool or using Netneans as a graphical front end.
            connect
            'jdbc:derby:Josas;create=true;user=asso;password=asso'
          

Maven

database creation

The database can be automatically built using the automatic table generation feature of the toplink.essentials library. This can be achieved using the following maven command :
          mvn -Dtable.generation="create-tables" compile
        
followed by the execution of the CreateDatabase class. As I still did no a simple way o do it from maven, I recommend to launch such execution from eclipse. The table.generation flag can be kept to the create-tables" value. However, this has an impact on the time needed for executing the unit test suite and on the log size. It is then recommended, after database creation to issue the following maven command:
mvn compile

Test execution

The complete test suite execution is launched using the
mvn test
command. A dedicated run target created for this in eclipse.