我尝试使用IntelliJ IDEA将代码部署到Google Cloud,但始终出现以下错误:Appengine-web.xml不在快照中
Reading application configuration data...
Okt 07, 2018 11:19:22 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SCHWERWIEGEND: Received exception processing C:/Users/Alexa/OneDrive/Dokumente/Projekte/Triebwerk 42/AusbauMeister/target/AusbauMeister-1.0-SNAPSHOT\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate C:\Users\Alexa\OneDrive\Dokumente\Projekte\Triebwerk 42\AusbauMeister\target\AusbauMeister-1.0-SNAPSHOT\WEB-INF\appengine-web.xml
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:141)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:75)
at com.google.appengine.tools.admin.Application.<init>(Application.java:265)
at com.google.appengine.tools.admin.Application.readApplication(Application.java:542)
at com.google.appengine.tools.admin.AppCfg.readWar(AppCfg.java:328)
at com.google.appengine.tools.admin.AppCfg.readApplication(AppCfg.java:281)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:209)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:118)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:114)
Caused by: java.io.FileNotFoundException: C:\Users\Alexa\OneDrive\Dokumente\Projekte\Triebwerk 42\AusbauMeister\target\AusbauMeister-1.0-SNAPSHOT\WEB-INF\appengine-web.xml (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 8 more
Bad configuration: Could not locate C:\Users\Alexa\OneDrive\Dokumente\Projekte\Triebwerk 42\AusbauMeister\target\AusbauMeister-1.0-SNAPSHOT\WEB-INF\appengine-web.xml
Caused by: C:\Users\Alexa\OneDrive\Dokumente\Projekte\Triebwerk 42\AusbauMeister\target\AusbauMeister-1.0-SNAPSHOT\WEB-INF\appengine-web.xml (Das System kann die angegebene Datei nicht finden)
Please see the logs [C:\Users\Alexa\AppData\Local\Temp\appcfg1838607911937492436.log] for further information.
Failed to deploy '[2018-10-07 23:19:19] Maven build: AusbauMeister. Project: . Version: auto': Deployment failed due to staging failing with exit code: 1.
在我的项目结构中,它位于Web- Web-INF-appengine-web.xml之下
这是我的appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>KARL</application><!-- unused for Cloud SDK based tooling -->
<version>Karl-001</version><!-- unused for Cloud SDK based tooling -->
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
</appengine-web-app>
这是我的Pom.xml
<?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>
<groupId>groupId</groupId>
<artifactId>AusbauMeister</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source> <!-- REQUIRED -->
<maven.compiler.target>1.8</maven.compiler.target> <!-- REQUIRED -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml> <!-- REQUIRED -->
<appengine.maven.plugin>1.3.2</appengine.maven.plugin>
<jetty.maven.plugin>9.4.3.v20170317</jetty.maven.plugin>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
<plugin> <!-- Used for local debugging -->
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin}</version>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.65</version>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.4</version>
</dependency>
</dependencies>
</project>
我还尝试使用Gart Console而不是具有相同问题的Maven在GCloud Console中运行它。
当我在Local GAE上运行它时,一切看起来都很好。
感谢您的阅读!
答案 0 :(得分:0)
感谢您的帮助! 我只是想出了问题所在。我对intellij说,我的appengine-web.xml位于我的Web目录中,但它指向的目录不存在,并且无论如何都一直指向该目录 我做了什么。 我创建了它并将文件复制到该目录中,现在它可以正常工作了。