0

I would like to use the following function from google java-docs-samples in my code like this:

BigQueryUtils.getPages(...)

I added in pom.xml

<dependency>
    <groupId>com.google.cloud</groupId>
    <artifactId>google-cloud-bigquery</artifactId>
    <version>0.5.1</version>
</dependency>

and in my code:

import com.google.cloud.bigquery.samples;

public class MyClass {

  public static void method() {
    BigQueryUtils.getPages(...);
  }

i get this message:

 The import com.google.cloud.bigquery.samples cannot be resolved

how can I import above libraries in my project?

EDIT I also tried adding this on the pom, didnt help

    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>doc-samples</artifactId>
        <version>1.0.0</version>
    </dependency>

I get this message in the pom:

Missing artifact com.google.cloud:doc-samples:jar:1.0.0
Graham Polley
  • 14,393
  • 4
  • 44
  • 80
dina
  • 4,039
  • 6
  • 39
  • 67

1 Answers1

1

The samples/examples are not part of the Maven central repo. As per the documentation, you would need to build the project yourself, and then include the local jar file that is built if you want to use those classes/methods:

  1. Clone/download the repo
  2. cd to bigquery
  3. mvn clean package -DskipTests
  4. Include the jar in your project

Bear in mind though, that these are just samples/examples. I wouldn't be depending on them for building solutions. They exist purely to guide and get people started with the APIs.

Community
  • 1
  • 1
Graham Polley
  • 14,393
  • 4
  • 44
  • 80