我有使用Gradle + Webpack构建的应用程序(Playframework + Angular4)。当我在本地运行我的应用程序时,它工作正常:
user@debian:~/workspace$ ./gradlew :dist :api:runapi
....
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
> Task :api:runPlayBinary
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.xrender=true
Listening for transport dt_socket at address: 9999
<===========--> 85% EXECUTING [1m 46s]
> :api:runPlayBinary > Running at http://localhost:9000/
所以,Netty开始了,一切都很好。终端正在等待......应用程序可以访问。
但是,当我尝试使用Jenkins时,我会得到以下日志:
13:53:33 :api:createPlayBinaryAssetsJar
13:53:39 :api:compilePlayBinaryPlayRoutes
13:53:45 :api:compilePlayBinaryScala
13:53:45 Pruning sources from previous analysis, due to incompatible CompileSetup.
13:53:54 /var/lib/jenkins/workspace/imaster/api/app/controllers/UserController.scala:27: match may not be exhaustive.
13:53:54 It would fail on the following input: None
13:53:54 users.getById(id).map { case Some(user) =>
13:53:54 ^
13:54:02 there were 3 feature warning(s); re-run with -feature for details
13:54:02 two warnings found
13:54:04 :api:processPlayBinaryPlayResources
13:54:04 :api:createPlayBinaryJar
13:54:04 :api:playBinary
13:54:04 :api:runPlayBinary
13:54:04 Listening for transport dt_socket at address: 9999
13:54:05 [35m--- (Running the application, auto-reloading is enabled) ---[0m
13:54:05
13:54:06 [[37minfo[0m] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
13:54:06 :api:runapi
13:54:06
13:54:06 BUILD SUCCESSFUL in 1m 54s
13:54:06 11 actionable tasks: 9 executed, 2 up-to-date
13:54:07 Finished: SUCCESS
没有任何错误,但Netty看起来像已停止(它不会像上面的示例那样等待),当我尝试访问localhost:9000时,我收到“找不到服务器”。
我尝试手动运行app,从Jenkins工作区目录中运行。
如何使用Gradle和Jenkins运行Netty?
提前谢谢!