Step 3: install Squalix

  1. Set up the required environment
    1. Java

      Be sure that:

      • you have at least a Java 5 Runtime Environment installed
      • JAVA_HOME is set up and points to this JRE
      • JAVA_HOME/bin is added to the PATH environment variable
      • For compilation of code, Squalix needs JDKs: install as many as you need (1.3, 1.4, 1.5), depending on what kind of Java projects you will analyse with Squale.

      That's all for java.

    2. Creation of the directory tree

      Choose an installation directory: this will be your "squale_base_directory".

      In the distrib archive, copy everything located in "03-squalix-files/squale-home" into your "squale_base_directory" folder. You will have a directory tree that looks like:

      <squale_base_directory>
         |-- SqualeWeb
         `-- Squalix
                |
                |-- bin
                |   |-- squalix-XXX-batch-package.zip
                |   |-- lib-ext/
                |   `-- lib/
                |-- data
                `-- logs
      
    3. Add the JDBC driver JAR for your database

      You have to copy the JDBC driver JAR in the "Squalix/bin/lib-ext".

    4. Create SQUALE_HOME environment variable

      Set and export the SQUALE_HOME environment variable (replace squale_base_directory by the absolute path of the directory you chose earlier):

              export SQUALE_HOME=<squale_base_directory>
      
    5. Compilation tools
      1. Ant compilation

        Ant 1.7.1 is embedded in Squalix. So there is nothing to install in this case.

        See here for some informations on how do an ant compilation in Squale.

      2. Maven compilation

        To perform a maven compilation with Squalix, you have to install maven. For this please refer to the Maven documentation

        Do not forget to set and export the environment variables for Maven.

        See here for some informations on how do a maven compilation in Squale.

  2. Squalix configuration

    Before using Squalix, some files should be configured.

    1. Configure the files in the "bin" directory

      As you have defined your own squalix server(s) during database installation, you must customize the "startBatch.sh" file.

      You have to modify the "case" statement so that the "hostId" variable has the good value (the good server id) according to the hostname of the servers you defined in the database.

    2. Configure the files in the "bin/config" directory
      1. hibernate.cfg.xml

        Define the database connection :

                <property name="connection.provider_class">
                        org.hibernate.connection.DriverManagerConnectionProvider
                </property>
                
                <property name="connection.username">XXX</property> 
                <!--XXX is the login of a user of the database -->
                  
                <property name="connection.password">YYY</property>
                <!-- YYY is the password of the user of the database.-->
                
                <property name="connection.url"> ... </property>
                <!-- For MySQL  : jdbc:mysql://serverName:port/scheme -->
                <!-- For Oracle : jdbc:oracle:thin:@serverName:port:scheme -->
                
                <property name="connection.driver_class"> ... </property>
                <!-- For MySQL : com.mysql.jdbc.Driver -->
                <!-- For Oracle : oracle.jdbc.OracleDriver -->  
                                
                <property name="dialect"> ... </property>
                <!-- For MySQL : org.hibernate.dialect.MySQLInnoDBDialect -->
                <!-- For Oracle : org.hibernate.dialect.OracleDialect -->        
                
                                 
                <property name="hibernate.transaction.factory_class">
                        org.hibernate.transaction.JDBCTransactionFactory
                </property>
                
                <property name="jdbc.use_streams_for_binary">true</property>
        
      2. compiling-config.xml

        Tags <bootclasspath ...>: you should indicate the rt.jar location for each jdk.

  3. Squalix is now ready

    Once you will have defined your projects and schedule analyses, you will be able to launch Squalix by executing the <squale_base_directory>/Squalix/bin/startBatch.sh script.

    The squalix launch comes with three options :

    • -debug : launches the application in debug mode
    • -cronExpression "..." : sets the application to be launched at a specific time and at a specific interval given by the Cron-Expression
    • -cron : sets the application to be launched at a specific time and at a specific interval by using a default Cron-Expression.

    For the -cron option, Squalix looks for in an XML configuration file (quartz-timer-config.xml) located in the <squale_base_directory>/Squalix/bin/config folder. By default in this file the expression is : "0/30 * * * * ?". That means a Squalix job would be launched every 30 seconds. If the cron-Expression can not be found in the xml file, then the default cron-Expression will be "0 0/30 * * * ?". That means Squalix job would be launched every half hour for an undefined period (every :00 and :30)

    See the documentation of quartz for informations on the Cron-Expression.

Now all modules of Squale are ready. Next step is to configure Squale.