Skip to content

Commit 9a54c2e

Browse files
committed
Fix build errors caused by dependency updates.
1 parent 0f16442 commit 9a54c2e

File tree

9 files changed

+133
-60
lines changed

9 files changed

+133
-60
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-java8/bigtable/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ limitations under the License.
3737
<maven.compiler.source>1.8</maven.compiler.source>
3838
<maven.compiler.target>1.8</maven.compiler.target>
3939

40-
<bigtable.projectID>YOUR_PROJECT_ID</bigtable.projectID>
41-
<bigtable.instanceID>YOUR_INSTANCE_ID</bigtable.instanceID>
40+
<bigtable.projectID>java-docs-samples-testing</bigtable.projectID>
41+
<bigtable.instanceID>instance</bigtable.instanceID>
4242
<failOnMissingWebXml>false</failOnMissingWebXml>
4343
</properties>
4444

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: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
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.PubsubMessage;
34-
import com.google.pubsub.v1.PushConfig;
35-
import com.google.pubsub.v1.Subscription;
36-
import com.google.pubsub.v1.SubscriptionName;
37-
import com.google.pubsub.v1.TopicName;
33+
import com.google.pubsub.v1.*;
3834

3935
/**
4036
* API usage samples
@@ -292,7 +288,7 @@ public static int pubSub(String subscriptionId, int timeout, String projectId) t
292288

293289
try {
294290
// subscribe to the requested pubsub channel
295-
SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
291+
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId);
296292
subscriber = Subscriber.newBuilder(subscriptionName, receiver).build();
297293
subscriber.startAsync().awaitRunning();
298294
// listen to messages for 'listenTimeout' seconds
@@ -339,8 +335,8 @@ public static Subscription createOccurrenceSubscription(String subscriptionId, S
339335
String topicId = "resource-notes-occurrences-v1alpha1";
340336
try (SubscriptionAdminClient client = SubscriptionAdminClient.create()) {
341337
PushConfig config = PushConfig.getDefaultInstance();
342-
TopicName topicName = TopicName.of(projectId, topicId);
343-
SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
338+
ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
339+
ProjectSubscriptionName subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId);
344340
Subscription sub = client.createSubscription(subscriptionName, topicName, config, 0);
345341
return sub;
346342
}

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: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
-->
16-
<project xmlns="http://maven.apache.org/POM/4.0.0"
17-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
16+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1918
<modelVersion>4.0.0</modelVersion>
2019

2120
<groupId>com.example.dataflow</groupId>
@@ -69,21 +68,13 @@
6968
<groupId>com.google.api.grpc</groupId>
7069
<artifactId>grpc-google-common-protos</artifactId>
7170
</exclusion>
71+
<exclusion>
72+
<groupId>io.grpc</groupId>
73+
<artifactId>grpc-core</artifactId>
74+
</exclusion>
7275
</exclusions>
7376
</dependency>
7477

75-
<dependency>
76-
<groupId>org.apache.beam</groupId>
77-
<artifactId>beam-runners-direct-java</artifactId>
78-
<version>${apache_beam.version}</version>
79-
</dependency>
80-
81-
<dependency>
82-
<groupId>org.apache.beam</groupId>
83-
<artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
84-
<version>${apache_beam.version}</version>
85-
</dependency>
86-
8778
<!-- Google Cloud -->
8879
<dependency>
8980
<groupId>com.google.cloud</groupId>

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)