Build Integration


For Mavenized projects, little needs to be done. Simply add the dependency on junit-benchmarks to POM's dependencies:


Stable releases are pushed to Maven Central (up from version 0.2.1). Snapshot and release versions are available from SonaType's public Maven repositories:

        <name>SonaType public snapshots and releases repository</name>
            <!-- set to true if you wish to fetch releases from this repo too. -->

Once completed, your tests can start using benchmarking annotations.

For charts and H2 results persistence, an additional dependency on H2 must be added to your project (it is an optional dependency in junit-benchmark's POM.


Integration with ANT requires you to download a junit-benchmark release (or build it from sources). As with Maven, H2 needs to be downloaded separately, if it's to be used.

Then, you can simply create a path reference to the above JAR files:

<path id="jub">
    <fileset dir="lib">
      <include name="junit-benchmarks*.jar" />
      <include name="h2*.jar" />

and reference this path from junit or javac tasks.

Run your tests with fork attribute set to true and forkmode set to once. This ensures the test database is properly closed once the tests complete.