xref: /aosp_15_r20/external/sdk-platform-java/gapic-generator-java/pom.xml (revision 882aa7c72c3cd3b66e72a261bdd69b93f7de7670)
1<project xmlns="http://maven.apache.org/POM/4.0.0"
2  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4  <modelVersion>4.0.0</modelVersion>
5  <groupId>com.google.api</groupId>
6  <artifactId>gapic-generator-java</artifactId>
7  <version>2.19.0</version><!-- {x-version-update:gapic-generator-java:current} -->
8  <name>GAPIC Generator Java</name>
9  <description>GAPIC generator Java</description>
10
11  <properties>
12    <checkstyle.skip>true</checkstyle.skip>
13    <animal.sniffer.skip>true</animal.sniffer.skip>
14    <clirr.skip>true</clirr.skip>
15    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16    <!-- Should be in sync with repositories.bzl -->
17    <googleapis.commit>44d6bef0ca6db8bba3fb324c8186e694bcc4829c</googleapis.commit>
18    <auto-value.version>1.10.1</auto-value.version>
19    <maven.compiler.source>1.8</maven.compiler.source>
20    <maven.compiler.target>1.8</maven.compiler.target>
21  </properties>
22
23  <parent>
24    <groupId>com.google.api</groupId>
25    <artifactId>gapic-generator-java-pom-parent</artifactId>
26    <version>2.19.0</version><!-- {x-version-update:gapic-generator-java:current} -->
27    <relativePath>../gapic-generator-java-pom-parent</relativePath>
28  </parent>
29
30  <dependencyManagement>
31    <dependencies>
32      <dependency>
33        <groupId>com.google.api</groupId>
34        <artifactId>gapic-generator-java-bom</artifactId>
35        <version>2.19.0</version><!-- {x-version-update:gapic-generator-java:current} -->
36        <type>pom</type>
37        <scope>import</scope>
38      </dependency>
39    </dependencies>
40  </dependencyManagement>
41
42  <profiles>
43    <profile>
44      <!-- profile for nexus-staging:release invocation -->
45      <id>release-staging-repository</id>
46      <activation>
47        <property>
48          <!-- The root project not using nexus-staging-maven-plugin when signing -->
49          <name>!gpg.executable</name>
50        </property>
51      </activation>
52      <distributionManagement>
53        <snapshotRepository>
54          <id>sonatype-nexus-snapshots</id>
55          <url>https://google.oss.sonatype.org/content/repositories/snapshots</url>
56        </snapshotRepository>
57        <repository>
58          <id>sonatype-nexus-staging</id>
59          <url>https://google.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
60        </repository>
61      </distributionManagement>
62      <build>
63        <plugins>
64          <plugin>
65            <!-- The root project runs nexus-staging:release task -->
66            <groupId>org.sonatype.plugins</groupId>
67            <artifactId>nexus-staging-maven-plugin</artifactId>
68            <version>1.6.13</version>
69            <extensions>true</extensions>
70            <configuration>
71              <serverId>sonatype-nexus-staging</serverId>
72              <nexusUrl>https://google.oss.sonatype.org/</nexusUrl>
73              <autoReleaseAfterClose>false</autoReleaseAfterClose>
74            </configuration>
75          </plugin>
76        </plugins>
77      </build>
78    </profile>
79
80    <!-- Skip gapic-generator-java when analyzing showcase test coverage on SonarCloud   -->
81    <profile>
82      <id>showcase-sonar-analysis</id>
83      <activation>
84        <property>
85          <name>enableShowcaseTestCoverage</name>
86        </property>
87      </activation>
88      <properties>
89        <sonar.skip>true</sonar.skip>
90      </properties>
91    </profile>
92  </profiles>
93
94  <build>
95    <extensions>
96      <extension>
97        <groupId>kr.motd.maven</groupId>
98        <artifactId>os-maven-plugin</artifactId>
99        <version>1.7.1</version>
100      </extension>
101    </extensions>
102
103    <plugins>
104      <plugin>
105        <groupId>org.codehaus.mojo</groupId>
106        <artifactId>flatten-maven-plugin</artifactId>
107      </plugin>
108      <plugin>
109        <artifactId>maven-compiler-plugin</artifactId>
110        <version>3.11.0</version>
111        <configuration>
112          <source>8</source>
113          <target>8</target>
114          <annotationProcessorPaths>
115            <path>
116              <groupId>com.google.auto.value</groupId>
117              <artifactId>auto-value</artifactId>
118              <version>${auto-value.version}</version>
119            </path>
120          </annotationProcessorPaths>
121        </configuration>
122      </plugin>
123
124      <plugin>
125        <groupId>com.coveo</groupId>
126        <artifactId>fmt-maven-plugin</artifactId>
127        <version>2.9.1</version>
128      </plugin>
129
130      <plugin>
131        <groupId>com.googlecode.maven-download-plugin</groupId>
132        <artifactId>download-maven-plugin</artifactId>
133        <version>1.6.8</version>
134        <executions>
135          <execution>
136            <id>download-metadata-proto</id>
137            <phase>generate-sources</phase>
138            <goals>
139              <goal>wget</goal>
140            </goals>
141            <configuration>
142              <url>
143                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/gapic/metadata/gapic_metadata.proto
144              </url>
145              <outputDirectory>target/generated-sources/proto</outputDirectory>
146            </configuration>
147          </execution>
148          <execution>
149            <id>download-common-resources-proto</id>
150            <phase>generate-test-sources</phase>
151            <goals>
152              <goal>wget</goal>
153            </goals>
154            <configuration>
155              <url>
156                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/cloud/common_resources.proto
157              </url>
158              <outputDirectory>target/generated-test-sources/proto</outputDirectory>
159            </configuration>
160          </execution>
161          <execution>
162            <id>download-pubsub-proto</id>
163            <phase>generate-test-sources</phase>
164            <goals>
165              <goal>wget</goal>
166            </goals>
167            <configuration>
168              <url>
169                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/pubsub.proto
170              </url>
171              <outputDirectory>target/generated-test-sources/proto</outputDirectory>
172            </configuration>
173          </execution>
174          <execution>
175            <id>download-schema-proto</id>
176            <phase>generate-test-sources</phase>
177            <goals>
178              <goal>wget</goal>
179            </goals>
180            <configuration>
181              <url>
182                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/pubsub/v1/schema.proto
183              </url>
184              <outputDirectory>target/generated-test-sources/proto/google/pubsub/v1
185              </outputDirectory>
186            </configuration>
187          </execution>
188          <execution>
189            <id>download-logging-proto</id>
190            <phase>generate-test-sources</phase>
191            <goals>
192              <goal>wget</goal>
193            </goals>
194            <configuration>
195              <url>
196                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging.proto
197              </url>
198              <outputDirectory>target/generated-test-sources/proto</outputDirectory>
199            </configuration>
200          </execution>
201          <execution>
202            <id>download-log-entry-proto</id>
203            <phase>generate-test-sources</phase>
204            <goals>
205              <goal>wget</goal>
206            </goals>
207            <configuration>
208              <url>
209                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/log_entry.proto
210              </url>
211              <outputDirectory>target/generated-test-sources/proto/google/logging/v2
212              </outputDirectory>
213            </configuration>
214          </execution>
215          <execution>
216            <id>download-logging-config-proto</id>
217            <phase>generate-test-sources</phase>
218            <goals>
219              <goal>wget</goal>
220            </goals>
221            <configuration>
222              <url>
223                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_config.proto
224              </url>
225              <outputDirectory>target/generated-test-sources/proto/google/logging/v2
226              </outputDirectory>
227            </configuration>
228          </execution>
229          <execution>
230            <id>download-logging-metrics-proto</id>
231            <phase>generate-test-sources</phase>
232            <goals>
233              <goal>wget</goal>
234            </goals>
235            <configuration>
236              <url>
237                https://raw.githubusercontent.com/googleapis/googleapis/${googleapis.commit}/google/logging/v2/logging_metrics.proto
238              </url>
239              <outputDirectory>target/generated-test-sources/proto/google/logging/v2
240              </outputDirectory>
241            </configuration>
242          </execution>
243        </executions>
244      </plugin>
245
246      <plugin>
247        <groupId>org.xolstice.maven.plugins</groupId>
248        <artifactId>protobuf-maven-plugin</artifactId>
249        <version>0.6.1</version>
250        <configuration>
251          <protocArtifact>
252            com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
253          </protocArtifact>
254        </configuration>
255        <executions>
256          <execution>
257            <id>compile-protos</id>
258            <goals>
259              <goal>compile</goal>
260            </goals>
261            <configuration>
262              <protoSourceRoot>src/main/proto</protoSourceRoot>
263            </configuration>
264          </execution>
265          <execution>
266            <id>compile-downloaded-protos</id>
267            <goals>
268              <goal>compile</goal>
269            </goals>
270            <configuration>
271              <protoSourceRoot>target/generated-sources/proto</protoSourceRoot>
272              <clearOutputDirectory>false</clearOutputDirectory>
273            </configuration>
274          </execution>
275          <execution>
276            <id>compile-test-protos</id>
277            <goals>
278              <goal>test-compile</goal>
279            </goals>
280            <configuration>
281              <protoTestSourceRoot>src/test/proto</protoTestSourceRoot>
282              <writeDescriptorSet>true</writeDescriptorSet>
283              <includeSourceInfoInDescriptorSet>true</includeSourceInfoInDescriptorSet>
284              <includeDependenciesInDescriptorSet>true</includeDependenciesInDescriptorSet>
285              <descriptorSetFileName>test-proto.descriptorset</descriptorSetFileName>
286            </configuration>
287          </execution>
288          <execution>
289            <id>compile-downloaded-test-protos</id>
290            <goals>
291              <goal>test-compile</goal>
292            </goals>
293            <configuration>
294              <protoTestSourceRoot>target/generated-test-sources/proto</protoTestSourceRoot>
295              <clearOutputDirectory>false</clearOutputDirectory>
296            </configuration>
297          </execution>
298        </executions>
299      </plugin>
300      <plugin>
301        <groupId>org.apache.maven.plugins</groupId>
302        <artifactId>maven-jar-plugin</artifactId>
303        <executions>
304          <execution>
305            <goals>
306              <goal>test-jar</goal>
307            </goals>
308            <configuration>
309              <skip>true</skip>
310            </configuration>
311          </execution>
312        </executions>
313      </plugin>
314      <plugin>
315        <groupId>org.apache.maven.plugins</groupId>
316        <artifactId>maven-surefire-plugin</artifactId>
317        <version>3.0.0</version>
318        <configuration>
319          <additionalClasspathElements>
320            <additionalClasspathElement>
321              target/generated-test-resources/protobuf/descriptor-sets
322            </additionalClasspathElement>
323          </additionalClasspathElements>
324        </configuration>
325      </plugin>
326
327      <!-- Code coverage for SonarCloud -->
328      <plugin>
329        <groupId>org.jacoco</groupId>
330        <artifactId>jacoco-maven-plugin</artifactId>
331        <version>0.8.8</version>
332        <executions>
333          <execution>
334            <goals>
335              <goal>prepare-agent</goal>
336            </goals>
337          </execution>
338          <execution>
339            <id>report</id>
340            <phase>test</phase>
341            <goals>
342              <goal>report</goal>
343            </goals>
344          </execution>
345        </executions>
346      </plugin>
347
348      <plugin>
349        <groupId>org.apache.maven.plugins</groupId>
350        <artifactId>maven-shade-plugin</artifactId>
351        <version>3.4.1</version>
352        <executions>
353          <execution>
354            <phase>package</phase>
355            <goals>
356              <goal>shade</goal>
357            </goals>
358            <configuration>
359              <createDependencyReducedPom>false</createDependencyReducedPom>
360              <filters>
361                <filter>
362                  <artifact>*:*</artifact>
363                  <excludes>
364                    <exclude>META-INF/*.SF</exclude>
365                    <exclude>META-INF/*.DSA</exclude>
366                    <exclude>META-INF/*.RSA</exclude>
367                  </excludes>
368                </filter>
369              </filters>
370            </configuration>
371          </execution>
372        </executions>
373      </plugin>
374    </plugins>
375  </build>
376
377  <dependencies>
378    <dependency>
379      <groupId>com.google.guava</groupId>
380      <artifactId>guava</artifactId>
381      <version>31.1-jre</version>
382    </dependency>
383    <dependency>
384      <groupId>com.google.api</groupId>
385      <artifactId>gax</artifactId>
386    </dependency>
387    <dependency>
388      <groupId>com.google.api</groupId>
389      <artifactId>gax</artifactId>
390      <!-- import the test code, https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html -->
391      <type>test-jar</type>
392      <classifier>testlib</classifier>
393    </dependency>
394    <dependency>
395      <groupId>com.google.api</groupId>
396      <artifactId>gax-grpc</artifactId>
397    </dependency>
398    <dependency>
399      <groupId>com.google.api</groupId>
400      <artifactId>gax-grpc</artifactId>
401      <!-- import the test code, https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html -->
402      <type>test-jar</type>
403      <classifier>testlib</classifier>
404    </dependency>
405    <dependency>
406      <groupId>com.google.api</groupId>
407      <artifactId>gax-httpjson</artifactId>
408    </dependency>
409    <dependency>
410      <groupId>com.google.api</groupId>
411      <artifactId>gax-httpjson</artifactId>
412      <!-- import the test code, https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html -->
413      <type>test-jar</type>
414      <classifier>testlib</classifier>
415    </dependency>
416    <dependency>
417      <groupId>com.google.auto.value</groupId>
418      <artifactId>auto-value-annotations</artifactId>
419      <version>${auto-value.version}</version>
420    </dependency>
421    <dependency>
422      <groupId>com.google.protobuf</groupId>
423      <artifactId>protobuf-java-util</artifactId>
424    </dependency>
425    <dependency>
426      <groupId>io.grpc</groupId>
427      <artifactId>grpc-stub</artifactId>
428    </dependency>
429    <dependency>
430      <groupId>io.grpc</groupId>
431      <artifactId>grpc-protobuf</artifactId>
432    </dependency>
433    <dependency>
434      <groupId>org.yaml</groupId>
435      <artifactId>snakeyaml</artifactId>
436      <version>2.0</version>
437    </dependency>
438    <dependency>
439      <groupId>com.google.googlejavaformat</groupId>
440      <artifactId>google-java-format</artifactId>
441      <version>1.7</version>
442    </dependency>
443    <dependency>
444      <groupId>junit</groupId>
445      <artifactId>junit</artifactId>
446      <version>4.13.2</version>
447    </dependency>
448    <dependency>
449      <groupId>com.google.errorprone</groupId>
450      <artifactId>error_prone_annotations</artifactId>
451      <version>2.18.0</version>
452    </dependency>
453
454    <!--
455      TODO: remove when dropping Java 8.
456      https://github.com/googleapis/gapic-generator-java/issues/888
457    -->
458    <dependency>
459      <groupId>javax.annotation</groupId>
460      <artifactId>javax.annotation-api</artifactId>
461      <version>${javax.annotation-api.version}</version>
462    </dependency>
463
464    <dependency>
465      <groupId>com.google.truth</groupId>
466      <artifactId>truth</artifactId>
467      <version>1.1.3</version>
468      <scope>test</scope>
469    </dependency>
470    <dependency>
471      <groupId>io.github.java-diff-utils</groupId>
472      <artifactId>java-diff-utils</artifactId>
473      <version>4.12</version>
474      <scope>test</scope>
475    </dependency>
476  </dependencies>
477</project>
478