gpt4 book ai didi

java - com.google.appengine :appengine-api-1. 0-sdk:jar 的“dependency.dependency.version”必须是有效版本,但为 '${appengine.target.version}'

转载 作者:行者123 更新时间:2023-12-01 09:31:42 30 4
gpt4 key购买 nike

我使用 maven 3.3.9 使用命令 mvn archetype:generate 创建了一个项目,然后搜索端点 archtype 并选择它,然后插入 groupid artifectId 版本...等,之后我在 Eclipse Neon 和 As 中导入该项目我正在运行此项目 appengine:devserver 命令,我收到下面给出的错误消息:

 Resolving expression: '${gcloud.plugin.version}': Detected the following recursive expression cycle in 'gcloud.plugin.version':    [gcloud.plugin.version] -> [Help 2]
[ERROR] Resolving expression: '${gcloud.plugin.version}': Detected the following recursive expression cycle in 'gcloud.plugin.version': [gcloud.plugin.version] -> [Help 2]
[ERROR] 'dependencies.dependency.version' for com.google.appengine:appengine-api-1.0-sdk:jar must be a valid version but is '${appengine.target.version}'. @ line 34, column 13
[ERROR] 'dependencies.dependency.version' for com.google.appengine:appengine-endpoints:jar must be a valid version but is '${appengine.target.version}'. @ line 39, column 13
[ERROR] 'dependencies.dependency.version' for com.google.appengine:appengine-testing:jar must be a valid version but is '${appengine.sdk.version}'. @ line 69, column 13
[ERROR] 'dependencies.dependency.version' for com.google.appengine:appengine-api-stubs:jar must be a valid version but is '${appengine.sdk.version}'. @ line 75, column 13
[ERROR] 'build.plugins.plugin.version' for com.google.appengine:appengine-maven-plugin must be a valid version but is '${appengine.sdk.version}'. @ line 122, column 14
[ERROR] 'build.plugins.plugin.version' for com.google.appengine:gcloud-maven-plugin must be a valid version but is '${gcloud.plugin.version}'. @ line 145, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/InterpolationCycleException

生成的 POM.xml 文件如下。我不知道为什么会收到此错误以及如何解决它。从最初的错误阅读中,我得到的信息是 {{gcloud.plugin.version}} 有问题,但问题是什么以及如何解决此问题。

<?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.demo.app</groupId>
<artifactId>demo-app</artifactId>

<properties>
<app.id>your-app-id</app.id>
<app.version>1</app.version>
<appengine.version>${appengine.sdk.version}</appengine.version>
<gcloud.plugin.version>${gcloud.plugin.version}</gcloud.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<archiveClasses>true</archiveClasses>
</properties>

<prerequisites>
<maven>3.3.9</maven>
</prerequisites>

<dependencies>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>${appengine.target.version}</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>${appengine.target.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>${appengine.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>${appengine.version}</version>
<scope>test</scope>
</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.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>display-dependency-updates</goal>
<goal>display-plugin-updates</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webXml>${project.build.directory}/generated-sources/appengine-endpoints/WEB-INF/web.xml</webXml>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>${project.build.directory}/generated-sources/appengine-endpoints</directory>
<!-- the list has a default value of ** -->
<includes>
<include>WEB-INF/*.discovery</include>
<include>WEB-INF/*.api</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>

<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<version>${app.version}</version>
<!-- Comment in the below snippet to bind to all IPs instead of just
localhost -->
<!-- address>0.0.0.0</address> <port>8080</port -->
<!-- Comment in the below snippet to enable local debugging with a remote
debugger like those included with Eclipse or IntelliJ -->
<!-- jvmFlags> <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag>
</jvmFlags -->
</configuration>
<executions>
<execution>
<goals>
<goal>endpoints_get_discovery_doc</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>gcloud-maven-plugin</artifactId>
<version>${gcloud.plugin.version}</version>
<configuration>
<set_default>true</set_default>
</configuration>
</plugin>
</plugins>
</build>

最佳答案

<properties> 中定义 appengine.target.versiongcloud.plugin.version 属性。您可以使用 https://cloud.google.com/sdk/downloads 谷歌搜索最新版本的 appengine-sdk 和 gcloud.plugin.version

 <appengine.version>1.9.42</appengine.version>
<gcloud.plugin.version>124</gcloud.plugin.version>

关于java - com.google.appengine :appengine-api-1. 0-sdk:jar 的“dependency.dependency.version”必须是有效版本,但为 '${appengine.target.version}',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39355626/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com