igor-petruk/protobuf-maven-plugin — pull request #18 by zsxwing (2013-09-10 09:08:05+00:00)
Title: Add a flexible version validation

Hi,

I added a flexible version validation feature to help users specify how to validate the versions of `protoc` and `protobuf-java`.

A protobuf version is something like `major.minor.revision`. For example, if the version is `2.4.1`, major = 2, minor = 4, revision = 1. Users can use `protobufVersionValidationStrategy` to set there kinds of validation strategy: `major`, `minor`, `all`.
* major: Only validate the major part. If the major parts of two versions are same, they pass the validation.
* minor: Validate the major and minor parts. If the major and minor parts of two versions are same, they pass the validation.
* all: Validate if two versions are same.

I added this option because we encountered some special requirement. We use `protobuf-java 2.4.0a` in our project, but my coworkers use `protoc 2.4.1` which is got from https://code.google.com/p/protobuf/. `2.4.1` is very popular in many Linux distributions. We do not want to use `ignoreVersions` as we want to allow any `2.4.*` but reject any `2.3.*` or `2.5.*`. With `protobufVersionValidationStrategy`, we can solve this issue.

Please take a look at my pull request. Thanks.