【问题标题】:How do I add Gmail API library to my Maven project in IntelliJ?如何在 IntelliJ 中将 Gmail API 库添加到我的 Maven 项目?
【发布时间】:2021-09-02 02:28:05
【问题描述】:

似乎我无法在 IntelliJ 中向我的 Maven 项目添加正确的依赖项。

<dependency>
            <groupId>com.google.apis</groupId>
            <artifactId>google-api-services-gmail</artifactId>
            <version>v1-rev20210614-1.31.0</version>
</dependency>

这是我在 pom.xml 文件中添加的依赖项,但 IntelliJ 只是将单词标记为红色并说:Dependency 'com.google.apis:google-api-services-gmail:v1-rev20210614 -1.31.0' 未找到

我已经搜索了要下载的 jar 文件并手动添加到项目结构中的依赖项中,但我似乎找不到。

你能帮我告诉我我做错了什么吗?

【问题讨论】:

    标签: maven intellij-idea gmail-api


    【解决方案1】:

    你指的版本不存在:

    <!-- https://mvnrepository.com/artifact/com.google.apis/google-api-services-gmail -->
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-gmail</artifactId>
        <version>v1-rev110-1.25.0</version>
    </dependency>
    

    查看https://mvnrepository.com/artifact/com.google.apis/google-api-services-gmail 以获取可用版本。

    【讨论】:

      【解决方案2】:

      这是错误的版本。也许它还没有在 Maven 上公开。但是您可以添加到 pom.xml 通常跟随 URL: https://github.com/googleapis/google-api-java-client-services/tree/master/clients/google-api-services-gmail/v1/1.31.0

      <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-gmail</artifactId>
        <version>v1-rev20210614-1.32.1</version>
      </dependency>
      

      【讨论】:

        猜你喜欢
        • 2012-12-12
        • 1970-01-01
        • 2019-02-12
        • 1970-01-01
        • 2017-11-17
        • 2012-11-09
        • 1970-01-01
        • 2012-08-13
        • 1970-01-01
        相关资源
        最近更新 更多