<commit_before>Maven
-----

Diffa is maven built using Maven. Currently version 3.0.3 is supported.

Maven Proxy
-----------

In order to download artifacts not available in Maven central, you can use the Diffa repository. To do so,
add the following to your $M2_HOME/settings.xml:

In the profiles block:
    <profile>
      <id>diffa-repo</id>
      <repositories>
        <repository>
          <id>diffa</id>
          <url>https://nexus.lshift.net/nexus/content/groups/public</url>
        </repository>
      </repositories>

      <pluginRepositories>
        <pluginRepository>
          <id>diffa</id>
          <url>https://nexus.lshift.net/nexus/content/groups/public</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

And in the activeProfiles block:
    <activeProfile>diffa-repo</activeProfile>


Scala
-----

Diffa is written mostly in Scala. Due to Scala's class post-processing mechanism, we tend to find that the default Perm Gen settings get exhausted quite quickly.
So before you perform any of the Maven commands, please give the JVM a little more Perm Gen:

On Unix:

    export MAVEN_OPTS=-XX:MaxPermSize=512m

Or on Windows:

    set MAVEN_OPTS=-XX:MaxPermSize=512m

This is also documented in the README.maven_opts.txt file for an easy copy and paste.

Building
--------

Please do not overlook the previous note about perm gen. To build Diffa, just use the mvn install command from the root directory:

    $ mvn install

This will run the the test suite that comes with Diffa.


To verify against a database other than the default (hsqldb), follow the instructions below.

* Oracle DBMS
Note: please refer to the README for further details on using this profile.

Set profile to 'oracle' (-Poracle)
Set these parameters (either MAVEN_OPTS="-Dparam1 -Dparam2 ..." or mvn -Dparam1 -Dparam2 ...)
  diffa.jdbc.driver=oracle.jdbc.OracleDriver
  diffa.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
  diffa.jdbc.sys.url=<URL of the target Oracle database instance>
  diffa.jdbc.sys.username=<username of a privileged Oracle database user>
  diffa.jdbc.sys.password=<password of the <PASSWORD>>
  diffa.jdbc.url=<same as diffa.jdbc.sys.url>
  diffa.jdbc.username=<username of the owner of the diffa agent database>
  diffa.jdbc.password=<the owning user's password>

Note on diffa.jdbc.sys.username
The user identified by this username must have privileges to create a schema
and grant create session and dba privileges.  This user is only needed for
testing; in a production environment, the application database user is
provisioned manually with suitable privileges.

Note on diffa.jdbc.username/password
This user is created during the testing/verification process.  The user MUST
NOT be the same as diffa.jdbc.sys.username.


* MySQL
Set profile to 'mysql' (-Pmysql)
Set these parameters (either MAVEN_OPTS="-Dparam1 -Dparam2 ..." or mvn -Dparam1 -Dparam2 ...)
  diffa.jdbc.driver=com.mysql.jdbc.Driver
  diffa.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  diffa.jdbc.dbname=<name of the diffa agent database to create>
  diffa.jdbc.sys.url=<URL of the base MySQL instance (without database name)>
  diffa.jdbc.sys.username=<username of a privileged MySQL database user (will
                          create the db owner)>
  diffa.jdbc.sys.password=<password of the above <PASSWORD>>
  diffa.jdbc.url=<URL of the target MySQL database (with database name)>
  diffa.jdbc.username=<username of the owner of the diffa agent database>
  diffa.jdbc.password=<<PASSWORD>>


Booting The Agent
-----------------

The Diffa agent can be run using the Jetty plugin:

    $ cd agent
    $ mvn jetty:run

License Checking
----------------

