我的 Maven 项目使用 Directory API Client Library for Java,我需要将其作为依赖项包含在内。但是在Directory API Client Library for Java页面,在“将库添加到您的项目”标题下,当我选择 maven 作为我的构建环境时,它总是显示,
“将以下内容添加到您的 pom.xml 文件中:
此库正在上传到中央 Maven 存储库。请过几个小时再回来查看。”
过去几周。
由于我在另一个项目中使用了google drive依赖如下,
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-drive</artifactId>
<version>v2-rev60-1.13.2-beta</version>
</dependency>
我尝试通过包括,
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-directory</artifactId>
<version>v1-rev28-1.17.0-rc</version>
</dependency>
但是没有用。
并且为了重新编码我的 pom 也有以下存储库,
<repository>
<id>google-api-services</id>
<url>http://google-api-client-libraries.appspot.com/mavenrepo</url>
</repository>
使用 Directory API Client Library for Java 的正确 Maven 依赖项是什么。
最佳答案
在页面底部,有一个链接如下,
参见 all versions available on the Maven Central Repository.
我浏览了该页面并找到了以前版本的 Directory API Client Library for Java。通过查看它的 pom,我尝试遵循依赖关系并且它起作用了。
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-admin</artifactId>
<version>directory_v1-rev22-1.16.0-rc</version>
</dependency>
然后我尝试如下将版本更新到最新,也成功了。
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-admin</artifactId>
<version>directory_v1-rev28-1.17.0-rc</version>
</dependency>
关于java - Java 目录 API 客户端库的 Maven 依赖项是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22110847/