Skip to content

Maven build for samples is broken #2550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
msohn opened this issue Jul 27, 2023 · 3 comments
Closed

Maven build for samples is broken #2550

msohn opened this issue Jul 27, 2023 · 3 comments
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API. samples Issues that are directly related to samples.

Comments

@msohn
Copy link

msohn commented Jul 27, 2023

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types

java-spanner samples

  1. OS type and version:

MacOS 13.4.1 arm64

  1. Java version:
openjdk version "11.0.20" 2023-07-18 LTS
OpenJDK Runtime Environment SapMachine (build 11.0.20+8-LTS-sapmachine)
OpenJDK 64-Bit Server VM SapMachine (build 11.0.20+8-LTS-sapmachine, mixed mode)
  1. version(s):

above v6.42.0

Steps to reproduce

cd samples
mvn clean package -DskipTests

fails for versions above v6.42.0

First bad commit found by using git bisect between v6.40.0 and main (6a3480d)

samples ((7af58f10...)|BISECTING)]$ git bisect bad
7af58f103f3d5ad047e192ebb39faa26d6219384 is the first bad commit
commit 7af58f103f3d5ad047e192ebb39faa26d6219384
Author: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Date:   Mon May 15 17:22:12 2023 +0000

Code example

n/a

Stack trace

n/a

External references such as API reference guides

Any additional information below

build errors found for bad versions:

1dc7cea7
7c23729b
12fb011f:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project spanner-install-without-bom: Compilation failure: Compilation failure:
[ERROR] /Users/d029788/src/git/java-spanner/samples/snippets/src/test/java/com/example/spanner/UpdateDatabaseSampleIT.java:[44,4] error: cannot find symbol
[ERROR]   symbol:   class DatabaseId
[ERROR]   location: class UpdateDatabaseSampleIT
[ERROR] /Users/d029788/src/git/java-spanner/samples/snippets/src/test/java/com/example/spanner/UpdateDatabaseSampleIT.java:[44,22] error: cannot find symbol
[ERROR]   symbol:   variable DatabaseId
[ERROR]   location: class UpdateDatabaseSampleIT
[ERROR] /Users/d029788/src/git/java-spanner/samples/snippets/src/test/java/com/example/spanner/UpdateDatabaseSampleIT.java:[50,4] error: cannot find symbol
[ERROR]   symbol:   class Database
[ERROR]   location: class UpdateDatabaseSampleIT
[ERROR] /Users/d029788/src/git/java-spanner/samples/snippets/src/test/java/com/example/spanner/UpdateDatabaseSampleIT.java:[52,20] error: cannot find symbol
[ERROR]   symbol:   class Database
[ERROR]   location: class UpdateDatabaseSampleIT
[ERROR] /Users/d029788/src/git/java-spanner/samples/snippets/src/test/java/com/example/spanner/UpdateDatabaseSampleIT.java:[54,4] error: cannot find symbol
[ERROR]   symbol:   class Database
[ERROR]   location: class UpdateDatabaseSampleIT

7af58f10:
[ERROR] Failed to execute goal on project spanner-snapshot: Could not resolve dependencies for project com.google.cloud:spanner-snapshot:jar:1.2.0: The following artifacts could not be resolved: com.google.cloud:google-cloud-spanner:jar:6.42.1-SNAPSHOT (absent): Could not find artifact com.google.cloud:google-cloud-spanner:jar:6.42.1-SNAPSHOT -> [Help 1]
@product-auto-label product-auto-label bot added api: spanner Issues related to the googleapis/java-spanner API. samples Issues that are directly related to samples. labels Jul 27, 2023
@rajatbhatta
Copy link
Contributor

Hi @msohn: Thanks for bringing this up. A fix has been done in PR, and will be released in the upcoming release.

CC: @arpan14

@rajatbhatta
Copy link
Contributor

This should be fixed now with the latest release v.6.44.0. Closing.

@msohn
Copy link
Author

msohn commented Jul 28, 2023

Current main branch again doesn't build since in samples/snapshot/pom.xml the wrong version of
com.google.cloud:google-cloud-spanner is referenced (SNAPSHOT versions aren't available on Maven central)
and in samples/snippets/pom.xml the version is unspecified.

Here is a fix:

From 861a72c2e383863420b639708130a1776006f906 Mon Sep 17 00:00:00 2001
From: Matthias Sohn <[email protected]>
Date: Fri, 28 Jul 2023 09:02:59 +0200
Subject: [PATCH] Fix version of com.google.cloud:google-cloud-spanner
 dependency

Otherwise the Maven build fails.
---
 samples/snapshot/pom.xml | 2 +-
 samples/snippets/pom.xml | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index de0bc9f9..dae36cb9 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -31,7 +31,7 @@
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>google-cloud-spanner</artifactId>
-      <version>6.44.1-SNAPSHOT</version>
+      <version>6.44.0</version>
     </dependency>
     <!-- {x-version-update-end} -->

diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 10e1a295..4d46e340 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -44,6 +44,7 @@
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>google-cloud-spanner</artifactId>
+      <version>6.44.0</version>
     </dependency>
     <!-- [END spanner_install_with_bom] -->

--
2.41.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. samples Issues that are directly related to samples.
Projects
None yet
Development

No branches or pull requests

2 participants