Skip to content
asoldano edited this page Oct 6, 2010 · 5 revisions

Sibilla Maven Plugin How To

Introduction

We provide a Maven plugin for automatically running Sibilla in user project builds. This way you can trigger a Sibilla run by simply issuing a mvn command, the same way you build up the project.

Details

Currently the Sibilla plugin is meant to be run in the process-test-classes phase. That's because the plugin requires all the classes (including tests) to have already been compiled.

This means that you either need to run the plugin at the right time with a direct invocation (mvn sibilla:sibilla) or bind it to the process-test-classes as show in the example below (and run maven till that phase, mvn process-test-classes).

    <groupId>it.javalinux.sibilla.plugins</groupId>

    <artifactId>maven-sibilla-plugin</artifactId>

    <version>1.0.0-SNAPSHOT</version>

    <configuration>

      <verbose>true</verbose>

      <staleMillis>100</staleMillis>

      <runnerClass>it.javalinux.sibilla.runner.impl.JunitTestRunner</runnerClass>

    </configuration>

    <executions>

    <execution>

      <phase>process-test-classes</phase>

      <goals>

        <goal>sibilla</goal>

      </goals>

    </execution>

    </executions>

  </plugin>

This is an example of how you can add the Sibilla Maven plugin to your own project's pom.xml. In this case the 1.0.0-SNAPSHOT version of the plugin is used for running the Sibilla engine using the JunitTestRunner. The plugin automatically detects changed classes (including tests) and feeds them to the engine. The staleMillis parameter tells the plugin how many millisecs should pass from a class' last modification to consider it as a changed one.

Of course the plugin has many optional parameters for fine tuning what classes to include, exclude etc. in the run. Please take a look at the it.javalinux.sibilla.plugins.SibillaMojo for all the available configuration details.

Finally, if you're directly invoking the plugin, please remember that in order to simply use mvn sibilla:sibilla, you need to edit your ~/.m2/settings.xml adding:

<pluginGroup>it.javalinux.sibilla.plugins</pluginGroup>

otherwise you're required to specify the full artifact id, group and version:

mvn it.javalinux.sibilla.plugins:maven-sibilla-plugin:1.0-SNAPSHOT:sibilla

Clone this wiki locally