早上好,
我正在使用一些端点创建GAE应用程序。我上传了我的应用很多次,一切都很好,但发生了一些事情(我认为这是我的pom.xml),现在我可以打电话了
maven install
没有错误,但是当我打电话时
maven appengine:update
控制台显示FileNotFoundException,因为缺少appengine-web.xml。
这是我的堆栈跟踪:
com.google.apphosting.utils.config.AppEngineConfigException: Could not locate D:\Workspace\myProject\v0.6\myProject\target\myProject-0.0.1-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:185)
at com.google.appengine.tools.admin.Application.readApplication(Application.java:322)
at com.google.appengine.tools.admin.AppCfg.readWar(AppCfg.java:283)
at com.google.appengine.tools.admin.AppCfg.readApplication(AppCfg.java:274)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:212)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:124)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:120)
at com.google.appengine.appcfg.AbstractAppCfgMojo.executeAppCfgCommand(AbstractAppCfgMojo.java:248)
at com.google.appengine.appcfg.Update.execute(Update.java:32)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.io.FileNotFoundException: D:\Workspace\myProject\v0.6\myProject\target\myProject-0.0.1-SNAPSHOT\WEB-INF\appengine-web.xml (Nie można odnaleźć określonego pliku)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.getInputStream(AppEngineWebXmlReader.java:137)
... 31 more
我从这里复制了pom.xml中的“build”部分: https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-java-maven/blob/master/pom.xml
当然我并不感到惊讶,因为在我的“目标”目录中我只有“类”目录,但我不知道为什么不会生成此目录中的“WEB-INF”。
- 编辑 -
当然我已经在WEB-INF目录中创建了appengine-web.xml
答案 0 :(得分:1)
这是我的错。我有
<packaging>jar</packaging>
而不是
<packaging>war</packaging>
在我的pom.xml中,所以没有正确生成项目。