为什么 Gretty 很慢?

Why Gretty is slow?

我不知道为什么我的 gretty 需要很长时间才能完成 运行 appStart 任务。 任何人都知道为什么它在步骤 "appStart" 停止,我需要等待大约 30 分钟才能继续下一步...

它是在后台处理什么,还是只是在等待什么?

:copyPropertiesFile UP-TO-DATE
:processResources
:classes
:prepareInplaceWebAppClasses
:prepareInplaceWebApp
:appStart
16:29:16 INFO  No Spring WebApplicationInitializer types detected on classpath
16:29:17 INFO  Initializing Spring root WebApplicationContext
INFO  ContextLoader - Root WebApplicationContext: initialization started
INFO  AnnotationConfigWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon Oct 07 16:29:18 SGT 2019]; root of context hierarchy
INFO  AnnotationConfigWebApplicationContext - Successfully resolved class for [com.sample.api.web.config.WebApplicationConfig]
INFO  AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO  PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'asyncConfig' of type [class com.sample.api.web.config.async.AsyncConfig$$EnhancerBySpringCGLIB$$e08b8abf] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO  ThreadPoolTaskExecutor - Initializing ExecutorService

它总是 运行 直到 :appStart 步骤,然后在继续下一行之前就停在那里。是没有 spring webapplicationinitializer 造成的吗?

任何人都可以指导我如何确定根本原因或解决问题的方法?

我正在使用 gretty 1.4.0

谢谢

更新: 我在 运行 应用程序之前将这些添加到我的 eclipse jvm 参数中,它告诉我它确实在处理某些事情。

-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog 
-Dorg.eclipse.jetty.LEVEL=DEBUG

根据我最近的观察,它正在尝试扫描

2019-10-07 17:44:41.521:DBUG:oejuc.AbstractLifeCycle:starting org.eclipse.jetty.util.Scanner@1d2ca98
2019-10-07 17:44:42.157:DBUG:oejuc.AbstractLifeCycle:STARTED org.eclipse.jetty.util.Scanner@1d2ca98
2019-10-07 17:44:43.957:DBUG:oeju.Scanner:scanned [C:\Users...

奇怪的是,扫描文件的最后一行大约每秒生成一次,并且显示的文件列表完全相同...

所有扫描的线都显示为红色(我认为这意味着它无法扫描?) 因此,它将继续向红线发送垃圾邮件 30 分钟,然后再继续..

有什么想法吗?

为了帮助其他可能遇到类似问题的人,您可以尝试添加

scanInterval = 0
debugSuspend = false

进入 build.gradle 内的 gretty 块。它可以减少构建时间。