Friday, February 10, 2012

Google Protobuf Maven Plugin

Recently I have a Maven plugin, that allows you to compile Google Protobuf proto files with Maven. The Main difference form other plugins that it works.

Enjoy http://igor-petruk.github.com/protobuf-maven-plugin/

Future release will download protoc.exe automatically.

Usage:

Put your *.proto to src/main/protobuf and don't forget to add 'protoc' to your path. (version 2.4.0 in this example)
<dependencies>
        <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>2.4.0a</version>
        </dependency>
</dependencies>
<build>
        <plugins>
                <plugin>
                        <groupId>com.github.igor-petruk.protobuf</groupId>
                        <artifactId>protobuf-maven-plugin</artifactId>
                        <version>0.6.2</version>
                        <executions>
                                <execution>
                                        <goals>
                                                <goal>run</goal>
                                        </goals>
                                </execution>
                        </executions>
                </plugin>
        </plugins>
</build>

No comments:

Post a Comment