1{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%}
2{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%}
3<?xml version='1.0' encoding='UTF-8'?>
4<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">
5  <modelVersion>4.0.0</modelVersion>
6  <groupId>com.google.cloud</groupId>
7  <artifactId>{{metadata['repo']['name']}}-snapshot</artifactId>
8  <packaging>jar</packaging>
9  <name>Google {{metadata['repo']['name_pretty']}} Snapshot Samples</name>
10  <url>https://github.com/{{metadata['repo']['repo']}}</url>
11
12  <!--
13    The parent pom defines common style checks and testing strategies for our samples.
14    Removing or replacing it should not affect the execution of the samples in any way.
15  -->
16  <parent>
17    <groupId>com.google.cloud.samples</groupId>
18    <artifactId>shared-configuration</artifactId>
19    <version>1.2.0</version>
20  </parent>
21
22  <properties>
23    <maven.compiler.target>1.8</maven.compiler.target>
24    <maven.compiler.source>1.8</maven.compiler.source>
25    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26  </properties>
27
28  <dependencies>
29    <!-- {x-version-update-start:{{ artifact_id }}:current} -->
30    <dependency>
31      <groupId>{{ group_id }}</groupId>
32      <artifactId>{{ artifact_id }}</artifactId>
33      <version>{{ metadata['latest_version'] }}</version>
34    </dependency>
35    <!-- {x-version-update-end} -->
36
37    <dependency>
38      <groupId>junit</groupId>
39      <artifactId>junit</artifactId>
40      <version>4.13.2</version>
41      <scope>test</scope>
42    </dependency>
43    <dependency>
44      <groupId>com.google.truth</groupId>
45      <artifactId>truth</artifactId>
46      <version>1.1.3</version>
47      <scope>test</scope>
48    </dependency>
49  </dependencies>
50
51  <!-- compile and run all snippet tests -->
52  <build>
53    <plugins>
54      <plugin>
55        <groupId>org.codehaus.mojo</groupId>
56        <artifactId>build-helper-maven-plugin</artifactId>
57        <version>3.3.0</version>
58        <executions>
59          <execution>
60            <id>add-snippets-source</id>
61            <goals>
62              <goal>add-source</goal>
63            </goals>
64            <configuration>
65              <sources>
66                <source>../snippets/src/main/java</source>
67              </sources>
68            </configuration>
69          </execution>
70          <execution>
71            <id>add-snippets-tests</id>
72            <goals>
73              <goal>add-test-source</goal>
74            </goals>
75            <configuration>
76              <sources>
77                <source>../snippets/src/test/java</source>
78              </sources>
79            </configuration>
80          </execution>
81        </executions>
82      </plugin>
83    </plugins>
84  </build>
85</project>
86