Skip to content

Instantly share code, notes, and snippets.

@rerorero
Created November 27, 2016 23:38
Show Gist options
  • Save rerorero/0adff161bb564712155931627e1814e9 to your computer and use it in GitHub Desktop.
Save rerorero/0adff161bb564712155931627e1814e9 to your computer and use it in GitHub Desktop.
proto-pom-example
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<protobuf-java.version>3.1.0</protobuf-java.version>
<protoc-jar-maven-plugin.version>3.1.0</protoc-jar-maven-plugin.version>
<protoc-jar-maven-plugin.protocVersion>3.1.0</protoc-jar-maven-plugin.protocVersion>
</properties>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf-java.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>${protoc-jar-maven-plugin.version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<protocVersion>${protoc-jar-maven-plugin.protocVersion}</protocVersion>
<addSources>none</addSources>
<outputDirectory>src/main/java</outputDirectory>
<inputDirectories>
<include>src/main/resources/protobuf</include>
</inputDirectories>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment