Giter Site home page Giter Site logo

kelnos / mima-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 4.0 65 KB

Maven plugin for MiMa, a tool for catching binary incompatibility in Scala (https://github.com/lightbend/mima)

License: BSD 3-Clause "New" or "Revised" License

Scala 90.14% Makefile 1.84% Java 5.27% Shell 2.74%
maven mima scala plugin

mima-maven-plugin's Introduction

mima-maven-plugin

This is a Maven plugin that allows you to check your Scala project against a previous version of the project for binary incompatibilities that you may have introduced. This plugin is just a shell; the heavy lifting is done by the core of MiMa.

Releases here will match the version of the corresponding MiMa release. If extra releases of this plugin are required for a given MiMa version, a fourth version component will be added to the plugin's version number.

Usage

<build>
  <plugins>
    <plugin>
      <groupId>org.spurint.maven.plugins</groupId>
      <artifactId>mima-maven-plugin</artifactId>
      <version>${mima-maven-plugin.version}</version>
      <executions>
        <execution>
          <id>check-abi</id>
          <goals>
            <goal>check-abi</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

In general, the out-of-the-box configuration should have sane defaults and will do what you want. The maven plugin differs a bit in configuration from the sbt plugin, since we can't write arbitrary code to provide as configuration as we could with sbt.

This plugin, by default, will figure out the previous version to use for comparison by fetching the maven-metadata.xml file for the artifact being built from whatever remote repositories are defined in your POM (which is just maven central if you haven't defined any). It finds the latest release version from that metadata file, and then attempts to fetch that version of the artifact from the remote repository.

For allowing/disallowing binary incompatibilities, the plugin's default configuration follows the rules set out in Semantic Versioning, namely:

  1. If the version's major number is 0 (as in, 0.4.21), binary incompatibilities are only allowed if the minor version has been bumped (as in, 4 -> 5).
  2. Otherwise (as in, 2.0.4), binary incompatibilities are only allowed if the major version has been bumped (as in, 2 -> 3).

Configuration

Name Default Description
previousArtifact latest-release If set to latest-release, will attempt to determine the most recent released version as described above; otherwise, this can be set to a specific version of an artifact.
failOnProblem semver If set to semver, the previous artifact version is compared with the current version, and whether or not incompatibilities will cause the build to fail is decided based on Semantic Versioning rules, as described above. If set to never or false, binary incompatibilities are never allowed, while always or true will put the plugin into warn-only mode.
failOnNoPrevious false Whether or not to fail the build if a previous artifact version is not supplied or cannot be found.
readTimeout 4000 Timeout in ms to fetch the previous artifact.
direction backward Whether to do backward compatibilities checks, forward compatibility checks, or both.
filters (none) A list of <filter> elements that allow you to ignore particular problems (see below).

Filters

Filters allow you to ignore particular problems (perhaps for changes in internal non-public classes that nevertheless need to be public). To specify a filter, you can add something like:

<configuration>
  ...
  <filters>
    <filter>
      <name>DirectMissingMethodProblem</name>
      <value>com.example.Foo.create</value>
    </filter>
  </filters>
  ...
</configuration>

The name property comes from one of the ProblemRef subclasses, which you can discover by taking a look at the MiMa core source.

When a binary issue is reported as an error, it will also print out a "filter with:" line that shows the exact filter definition to use to suppress the error.

mima-maven-plugin's People

Contributors

dependabot[bot] avatar kelnos avatar scala-steward avatar sullis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.