我正在关注Creating a Simple Hello World Backend API教程(GAE)并且所有内容都通过本地终端正常运行但是当我在IntelliJ中打开项目时,IntelliJ无法构建项目... < / p>
pom文件有一堆关于无法找到任何依赖项的错误,但是我仍然可以在IntelliJ之外构建应用程序。
我对Maven并不过分熟悉,但我相信它已在IDE中正确配置,因为我可以构建IntelliJ生成的其他通用示例。我试图重新导入所有依赖项但没有运气......
我还需要做些什么吗?
pom文件中的片段,其中两个依赖项都无法找到版本。
<?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>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>com.example.helloworld</groupId>
<artifactId>helloworld</artifactId>
<properties>
<app.id>your-app-id</app.id>
<app.version>1</app.version>
<appengine.version>${appengine.version}</appengine.version>
<gcloud.plugin.version>0.9.58.v20150505</gcloud.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
</properties>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.version}</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>${appengine.version}</version>
</dependency>
答案 0 :(得分:1)
您的appengine.version
属性是递归定义的,因此IntelliJ无法弄清楚它是什么。用<appengine.version>${appengine.version}</appengine.version>
替换<appengine.version>1.9.24</appengine.version>
,你应该没事。