简体   繁体   English

IntelliJ无法找到google-cloud-storage类

[英]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部分中使用的类( StorageStorage StorageOptionsStorage BucketBucketInfo )是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: 有几个地方可以看:

  1. Find your local .m2 repository and navigate to the com.google.cloud dependencies. 找到您当地的.m2存储库并导航到com.google.cloud依赖项。 If you don't find it, or the JARs aren't there, IntelliJ won't be able to access them. 如果您没有找到它,或者JAR不在那里,IntelliJ将无法访问它们。
  2. IntelliJ will show you the External Libraries it is using under your source code in the project panel on the left. IntelliJ将在左侧项目面板中的源代码下显示它正在使用的外部库。

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.

相关问题 无法使用Google-Cloud-Storage客户端库运行空的AndroidStudio 0.8.14项目 - Can not run empty AndroidStudio 0.8.14 project with google-cloud-storage client library 如何在Apache Beam项目中直接使用google-cloud-storage - How to use google-cloud-storage directly in a Apache Beam project Java/Spring 使用 Google Cloud firebase-admin 与 google-cloud-storage 冲突 - Java/Spring using Google Cloud firebase-admin conflicts with google-cloud-storage 通过appengine上传到google-cloud-storage时如何向文件添加元数据 - how to add metadata to file when uploading to google-cloud-storage via appengine 如何获取存储在google-cloud-storage桶的子目录中的图像的URL - How do I get the URL for an image stored in a subdirectory of a google-cloud-storage bucket Java `https.proxyHost` 和 `https.proxyPort` 在使用 google-cloud-storage 时成功然后失败 - Java `https.proxyHost` and `https.proxyPort` succeed then fail when using google-cloud-storage IntelliJ 编译时在同一个包中找不到类 - IntelliJ can't find classes in same package when compiling Intellij找不到JDK - Intellij can't find JDK Intellij找不到.png - Intellij can't find .png Google Cloud Dataflow无法在Google Storage中找到父目录 - Google Cloud Dataflow unable to find parent directory in Google Storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM