Skip to content

Commit fe60e45

Browse files
committed
Fix build errors caused by dependency updates.
1 parent 1945671 commit fe60e45

File tree

8 files changed

+139
-51
lines changed

8 files changed

+139
-51
lines changed

.kokoro/presubmit.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ env_vars: {
1919
key: "TRAMPOLINE_BUILD_FILE"
2020
value: "github/java-docs-samples/.kokoro/tests/diff_tests.sh"
2121
}
22-

appengine/datastore/pom.xml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,93 @@
4141
<module>indexes-perfect</module>
4242
</modules>
4343

44+
<dependencies>
45+
<dependency>
46+
<groupId>com.google.auto.value</groupId>
47+
<artifactId>auto-value</artifactId>
48+
<version>1.5.3</version>
49+
<scope>provided</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>com.google.code.findbugs</groupId>
53+
<artifactId>jsr305</artifactId> <!-- @Nullable annotations -->
54+
<version>3.0.2</version>
55+
</dependency>
56+
57+
<dependency>
58+
<groupId>com.google.guava</groupId>
59+
<artifactId>guava</artifactId>
60+
<version>20.0</version>
61+
</dependency>
62+
63+
<dependency>
64+
<groupId>joda-time</groupId>
65+
<artifactId>joda-time</artifactId>
66+
<version>2.9.9</version>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>javax.servlet</groupId>
71+
<artifactId>servlet-api</artifactId>
72+
<version>2.5</version>
73+
<scope>provided</scope>
74+
</dependency>
75+
76+
<dependency>
77+
<groupId>com.google.appengine</groupId>
78+
<artifactId>appengine-api-1.0-sdk</artifactId>
79+
<version>1.9.63</version>
80+
</dependency>
81+
82+
<!-- Test Dependencies -->
83+
<dependency>
84+
<groupId>junit</groupId>
85+
<artifactId>junit</artifactId>
86+
<version>4.12</version>
87+
<scope>test</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.mockito</groupId>
91+
<artifactId>mockito-all</artifactId>
92+
<version>1.10.19</version>
93+
<scope>test</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>com.google.appengine</groupId>
97+
<artifactId>appengine-testing</artifactId>
98+
<version>1.9.59</version>
99+
<scope>test</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>com.google.appengine</groupId>
103+
<artifactId>appengine-api-stubs</artifactId>
104+
<version>1.9.59</version>
105+
<scope>test</scope>
106+
</dependency>
107+
<dependency>
108+
<groupId>com.google.appengine</groupId>
109+
<artifactId>appengine-tools-sdk</artifactId>
110+
<version>1.9.59</version>
111+
<scope>test</scope>
112+
</dependency>
113+
<dependency>
114+
<groupId>com.google.truth</groupId>
115+
<artifactId>truth</artifactId>
116+
<version>0.37</version>
117+
<scope>test</scope>
118+
</dependency>
119+
</dependencies>
120+
121+
<build>
122+
<!-- for hot reload of the web application -->
123+
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
124+
<plugins>
125+
<!-- Parent POM defines ${appengine.sdk.version} (updates frequently). -->
126+
<plugin>
127+
<groupId>com.google.appengine</groupId>
128+
<artifactId>appengine-maven-plugin</artifactId>
129+
<version>1.9.59</version>
130+
</plugin>
131+
</plugins>
132+
</build>
44133
</project>

container-registry/container-analysis/src/main/java/com/example/containeranalysis/Samples.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
import com.google.containeranalysis.v1alpha1.Occurrence;
3131
import com.google.containeranalysis.v1alpha1.VulnerabilityType;
3232
import com.google.containeranalysis.v1alpha1.VulnerabilityType.VulnerabilityDetails;
33+
import com.google.pubsub.v1.ProjectSubscriptionName;
34+
import com.google.pubsub.v1.ProjectTopicName;
3335
import com.google.pubsub.v1.PubsubMessage;
3436
import com.google.pubsub.v1.PushConfig;
3537
import com.google.pubsub.v1.Subscription;
36-
import com.google.pubsub.v1.SubscriptionName;
37-
import com.google.pubsub.v1.TopicName;
3838

