8000 Use maven-protoc-plugin and proto 2.6.1 · mnmlist/google-http-java-client@ba00f3b · GitHub
[go: up one dir, main page]

Skip to content

Commit ba00f3b

Browse files
committed
Use maven-protoc-plugin and proto 2.6.1
protoc 2.6.1 is available on Maven Central and maven-protoc-plugin can automatically run it as part of the build. This prevents needing to build protoc yourself and worrying about which protoc is in your PATH.
1 parent dc36cc9 commit ba00f3b

File tree

5 files changed

+33
-62
lines changed

5 files changed

+33
-62
lines changed

.buildscript/build-proto.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@ language: java
55
notifications:
66
email: false
77

8-
env:
9-
global:
10-
- PROTO_VERSION=2.4.1
11-
- PATH="/tmp/proto$PROTO_VERSION/bin:$PATH"
12-
138
jdk:
149
- oraclejdk8
1510
- openjdk7
1611
- openjdk6
17-
18-
before_install:
19-
- .buildscript/build-proto.sh $PROTO_VERSION
20-
21-
cache:
22-
directories:
23-
- /tmp/proto$PROTO_VERSION

google-http-client-protobuf/pom.xml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
<name>Protocol Buffer extensions to the Google HTTP Client Library for Java.</name>
1212

1313
<build>
14+
<extensions>
15+
<extension>
16+
<groupId>kr.motd.maven</groupId>
17+
<artifactId>os-maven-plugin</artifactId>
18+
<version>1.4.0.Final</version>
19+
</extension>
20+
</extensions>
1421
<plugins>
1522
<plugin>
1623
<artifactId>maven-javadoc-plugin</artifactId>
@@ -35,42 +42,17 @@
3542
</executions>
3643
</plugin>
3744
<plugin>
38-
<artifactId>maven-antrun-plugin</artifactId>
39-
<executions>
40-
<execution>
41-
<id>generate-sources</id>
42-
<phase>generate-sources</phase>
43-
<configuration>
44-
<target>
45-
<mkdir dir="target/generated-test-sources" />
46-
<exec failonerror="true" executable="protoc">
47-
<arg value="--java_out=target/generated-test-sources" />
48-
<arg value="src/test/java/com/google/api/client/protobuf/simple_proto.proto" />
49-
</exec>
50-
</target>
51-
</configuration>
52-
<goals>
53-
<goal>run</goal>
54-
</goals>
55-
</execution>
56-
</executions>
57-
</plugin>
58-
<plugin>
59-
<groupId>org.codehaus.mojo</groupId>
60-
<artifactId>build-helper-maven-plugin</artifactId>
61-
<version>1.5</version>
45+
<groupId>com.google.protobuf.tools</groupId>
46+
<artifactId>maven-protoc-plugin</artifactId>
47+
<version>0.4.2</version>
48+
<configuration>
49+
<protocArtifact>com.google.protobuf:protoc:${project.protobuf-java.version}-build2:exe:${os.detected.classifier}</protocArtifact>
50+
</configuration>
6251
<executions>
6352
<execution>
64-
<id>add-test-source</id>
65-
<phase>generate-test-sources</phase>
6653
<goals>
67-
<goal>add-test-source</goal>
54+
<goal>test-compile</goal>
6855
</goals>
69-
<configuration>
70-
<sources>
71-
<source>target/generated-test-sources</source>
72-
</sources>
73-
</configuration>
7456
</execution>
7557
</executions>
7658
</plugin>

pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@
8888
<module>samples/googleplus-simple-cmdline-sample</module>
8989
</modules>
9090

91+
<pluginRepositories>
92+
<pluginRepository>
93+
<releases>
94+
<updatePolicy>never</updatePolicy>
95+
</releases>
96+
<snapshots>
97+
<enabled>false</enabled>
98+
</snapshots>
99+
<id>central</id>
100+
<name>Central Repository</name>
101+
<url>https://repo.maven.apache.org/maven2</url>
102+
</pluginRepository>
103+
<pluginRepository>
104+
<id>protoc-plugin</id>
105+
<url>https://dl.bintray.com/sergei-ivanov/maven/</url>
106+
</pluginRepository>
107+
</pluginRepositories>
108+
91109
<!--
92110
If you change the version of a dependency, make sure to update the javadoc
93111
links if required, and any javadoc links of your dependency in the oauth and
@@ -590,7 +608,7 @@
590608
<project.gson.version>2.1</project.gson.version>
591609
<project.jackson-core-asl.version>1.9.11</project.jackson-core-asl.version>
592610
<project.jackson-core2.version>2.1.3</project.jackson-core2.version>
593-
<project.protobuf-java.version>2.4.1</project.protobuf-java.version>
611+
<project.protobuf-java.version>2.6.1</project.protobuf-java.version>
594612
<project.guava.version>17.0</project.guava.version>
595613
<project.xpp3.version>1.1.4c</project.xpp3.version>
596614
<project.commons-logging.version>1.1.1</project.commons-logging.version>

0 commit comments

Comments
 (0)
0