A Maven plugin for protecting against backwards incompatible changes to your gRPC .proto files.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
buildscripts
src
.gitignore
.travis.yml
LICENSE.txt
README.md
RELEASING.md
pom.xml

README.md

Build Status Maven Central

Protobuf Backwards Compatibility Check Maven Plugin

The proto-backwards-compatibility plugin is a Maven plugin to run a backwards compatibility check on a set of protobuf IDL files. The plugin can be integrated into various phases of a maven build to check that any changes to a set of .proto files are backwards compatible. This ensures that these changes do not impact existing users that haven't had a chance to update to these latest changes. A proto.lock file is created in the proto source directory to keep track of the state of the .proto files. This file is updated when a non-breaking change is made, and should be checked in along with any other changes.

It is also possible to force any breaking changes and reset the current state by deleting the proto.lock file. It will then reinitialize the next time the plugin is run.

Maintaining Backwards Compatibility

In order to maintain backwards compatibility for your set of .proto files, a few rules must be followed when making updates. Please refer here to avoid breaking changes: https://developers.google.com/protocol-buffers/docs/proto#backwards-compatibility

Configuration

The os-maven-plugin extension (https://github.com/trustin/os-maven-plugin) must be added to your project's pom.xml file in order for this plugin to work.

<build>
    <extensions>
        <extension>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.4.1.Final</version>
        </extension>
    </extensions>
    <plugins>
        <plugin>
            <groupId>com.salesforce.servicelibs</groupId>
            <artifactId>proto-backwards-compatibility</artifactId>
            <version>${proto-backwards-compatibility.version}</version>
            <configuration>
                <!-- Optional alternative protos location -->
                <protoSourceRoot>src/main/proto</protoSourceRoot>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>backwards-compatibility-check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Acknowledgements

Thank you to Steve Manuel for his protocol buffer compatiblity tracker which is a key component of this plugin: https://github.com/nilslice/protolock