symlink would work.

On my machine, I have the following:

-rwxr-xr-x  1 root  wheel  11756 Oct  2 10:34 /usr/local/bin/proto2
-rwxr-xr-x  1 root  wheel  17184 Oct  2 10:30 /usr/local/bin/proto30
-rwxr-xr-x  1 root  wheel  11756 Nov  2 20:42 /usr/local/bin/protoc
-rwxr-xr-x  1 root  wheel  17372 Oct  6 17:09 /usr/local/bin/protoc31

I use alias when I need to re-generate protobuf for 1.x branches:

alias pr2='proto2 -Isrc/main/protobuf --java_out=src/main/java '

FYI

On Fri, Dec 9, 2016 at 12:15 AM, 张铎 <[email protected]> wrote:

> In master we use protobuf-maven-plugin to run protoc. The plugin will
> download protoc binary from the maven repo so you do not need to install
> protoc on your machine manually.
>
> So you can just install pb 2.5 on your machine.
>
> For the general question that how to have 2 protobuf versions on one
> machine, I think you need to build protoc from source and install it
> manually, and use symbol link to select the prefered version before you run
> mvn command.
>
> Thanks.
>
> 2016-12-09 16:00 GMT+08:00 Stephen Jiang <[email protected]>:
>
> > master branch is in protobuf version 3.1; branch-1.1 is in protobuf
> version
> > 2.5
> >
> > I upgraded to version 3.1 in my machine so that I can work on master
> > branch; now I need to run the protobuf to generate file in branch-1.1 and
> > get the error:
> >
> > *[ERROR] Failed to execute goal
> > org.apache.hadoop:hadoop-maven-plugins:2.5.1:protoc (compile-protoc) on
> > project hbase-protocol: org.apache.maven.plugin.MojoExecutionException:
> > protoc version is 'libprotoc 3.1.0', expected version is '2.5.0' -> [Help
> > 1]*
> >
> > Is there a easy way to have 2 protobuf version side-by-side and specify
> in
> > mvn command?
> >
> > Thanks
> > Stephen
> >
>

Reply via email to