【发布时间】:2019-01-09 02:21:05
【问题描述】:
我将 appengine-gcs-client 添加到我的 Google AppEngine Standard 项目中:
*<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.7</version>
</dependency>*
编译项目报如下错误(前几天还没有问题):
[错误] 无法在项目 myproject2 上执行目标:无法解析项目 com.myproject2:myproject2:war:1.0-SNAPSHOT 的依赖项:无法在 com.google.appengine.tools:appengine- 收集依赖项gcs-client:jar:0.7 -> com.google.api-client:google-api-client-appengine:jar:1.24.1 -> com.google.oauth-client:google-oauth-client-appengine:jar: 1.24.1 -> com.google.http-client:google-http-client-appengine:jar:1.24.1:无法读取 com.google.http-client:google-http-client-appengine:jar 的工件描述符:1.24.1: 找不到 com.google.http-client:google-http-client-parent:pom:1.24.1 in https://repo.maven.apache.org/maven2 已缓存在本地存储库中,直到更新间隔才会重新尝试解析Central 已过期或强制更新 -> [Help 1]
Google 似乎刚刚在依赖树中创建了一些错误。
有什么办法可以修复它,即使只是临时解决方法?
使用重现错误的完整 pom 更新我的问题:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
<packaging>war</packaging>
<version>0.1.0-SNAPSHOT</version>
<groupId>com.myproject2</groupId>
<artifactId>myproject2</artifactId>
<properties>
<appengine.maven.plugin.version>1.3.1</appengine.maven.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>
<prerequisites>
<maven>3.3.9</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.59</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- For cloud storage https://cloud.google.com/appengine/docs/standard/java/googlecloudstorageclient/setting-up-cloud-storage -->
<dependency>
<groupId>com.google.appengine.tools</groupId>
<artifactId>appengine-gcs-client</artifactId>
<version>0.7</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>6.0</version>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
-
首先删除
$HOME/.m2/repository/com/google中的目录并尝试重建,但我建议在纯命令行上执行此操作... -
感谢 khmarbaise。我只是这样做了,但没有帮助;错误症状保持不变
-
您使用的是 Java 8 还是 Java 7?
-
你看过
$HOME/.m2/repository/com/google/吗?你在那里找到文件吗?您可以发布您正在使用的完整 pom 文件吗? -
我也面临同样的问题。 @David,你找到解决方案了吗?
标签: java maven google-app-engine google-cloud-storage