当我将其加载到系统中时,我从位桶中克隆了一个项目。 Maven下载了所有依赖项,但是显然当Maven Wildfly插件服务器启动并运行集成测试时,我得到了一个错误。 Maven Wildfly插件无法在60秒内启动。我的老板先前说过,那是我的PC在2gb的ram上运行,我不得不升级到4gb的ram,但是当我尝试启动服务器时,仍然出现相同的错误。
如果有人可以帮助我解决有关在指定时间内启动服务器的问题,我已附加了我的stacktrace。谢谢。
Caused by: java.util.concurrent.TimeoutException: The server did not start within 60 seconds.
at org.wildfly.plugin.core.ServerHelper.waitForStandalone (ServerHelper.java:318)
at org.wildfly.plugin.server.StartMojo.execute (StartMojo.java:290)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java: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.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.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:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
'cmd' is not recognized as an internal or external command,
可操作的程序或批处理文件。
答案 0 :(得分:1)
您可以在pom.xml中设置属性以增加超时时间: https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html#timeout
应该看起来像这样:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.0.0.Final</version>
<configuration>
<timeout>300</timeout>
</configuration>
</plugin>
您也可以在pom.xml中将其设置为属性
<properties>
<wildfly.timeout>300</wildfly.timeout>
</properties>
如果要将超时阈值增加到300秒
答案 1 :(得分:0)
除了askepan提到的配置外,您还可以设置startupTimeout属性
wildfly:start
startupTimeout-长: 启动时使用的超时值 服务器。默认值为60。用户属性为: wildfly.startupTimeout。别名是:启动超时。
请参见https://docs.jboss.org/wildfly/plugins/maven/latest/start-mojo.html#startupTimeout
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.2.2.Final</version>
<configuration>
<startupTimeout>300</startupTimeout>
</configuration>
</plugin>