我试图创建hello-endpoint-framework
使用maven archetype
我用这个命令来构建项目。
mvn archetype:generate -Dappengine-version=1.9.63 -Djava8=true -DCloudSDK_Tooling=false -Dapplication-id=your-app-id -Dfilter=com.google.appengine.archetypes:
我设置-Djava8=true
是因为我想在 java8中 运行它。
这是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>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<groupId>org.azeem.endpoints</groupId>
<artifactId>endpoints</artifactId>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Compile/runtime dependencies -->
<!-- Uncomment to use Endpoints Frameworks v1.0 and comment the v2.0 section -->
<!--<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>1.9.53</version>
</dependency>-->
<!-- End of Endpoints Frameworks v1.0 -->
<!-- Endpoints Frameworks v2.0 -->
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework</artifactId>
<version>2.0.7</version>
</dependency>
<!-- End of Endpoints Frameworks v2.0 -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.53</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>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<!-- deploy configuration -->
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>endpoints-framework-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<!-- plugin configuration -->
<hostname>YOUR-PROJECT-ID.appspot.com</hostname>
</configuration>
</plugin>
<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>
</plugins>
</build>
</project>
之后,我运行此命令mvn clean package
来构建项目。然后我运行,mvn appengine:run
但出现此错误。
appengine-maven-plugin:1.3.1运行失败,非零退出
我用 -e 重新运行命令,这就是我得到的。
[INFO] com.google.cloud.tools:appengine-maven-plugin ........ 1.3.1 -> 1.3.2
[INFO] com.google.cloud.tools:endpoints-framework-maven-plugin 1.0.0 -> 1.0.3
[INFO]
[WARNING] The following plugins do not have their version specified:
[WARNING] maven-clean-plugin ........................ (from super-pom) 3.1.0
[WARNING] maven-compiler-plugin ..................... (from super-pom) 3.7.0
[WARNING] maven-deploy-plugin ....................... (from super-pom) 2.8.2
[WARNING] maven-install-plugin ...................... (from super-pom) 2.5.2
[WARNING] maven-resources-plugin .................... (from super-pom) 3.1.0
[WARNING] maven-site-plugin ......................... (from super-pom) 3.7.1
[WARNING] maven-surefire-plugin .................... (from super-pom) 2.21.0
[WARNING] maven-war-plugin .......................... (from super-pom) 3.2.0
[INFO]
[WARNING] Project does not define minimum Maven version, default is: 2.0
[INFO] Plugins require minimum Maven version of: 3.0
[INFO] Note: the super-pom from Maven 3.5.3 defines some of the plugin
[INFO] versions and may be influencing the plugins required minimum Maven
[INFO] version.
[INFO]
[ERROR] Project does not define required minimum version of Maven.
[ERROR] Update the pom.xml to contain
[ERROR] <prerequisites>
[ERROR] <maven>3.0</maven>
[ERROR] </prerequisites>
[INFO]
[INFO] Require Maven 2.0.1 to use the following plugin updates:
[INFO] maven-war-plugin .............................................. 2.0.2
[INFO]
[INFO] Require Maven 2.0.2 to use the following plugin updates:
[INFO] maven-site-plugin ........................................ 2.0-beta-7
[INFO]
[INFO] Require Maven 2.0.6 to use the following plugin updates:
[INFO] maven-clean-plugin .............................................. 2.5
[INFO] maven-deploy-plugin ........................................... 2.8.1
[INFO] maven-install-plugin .......................................... 2.5.1
[INFO] maven-resources-plugin .......................................... 2.6
[INFO] maven-site-plugin ............................................. 2.0.1
[INFO] maven-surefire-plugin ......................................... 2.4.3
[INFO] maven-war-plugin ................................................ 2.4
[INFO]
[INFO] Require Maven 2.0.9 to use the following plugin updates:
[INFO] maven-compiler-plugin ........................................... 3.1
[INFO] maven-surefire-plugin .......................................... 2.17
[INFO]
[INFO] Require Maven 2.1.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................. 2.1.1
[INFO]
[INFO] Require Maven 2.2.0 to use the following plugin updates:
[INFO] maven-site-plugin ............................................... 3.0
[INFO]
[INFO] Require Maven 2.2.1 to use the following plugin updates:
[INFO] maven-clean-plugin ............................................ 2.6.1
[INFO] maven-compiler-plugin ........................................... 3.3
[INFO] maven-deploy-plugin ........................................... 2.8.2
[INFO] maven-install-plugin .......................................... 2.5.2
[INFO] maven-resources-plugin .......................................... 2.7
[INFO] maven-site-plugin ............................................. 3.7.1
[INFO] maven-surefire-plugin .......................................... 2.20
[INFO] maven-war-plugin ................................................ 2.6
[INFO] org.codehaus.mojo:versions-maven-plugin ......................... 2.2
[INFO]
[INFO] Require Maven 3.0 to use the following plugin updates:
[INFO] maven-clean-plugin ............................................ 3.1.0
[INFO] maven-compiler-plugin ......................................... 3.7.0
[INFO] maven-resources-plugin ........................................ 3.1.0
[INFO] maven-surefire-plugin ........................................ 2.21.0
[INFO] maven-war-plugin .............................................. 3.2.0
[INFO] org.codehaus.mojo:versions-maven-plugin ......................... 2.5
[INFO]
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ en
dpoints ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\DELL\Downloads\Test\endpoint
s\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ endpoin
ts ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ endpoints ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ endpoints ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields
(file:/C:/Users/DELL/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstre
am-1.3.1.jar) to field java.util.Properties.defaults
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.x
stream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
ive access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Packaging webapp
[INFO] Assembling webapp [endpoints] in [C:\Users\DELL\Downloads\Test\endpoints\
target\endpoints-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\DELL\Downloads\Test\endpoints\src\main
\webapp]
[INFO] Webapp assembled in [187 msecs]
[INFO] Building war: C:\Users\DELL\Downloads\Test\endpoints\target\endpoints-1.0
-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] <<< appengine-maven-plugin:1.3.1:run (default-cli) < package @ endpoints
<<<
[INFO]
[INFO]
[INFO] --- appengine-maven-plugin:1.3.1:run (default-cli) @ endpoints ---
May 10, 2018 6:25:00 AM com.google.cloud.tools.appengine.cloudsdk.CloudSdk logCo
mmand
INFO: submitting command: C:\Program Files\Java\jdk-10.0.1\bin\java.exe -javaage
nt:C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appe
ngine\google\appengine\tools\java\lib\agent\appengine-agent.jar -Dappengine.sdk.
root=C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_ap
pengine\google\appengine\tools\java -cp C:\Program Files (x86)\Google\Cloud SDK\
google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\lib\appen
gine-tools-api.jar com.google.appengine.tools.development.DevAppServerMain --all
ow_remote_shutdown --disable_update_check C:\Users\DELL\Downloads\Test\endpoints
\target\endpoints-1.0-SNAPSHOT
[INFO] GCLOUD: Warning: Google App Engine Java 7 runtime is deprecated.
[INFO] GCLOUD: Warning: See https://cloud.google.com/appengine/docs/deprecations
/java7
[INFO] GCLOUD: java.lang.RuntimeException: Unable to create a DevAppServer
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory.do
CreateDevAppServer(DevAppServerFactory.java:352)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory.ac
cess$000(DevAppServerFactory.java:31)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory$1.
run(DevAppServerFactory.java:285)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory$1.
run(DevAppServerFactory.java:282)
[INFO] GCLOUD: at java.base/java.security.AccessController.doPrivileged(Native
Method)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory.cr
eateDevAppServer(DevAppServerFactory.java:281)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerMain$Start
Action.apply(DevAppServerMain.java:348)
[INFO] GCLOUD: at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(
Parser.java:45)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerMain.run(D
evAppServerMain.java:223)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerMain.main(
DevAppServerMain.java:214)
[INFO] GCLOUD: Caused by: java.lang.ClassCastException: ClassLoader is jdk.inter
nal.loader.ClassLoaders$AppClassLoader@7591083d, not a URLClassLoader.
[INFO] GCLOUD: at com.google.apphosting.utils.security.SecurityManagerInstaller
.generatePolicyFile(SecurityManagerInstaller.java:139)
[INFO] GCLOUD: at com.google.apphosting.utils.security.SecurityManagerInstaller
.install(SecurityManagerInstaller.java:94)
[INFO] GCLOUD: at com.google.appengine.tools.development.DevAppServerFactory.do
CreateDevAppServer(DevAppServerFactory.java:329)
[INFO] GCLOUD: ... 9 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.857 s
[INFO] Finished at: 2018-05-10T06:25:01+05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3
.1:run (default-cli) on project endpoints: Execution default-cli of goal com.goo
gle.cloud.tools:appengine-maven-plugin:1.3.1:run failed: Non zero exit: 1 -> [He
lp 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal c
om.google.cloud.tools:appengine-maven-plugin:1.3.1:run (default-cli) on project
endpoints: Execution default-cli of goal com.google.cloud.tools:appengine-maven-
plugin:1.3.1:run failed: Non zero exit: 1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccesso
rImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMetho
dAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
29)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356
)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
li of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:run failed: Non z
ero exit: 1
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccesso
rImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMetho
dAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
29)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356
)
Caused by: com.google.cloud.tools.appengine.api.AppEngineException: Non zero exi
t: 1
at com.google.cloud.tools.appengine.cloudsdk.process.NonZeroExceptionExitLis
tener.onExit (NonZeroExceptionExitListener.java:30)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcess
Runner.syncRun (DefaultProcessRunner.java:211)
at com.google.cloud.tools.appengine.cloudsdk.internal.process.DefaultProcess
Runner.run (DefaultProcessRunner.java:137)
at com.google.cloud.tools.appengine.cloudsdk.CloudSdk.runDevAppServer1Comman
d (CloudSdk.java:300)
at com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDevServer1.run
(CloudSdkAppEngineDevServer1.java:131)
at com.google.cloud.tools.maven.RunMojo.runServer (RunMojo.java:286)
at com.google.cloud.tools.maven.RunMojo.execute (RunMojo.java:282)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBui
ldPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.ja
va:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (
LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreaded
Builder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleSt
arter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccesso
rImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMetho
dAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launche
r.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:2
29)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launc
her.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356
)
[ERROR]
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
C:\Users\DELL\Downloads\Test\endpoints>
我了解只有一个错误 项目未定义Maven所需的最低版本。 我在pom中设置了最低版本,但仍然存在相同的错误。
在此之后,我还尝试更新gcloud组件,gcloud components update
但无法解决此错误。
我正在使用 JDK10
我还有另一个问题,这个项目是针对 java7 还是针对 java8 。我想在 java8
中运行该项目,这就是为什么要设置它,-Djava8=true
但是我不认为该项目是为java8环境创建的,不是吗?如果没有,我该怎么办?
而 appengine-maven-plugin 错误呢?我该如何解决?而且为什么我会看到此消息, Cloud SDK中
是否有任何问题?或还有其他原因。
如此处所示:
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
这是Java 7,因此,如果要使用Java 8运行它,则必须将1.7和1.8的外观都更改为。
appengine-maven-plugin 的错误是您尝试使用Java 7,同时在命令中说要使用Java 8。
问题内容: 命令失败,并显示退出代码 我删除了衍生数据。我努力了 : 钥匙串访问->右键单击登录->再次锁定并解锁->清除Xcode项目 重新启动机器,无用 尝试归档项目时如何解决“ ”错误。 我正在使用那些图书馆 问题答案: 去 -> -> -> ->
一直在尝试gluon的client-maven-plugin,但反复得到; [Thu Aug 15 21:56:33 BST 2019][FINE]验证AssetCatalog得命令:null--输出-格式人类可读文本--app-icon AppIcon--输出-部分-信息-plist.../target/client/macos-x86_64/GVM/TMP/partial-plists/ass
错误:任务': app: transformClassesSusDexForDebug'执行失败。 com.android.build.api.transform。TransformException:java.lang.RuntimeException:com.android.ide.common.process。ProcessException:java.util.concurrent。Exe
我正在学习spring boot应用程序。 我有一个非常简单的web应用程序,它只包含一个控制器、一个配置类和一个jsp文件。 我的pom文件内容如下:
com.android.ide.common.Process.processException:org.gradle.Process.internal.execException:Process'command'c:\program files\java\jdk1.8.0_40\bin\java.exe“以非零退出值2完成 我该怎么解决?请帮帮我!
问题内容: 当前(版本10.0)更新到最新版本的Xcode后,该项目无法构建,因为它发现了一些有关“ Command CompileSwift失败,退出代码非零”失败的错误。 我该如何解决这个错误? 它们出现在项目内部使用的大多数Pod中(我使用CocoaPods)。 我尝试将Pod版本和Pod更新到可用的最新版本,但是问题仍然存在。 我在网上搜索了很多内容,关于此问题的信息很少。 问候。 问题答