3.2. Configuration

3.2.1. Environment

  1. Download & unpack the ashkelon tarball

  2. Make sure your $JAVA_HOME environment variable is set

  3. Set up ASHK_HOME environment variable

    Example 3.1. Windows

          set ASHK_HOME=c:\ashkelon
                         

    Example 3.2. bash

          export ASHK_HOME=~/ashkelon
                         
  4. Add $ASHK_HOME/bin to your path:

          $ export PATH=$PATH:$ASHK_HOME/bin
                      

3.2.2. Configuration Files

3.2.2.1. SourceCache Base Path

In version 0.9 ashkelon now has the capability to auto-fetch API source code from either subversion or cvs version control systems. ashkelon therefore will use a temporary directory as the base path for keeping a cache of source code.

In the file src/org/ashkelon/ashkelon-config.xml, specify the base path that ashkelon will use for its source cache. If the path does not exist, ashkelon will attempt to create the specified directory.

3.2.2.2. Database Connection Information

[Note]Note

As you read this section, substitute the database type you'll be using (mysql or postgres) wherever you see the "placeholder" text ${dbtype}

  1. Edit db/ ${dbtype} /org/ashkelon/db/conn-info.properties to specify the proper database connection information:

          #
          dbtype=mysql
          jdbcDriverName=com.mysql.jdbc.Driver
          connectionURL=jdbc:mysql://localhost/ashkelon
          user=ashkelon
          password=ashkelon
                   

    or

          #
          dbtype=postgres
          jdbcDriverName=org.postgresql.Driver
          connectionURL=jdbc:postgresql://localhost/ashkelon
          user=ashkelon
          password=ashkelon
                   

3.2.3. Prepare Database

  1. Create the ashkelon database:

    Example 3.3. For mysql

          c:\> mysql -u root -p
          mysql> create database ashkelon;
          mysql> exit
          
                         

    Example 3.4. For postgresql

          ~$ createdb -U postgres ashkelon
                         
  2. Generate the schema. Run script: db/${dbtype} /org/ashkelon/db/init.sql

    Example 3.5. Using mysql

       c:\ashkelon> mysql -u root -p ashkelon 
                             < db\mysql\org\ashkelon\db\init.sql
                         

    Example 3.6. Using postgresql

          ~/ashkelon> psql -U ashkelon ashkelon
          ashkelon#= \i db/postgres/org/ashkelon/db/init.sql
          ashkelon#= \q
                         

3.2.4. Build ashkelon manager codebase

Build and create the ashkelon jar file:

Example 3.7. For mysql

      $ ant -Ddbtype=mysql jar-manager
                  

Example 3.8. For postgresql

      $ ant -Ddbtype=postgres jar-manager
                  

Rather than specify dbtype from the command line, feel free to edit the build.xml file directly. This way you won't have to remember how to construct your ant command line each time.

3.2.5. Verify "ashkelon" cmd works

Verify that the "ashkelon" command works. Invoke it with no parameters from the command line.

   $ ashkelon
            

should produce this help/usage screen

      Ashkelon Repository Manager (v 0.9)
      ----------
      Description:
        Manages a Java Documentation Repository.
        For more information, visit http://ashkelon.sourceforge.net/
   
      Examples:
        ashkelon reset
        ashkelon add hibernate.xml
        ashkelon list
        ashkelon remove Hibernate
        ashkelon html -d junit-javadocs apis/junit.xml
   
      Usage:
        ashkelon {command} [options]
   
        Valid commands:
   
          add         Add an API to repository
          remove      Remove specified API from the repository
          update      Update an API
          list        List APIs currently residing in the repository
          reset       Reset repository (i.e. delete everything, use with care)
          export      Dump list of APIs as XML to System.out
          html        Produce static HTML pages (with ashkelon look and feel)
   
      For command-specific help, type:
        ashkelon {command} -h
   
      Caveats:
        No work done yet to support J2SE 5.
      ----------
      Copyleft
            

3.2.6. Finish setting up database schema

   $ ashkelon reset