Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Configuration

skogler edited this page Feb 5, 2012 · 19 revisions

Warning: this is a work in progress

##Codesearch Configuration File

The main configuration for Codesearch is the codesearch_config.xml file.
This file should be located in the classpath; e.g. in the Apache Tomcat lib/ folder.

The following configurations must be defined:

  • Cache directory
  • Index directory

It is recommended to at least set up the following:

  • 1 repository
  • 1 index job
  • The searcher location

Optional configurations:

  • Available repositories
  • Repository groups

Example configuration:

There should always be an up to date example configuration at resources/codesearch_config.xml in case this doesn't work.

<root>
    <!-- 
    Database connection, used for storing code analysis data. 
    If no code navigation is needed, these fields can be left empty.
    -->
 	<database>
		<hostname>127.0.0.1</hostname>
		<port-number>3306</port-number>
		<database-name>codesearch</database-name>
		<protocol>mysql</protocol>
		<driver>com.mysql.jdbc.Driver</driver>
		<username>codesearch</username>
		<password></password>
		<max-connections>100</max-connections>
	</database> 
    
    <!-- The url of the searcher, used to notify the searcher of changes to the index -->
    <searcher-location>http://127.0.0.1:8080/searcher/</searcher-location>
    <!-- The directory that is used by version control plugins to store checked out repositories -->
    <cache-directory>/var/cache/codesearch/vcs/</cache-directory>
    <!-- The directory where the Lucene search index is stored -->
    <index-directory>/var/index/</index-directory>

    <!-- Blacklists use standard Java regular expressions that apply to the file path -->
    <global-blacklist-filenames>
        <filename>.*\.class</filename>
        <filename>.*\.o</filename>
        <filename>.*\.bin</filename>
    </global-blacklist-filenames>

    <!--
    Indexing jobs can be scheduled using cron expressions. 
    If no cron expressions are defined, the job is executed once at startup.
    
    The clear option specifies whether the index should be cleared before each execution.
    The names of the specified repositories must be separated by spaces.
    -->
    <index-jobs>
        <index-job>
            <repositories>codesearch jdownloader</repositories>
            <cron-expression>0 0 * * * ?</cron-expression>
            <clear>false</clear>
        </index-job>
    </index-jobs>

    <!-- 
    The repositories that can be used for indexing and searching. 
    The names of version control systems must be specified EXACTLY as in the corresponding plugin.
    Groups may be specified to organize a large number of repositories and can be used for 
    searching and in the manual indexing web interface.
    -->
    <repositories>
        <repository>
            <name>codesearch</name>
            <version-control-system>GIT</version-control-system>
            <authentication-data type='none'></authentication-data>
            <url>git://github.com/codesearch-github/codesearch.git</url>
            <code-navigation-enabled>true</code-navigation-enabled>
            <groups>java git</groups>
        </repository>
        <repository>
            <name>jdownloader</name>
            <version-control-system>SVN</version-control-system>
            <authentication-data type='none'></authentication-data>
            <url>svn://svn.jdownloader.org/jdownloader</url>
            <code-navigation-enabled>true</code-navigation-enabled>
            <groups>java svn</groups>
        </repository>
    </repositories>
</root>       

##Database Connection

Clone this wiki locally