简体   繁体   中英

Jenkins won't deploy GAE Maven project using OAuth 2.0

Lately Google got rid of deprecated ClientLogin authentication durning application deployment.

I followed @ttimmons answer in this question and it worked fine in Eclipse run configuration deployment.

Now I want to build the application on production env using Jenkins. I've changed the mvn gae:deploy command to mvn appengine:update in Jenkins project build configuration, too. When I'm trying to run the build, application is built with no problem but when it comes to deployment I got the following Jenkins' console output:

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

In the log I have this exception:

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)

Any idea how to solve this issue?

Solved:

Turned out, that Jenkins had some maven authorization issue ( <servers> node with username and password from maven's settings.xml file wasn't available). Uploading application from Jenkins machine level (cmd) solved the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM