Fork me on GitHub

Comparing against a specific artifact

By default, the Clirr Maven Plugin compares the current code against another version of the same project. In other words, the comparison artifact has the same artifactId and groupId as the project, but a different version.

The configuration parameter comparisonArtifacts allows you to replace this default with a set of specified other artifacts. This allows you to, for example, compare your project against another implementation of the same API. Or, if your project is a superset of several predecessors, you may choose to specify all the predecessor artifacts.

Here's how you would configure the clirr:check goal to compare your project against fooGroup:barProject-1.1.jar:

<project>
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>clirr-maven-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <comparisonArtifacts>
            <comparisonArtifact>
              <groupId>fooGroup</groupId>
              <artifactId>barProject</artifactId>
              <version>1.1</version>
            </comparisonArtifact>
          </comparisonArtifacts>
        </configuration>
      </plugin>
      ...
    </plugins>
  </build>
</project>

And here's the same configuration for the Clirr report:

<project>
  <reporting>
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>clirr-maven-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <comparisonArtifacts>
            <comparisonArtifact>
              <groupId>fooGroup</groupId>
              <artifactId>barProject</artifactId>
              <version>1.1</version>
            <comparisonArtifact>
          </comparisonArtifacts>
        </configuration>
      </plugin>
      ...
    </plugins>
  </reporting>
</project>