3939
/**
4040
* API usage samples
@@ -292,7 +292,7 @@ public static int pubSub(String subscriptionId, int timeout, String projectId) t
292292

293293
try {
294294
// subscribe to the requested pubsub channel
295-
SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
295+
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId);
296296
subscriber = Subscriber.newBuilder(subscriptionName, receiver).build();
297297
subscriber.startAsync().awaitRunning();
298298
// listen to messages for 'listenTimeout' seconds
@@ -339,8 +339,8 @@ public static Subscription createOccurrenceSubscription(String subscriptionId, S
339339
String topicId = "resource-notes-occurrences-v1alpha1";
340340
try (SubscriptionAdminClient client = SubscriptionAdminClient.create()) {
341341
PushConfig config = PushConfig.getDefaultInstance();
342-
TopicName topicName = TopicName.of(projectId, topicId);
343-
SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
342+
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
343+
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId);
344344
Subscription sub = client.createSubscription(subscriptionName, topicName, config, 0);
345345
return sub;
346346
}

container-registry/container-analysis/src/test/java/com/example/containeranalysis/SamplesTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.google.containeranalysis.v1alpha1.Note;
2626
import com.google.containeranalysis.v1alpha1.Occurrence;
2727
import com.google.containeranalysis.v1alpha1.VulnerabilityType.VulnerabilityDetails;
28-
import com.google.pubsub.v1.SubscriptionName;
28+
import com.google.pubsub.v1.ProjectSubscriptionName;
2929
import java.util.Date;
3030
import org.junit.After;
3131
import org.junit.Before;
@@ -194,7 +194,7 @@ public void testPubSub() throws Exception {
194194
int newCount;
195195
int tries;
196196
String subscriptionId = "drydockOccurrences";
197-
SubscriptionName subscriptionName = SubscriptionName.of(PROJECT_ID, subscriptionId);
197+
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(PROJECT_ID, subscriptionId);
198198

199199
Samples.createOccurrenceSubscription(subscriptionId, PROJECT_ID);
200200
Subscriber subscriber = null;

dataflow/spanner-io/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363

6464
<dependencies>
6565

66+
<dependency>
67+
<groupId>com.google.cloud</groupId>
68+
<artifactId>google-cloud-spanner</artifactId>
69+
<version>0.40.0-beta</version>
70+
</dependency>
71+
6672
<!-- Apache Beam -->
6773
<dependency>
6874
<groupId>org.apache.beam</groupId>
@@ -79,6 +85,10 @@
7985
<groupId>com.google.api.grpc</groupId>
8086
<artifactId>grpc-google-common-protos</artifactId>
8187
</exclusion>
88+
<exclusion>
89+
<groupId>io.grpc</groupId>
90+
<artifactId>grpc-core</artifactId>
91+
</exclusion>
8292
</exclusions>
8393
</dependency>
8494

errorreporting/src/main/java/com/example/errorreporting/QuickStart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void main(String[] args) throws Exception {
3838

3939
// Google Cloud Platform Project ID
4040
String projectId = (args.length > 0) ? args[0] : ServiceOptions.getDefaultProjectId();
41-
ProjectName projectName = ProjectName.create(projectId);
41+
ProjectName projectName = ProjectName.of(projectId);
4242

4343
// Instantiate an Error Reporting Client
4444
try (ReportErrorsServiceClient reportErrorsServiceClient = ReportErrorsServiceClient.create()) {

monitoring/cloud-client/src/main/java/com/example/monitoring/QuickstartSample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static void main(String... args) throws Exception {
6565
List<Point> pointList = new ArrayList<>();
6666
pointList.add(point);
6767

68-
ProjectName name = ProjectName.create(projectId);
68+
ProjectName name = ProjectName.of(projectId);
6969

7070
// Prepares the metric descriptor
7171
Map<String, String> metricLabels = new HashMap<String, String>();
@@ -93,7 +93,7 @@ public static void main(String... args) throws Exception {
9393
timeSeriesList.add(timeSeries);
9494

9595
CreateTimeSeriesRequest request = CreateTimeSeriesRequest.newBuilder()
96-
.setNameWithProjectName(name)
96+
.setName(name.toString())
9797
.addAllTimeSeries(timeSeriesList)
9898
.build();
9999

0 commit comments

Comments
 (0)