[英]IntelliJ can't find google-cloud-storage classes
I'm trying to use Google cloud storage and I'm following this guide: https://cloud.google.com/storage/docs/reference/libraries#using_the_client_library 我正在尝试使用Google云端存储,并且我正在遵循此指南: https : //cloud.google.com/storage/docs/reference/libraries#using_the_client_library
I'm using Java with Maven, and this is my Pom.xml: 我正在使用Java和Maven,这是我的Pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.findwise.app</groupId>
<artifactId>data-pipeline</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>0.32.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.cloud.dataflow</groupId>
<artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-storage</artifactId>
<version>1.70.0</version>
</dependency>
</dependencies>
</project>
As you can see I've added the google-cloud-storage dependency. 正如您所看到的,我添加了google-cloud-storage依赖项。 My problem is that the classes used in the Java part of the guide ( Storage
, StorageOptions
, Bucket
, BucketInfo
) are unfindable by IntelliJ. 我的问题是指南的Java部分中使用的类( Storage
, Storage
StorageOptions
, Storage
Bucket
, BucketInfo
)是IntelliJ不可用的。 I can't import them. 我无法导入它们。 In fact, when I try to import via the absolute path: 事实上,当我尝试通过绝对路径导入时:
import com.google.cloud.storage.Storage;
IntelliJ complains that the symbol google
cannot be resolved. IntelliJ抱怨无法解析符号google
。 What is wrong here? 这有什么不对?
There are a few places to look: 有几个地方可以看:
If IntelliJ cannot import the class, it suggests that your Maven pull isn't working. 如果IntelliJ无法导入该类,则表明您的Maven拉不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.