1

I've been trying to get this working all day reading docs over and over and I don't know what I'm doing wrong. I'm using the cloud code plugin for intellij it then automatically adds the maven dependencies. I've been following this tutorial but when I import, all I get is this:

enter image description here

Please could someone tell me what i'm doing wrong. All I want to do is upload a text file to google cloud using Java.

Kolban
  • 13,794
  • 3
  • 38
  • 60
Fred
  • 750
  • 1
  • 7
  • 14
  • What are the errors you are receiving? Is it that the imports are not being resolved? In order to resolve the GCS dependencies, Google supplied JARs must be added to the classpath. One can use Maven to declare that one has dependencies and then Maven can be used to satisfy those. Sadly, I'm not familiar with IntelliJ so don't know how well Maven and IntelliJ integrate. Did you add the documented dependency into your pom.xml file? – Kolban Oct 28 '19 at 23:48
  • Yeah the error is that the imports cannot be resolved. The dependencies automatically get added to the pom.xml file. – Fred Oct 29 '19 at 00:05
  • What are the google supplied jars ? I installed the google cloud sdk? – Fred Oct 29 '19 at 00:07
  • See here ... https://cloud.google.com/java/docs/setup ... The high level is that GCP (Google Cloud Platform) is a lot of function. It would be too much to download all the possible components so you are asked to download the components that you use. This is where maven comes into play. Here is the group for Google Cloud and here the artifact for GCS https://mvnrepository.com/artifact/com.google.cloud/google-cloud-storage What does your pom.xml contain just now? – Kolban Oct 29 '19 at 01:03
  • You may want to try https://stackoverflow.com/questions/9980869/force-intellij-idea-to-reread-all-maven-dependencies – Travis Webb Oct 29 '19 at 02:52

1 Answers1

1

You have not shared your pom file. Maybe your cloud code plugin is not adding the dependency automatically as claimed. Can you check the pom file and make sure that you have the following dependency

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-storage</artifactId>
  <version>1.98.0</version>
</dependency>
Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136