Diffa uses the maven license plugin (http://code.google.com/p/maven-license-plugin/) to check that the license files are up to date.

To run the license check:

    $ mvn -e license:format -Dyear=2010-2011

To reformat each file according to the header file:

    $ mvn -e license:format -Dyear=2010-2011
<commit_msg>Fixed the documentation of using the license checker.<commit_after>Maven
-----

Diffa is maven built using Maven. Currently version 3.0.3 is supported.

Maven Proxy
-----------

In order to download artifacts not available in Maven central, you can use the Diffa repository. To do so,
add the following to your $M2_HOME/settings.xml:

In the profiles block:
    <profile>
      <id>diffa-repo</id>
      <repositories>
        <repository>
          <id>diffa</id>
          <url>https://nexus.lshift.net/nexus/content/groups/public</url>
        </repository>
      </repositories>

      <pluginRepositories>
        <pluginRepository>
          <id>diffa</id>
          <url>https://nexus.lshift.net/nexus/content/groups/public</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>

And in the activeProfiles block:
    <activeProfile>diffa-repo</activeProfile>


Scala
-----

Diffa is written mostly in Scala. Due to Scala's class post-processing mechanism, we tend to find that the default Perm Gen settings get exhausted quite quickly.
So before you perform any of the Maven commands, please give the JVM a little more Perm Gen:

On Unix:

    export MAVEN_OPTS=-XX:MaxPermSize=512m

Or on Windows:

    set MAVEN_OPTS=-XX:MaxPermSize=512m

This is also documented in the README.maven_opts.txt file for an easy copy and paste.

Building
--------

Please do not overlook the previous note about perm gen. To build Diffa, just use the mvn install command from the root directory:

    $ mvn install

This will run the the test suite that comes with Diffa.


To verify against a database other than the default (hsqldb), follow the instructions below.

* Oracle DBMS
Note: please refer to the README for further details on using this profile.

Set profile to 'oracle' (-Poracle)
Set these parameters (either MAVEN_OPTS="-Dparam1 -Dparam2 ..." or mvn -Dparam1 -Dparam2 ...)
  diffa.jdbc.driver=oracle.jdbc.OracleDriver
  diffa.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
  diffa.jdbc.sys.url=<URL of the target Oracle database instance>
  diffa.jdbc.sys.username=<username of a privileged Oracle database user>
  diffa.jdbc.sys.password=<password of the above <PASSWORD>>
  diffa.jdbc.url=<same as diffa.jdbc.sys.url>
  diffa.jdbc.username=<username of the owner of the diffa agent database>
  diffa.jdbc.password=<<PASSWORD>>

Note on diffa.jdbc.sys.username
The user identified by this username must have privileges to create a schema
and grant create session and dba privileges.  This user is only needed for
testing; in a production environment, the application database user is
provisioned manually with suitable privileges.

Note on diffa.jdbc.username/password
This user is created during the testing/verification process.  The user MUST
NOT be the same as diffa.jdbc.sys.username.


* MySQL
Set profile to 'mysql' (-Pmysql)
Set these parameters (either MAVEN_OPTS="-Dparam1 -Dparam2 ..." or mvn -Dparam1 -Dparam2 ...)
  diffa.jdbc.driver=com.mysql.jdbc.Driver
  diffa.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  diffa.jdbc.dbname=<name of the diffa agent database to create>
  diffa.jdbc.sys.url=<URL of the base MySQL instance (without database name)>
  diffa.jdbc.sys.username=<username of a privileged MySQL database user (will
                          create the db owner)>
  diffa.jdbc.sys.password=<password of <PASSWORD> above <PASSWORD>>
  diffa.jdbc.url=<URL of the target MySQL database (with database name)>
  diffa.jdbc.username=<username of the owner of the diffa agent database>
  diffa.jdbc.password=<the owning user's password>


Booting The Agent
-----------------

The Diffa agent can be run using the Jetty plugin:

    $ cd agent
    $ mvn jetty:run

License Checking
----------------

Diffa uses the maven license plugin (http://code.google.com/p/maven-license-plugin/) to check that the license files are up to date.

To run the license check:

    $ mvn -e license:format -Dyear=2012

To reformat each file according to the header file:

    $ mvn -e license:format -Dyear=2012

{'fraction_non_alphanumeric': 0.09496100037142503, 'fraction_numerical': 0.008171350749040485, 'mean_word_length': 3.394994559303591, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 80, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2912509', 'n_tokens_mistral': 2561, 'n_tokens_neox': 2370, 'n_words': 892}