Jenkins不会使用OAuth 2.0部署GAE Maven项目

时间:2016-04-20 10:28:51

标签: java maven google-app-engine jenkins oauth-2.0

最近,谷歌摆脱了在应用程序部署期间弃用的ClientLogin身份验证。

我在question中关注@ttimmons回答,它在Eclipse运行配置部署中运行良好。

现在我想使用Jenkins在生产环境中构建应用程序。我已经将 mvn gae:deploy 命令更改为Jenkins项目构建配置中的 mvn appengine:update 。当我尝试运行构建时,应用程序构建没有问题但是在部署时我得到了以下Jenkins的控制台输出:

Please enter code: Encountered a problem: No line found
Please see the logs *here goes system path* for further information.
ERROR: Maven JVM terminated unexpectedly with exit code 1
Finished: FAILURE

在日志中我有这个例外:

java.util.NoSuchElementException: No line found
    at java.util.Scanner.nextLine(Scanner.java:1585)
    at com.google.appengine.tools.admin.PromptReceiver.waitForCode(PromptReceiver.java:25)
    at com.google.appengine.tools.admin.OAuth2Native.authorize(OAuth2Native.java:255)
    at com.google.appengine.tools.admin.AppCfg.authorizeOauth2(AppCfg.java:486)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:197)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:130)
    at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:126)
    at com.google.appengine.appcfg.AbstractAppCfgMojo.executeAppCfgCommand(AbstractAppCfgMojo.java:259)
    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.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
    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.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:181)
    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 hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:324)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

解决:

原来,Jenkins有一些maven授权问题(来自maven的settings.xml文件的用户名和密码的<servers>节点不可用)。从Jenkins机器级别(cmd)上传应用程序解决了这个问题。