我正在使用Electric Commander部署Java项目,在运行站点部署目标时,项目在集成测试期间失败,同时为findbugs-maven-plugin生成报告。
下面的输出显示Findbugs报告在显示“Fork值为true”后卡住,失败后显示“[ERROR]无法执行目标org.apache.maven.plugins:maven-site-plugin:3.3 :项目集成模块上的站点(默认站点):目标的执行默认站点org.apache.maven.plugins:maven-site-plugin:3.3:站点失败:超时:终止子进程 - > [帮助1]“
[INFO] Generating "FindBugs Report" report --- findbugs-maven-plugin:2.5.2
[INFO] Locale is en
[INFO] Fork Value is true
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Parent Module ......................... SUCCESS [2:27.472s]
[INFO] Module 1 .............................. SUCCESS [6:13.576s]
[INFO] Module 2 .............................. SUCCESS [7:12.407s]
[INFO] Module 3 .............................. SUCCESS [3:10.419s]
[INFO] Integration Tests Module .............. FAILURE [21:18.987s]
[INFO] Module 4 .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40:30.544s
[INFO] Finished at: Tue Jan 24 18:00:08 CST 2017
[INFO] Final Memory: 238M/692M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project integration-module: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Timeout: killed the sub-process -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :integration-module
我还在我的本地计算机上使用调试选项mvn site -X
尝试了此操作,并且遇到了相同的超时问题。这是(缩短的)调试输出:
[INFO] Generating "FindBugs Report" report --- findbugs-maven-plugin:2.5.2
[DEBUG] Inside canGenerateReport..... false
[DEBUG] canGenerate Src is true
[DEBUG] canGenerate is true
[DEBUG] Inside canGenerateReport..... false
[DEBUG] canGenerate Src is true
[DEBUG] canGenerate is true
[INFO] Locale is en
[DEBUG] ****** FindBugsMojo executeReport *******
[DEBUG] report Output Directory is /Users/my_username/workspace/project/integration-module/target/site
[DEBUG] Output Directory is /Users/my_username/workspace/project/integration-module/target/site
[DEBUG] Classes Directory is /Users/my_username/workspace/project/integration-module/target/classes
[DEBUG] resourceManager outputDirectory is /Users/my_username/workspace/project/integration-module/target
[DEBUG] Plugin Artifacts to be added ->[org.codehaus.mojo:findbugs-maven-plugin:maven-plugin:2.5.2:, org.codehaus.gmaven:gmaven-mojo:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-api:jar:1.4:compile, org.codehaus.gmaven.feature:gmaven-feature-api:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-1.5:jar:1.4:compile, org.codehaus.gmaven.feature:gmaven-feature-support:jar:1.4:compile, org.codehaus.groovy:groovy-all-minimal:jar:1.5.8:compile, org.apache.ant:ant:jar:1.8.2:compile, org.apache.ant:ant-launcher:jar:1.8.2:compile, jline:jline:jar:0.9.94:compile, org.codehaus.plexus:plexus-interpolation:jar:1.1:compile, org.codehaus.gmaven:gmaven-plugin:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-loader:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-support:jar:1.4:compile, org.sonatype.gshell:gshell-io:jar:2.4:compile, com.thoughtworks.qdox:qdox:jar:1.12:compile, org.apache.maven.shared:file-management:jar:1.2.1:compile, org.apache.maven.shared:maven-shared-io:jar:1.1:compile, commons-lang:commons-lang:jar:2.6:compile, org.slf4j:slf4j-api:jar:1.5.10:compile, org.sonatype.gossip:gossip:jar:1.2:compile, org.apache.maven.reporting:maven-reporting-impl:jar:2.1:compile, commons-validator:commons-validator:jar:1.2.0:compile, commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-digester:commons-digester:jar:1.6:compile, commons-logging:commons-logging:jar:1.0.4:compile, oro:oro:jar:2.0.8:compile, xml-apis:xml-apis:jar:1.0.b2:compile, org.codehaus.groovy:groovy-all:jar:1.7.4:compile, org.apache.maven.doxia:doxia-core:jar:1.1.3:compile, org.apache.maven.doxia:doxia-logging-api:jar:1.1.3:compile, xerces:xercesImpl:jar:2.9.1:compile, commons-httpclient:commons-httpclient:jar:3.1:compile, commons-codec:commons-codec:jar:1.2:compile, org.apache.maven.doxia:doxia-decoration-model:jar:1.1.3:compile, org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.3:compile, org.apache.maven.doxia:doxia-module-fml:jar:1.1.3:compile, org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile, org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile, org.apache.velocity:velocity:jar:1.5:compile, commons-collections:commons-collections:jar:3.2:compile, org.apache.maven.shared:maven-doxia-tools:jar:1.2.1:compile, commons-io:commons-io:jar:1.4:compile, com.google.code.findbugs:findbugs-ant:jar:2.0.1:compile, com.google.code.findbugs:findbugs:jar:2.0.1:compile, com.google.code.findbugs:bcel:jar:2.0.1:compile, com.google.code.findbugs:jsr305:jar:2.0.1:compile, com.google.code.findbugs:jFormatString:jar:2.0.1:compile, com.google.code.findbugs:annotations:jar:2.0.1:compile, dom4j:dom4j:jar:1.6.1:compile, jaxen:jaxen:jar:1.1.1:compile, jdom:jdom:jar:1.0:compile, xom:xom:jar:1.0:compile, xerces:xmlParserAPIs:jar:2.6.2:compile, xalan:xalan:jar:2.6.0:compile, com.ibm.icu:icu4j:jar:2.6.1:compile, asm:asm:jar:3.3:compile, asm:asm-tree:jar:3.3:compile, asm:asm-commons:jar:3.3:compile, jgoodies:plastic:jar:1.2.0:compile, org.codehaus.plexus:plexus-resources:jar:1.0-alpha-4:compile, org.codehaus.plexus:plexus-utils:jar:1.5.6:compile, org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile]
[DEBUG] XML outputFile is /Users/my_username/workspace/project/integration-module/target/findbugsXml.xml
[DEBUG] XML output Directory is /Users/my_username/workspace/project/integration-module/target
[DEBUG] ****** FindBugsMojo executeFindbugs *******
[DEBUG] ****** Executing FindBugsMojo *******
[DEBUG] resourceManager outputDirectory is /Users/my_username/workspace/project/integration-module/target
[DEBUG] Plugin Artifacts to be added -> [org.codehaus.mojo:findbugs-maven-plugin:maven-plugin:2.5.2:, org.codehaus.gmaven:gmaven-mojo:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-api:jar:1.4:compile, org.codehaus.gmaven.feature:gmaven-feature-api:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-1.5:jar:1.4:compile, org.codehaus.gmaven.feature:gmaven-feature-support:jar:1.4:compile, org.codehaus.groovy:groovy-all-minimal:jar:1.5.8:compile, org.apache.ant:ant:jar:1.8.2:compile, org.apache.ant:ant-launcher:jar:1.8.2:compile, jline:jline:jar:0.9.94:compile, org.codehaus.plexus:plexus-interpolation:jar:1.1:compile, org.codehaus.gmaven:gmaven-plugin:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-loader:jar:1.4:compile, org.codehaus.gmaven.runtime:gmaven-runtime-support:jar:1.4:compile, org.sonatype.gshell:gshell-io:jar:2.4:compile, com.thoughtworks.qdox:qdox:jar:1.12:compile, org.apache.maven.shared:file-management:jar:1.2.1:compile, org.apache.maven.shared:maven-shared-io:jar:1.1:compile, commons-lang:commons-lang:jar:2.6:compile, org.slf4j:slf4j-api:jar:1.5.10:compile, org.sonatype.gossip:gossip:jar:1.2:compile, org.apache.maven.reporting:maven-reporting-impl:jar:2.1:compile, commons-validator:commons-validator:jar:1.2.0:compile, commons-beanutils:commons-beanutils:jar:1.7.0:compile, commons-digester:commons-digester:jar:1.6:compile, commons-logging:commons-logging:jar:1.0.4:compile, oro:oro:jar:2.0.8:compile, xml-apis:xml-apis:jar:1.0.b2:compile, org.codehaus.groovy:groovy-all:jar:1.7.4:compile, org.apache.maven.doxia:doxia-core:jar:1.1.3:compile, org.apache.maven.doxia:doxia-logging-api:jar:1.1.3:compile, xerces:xercesImpl:jar:2.9.1:compile, commons-httpclient:commons-httpclient:jar:3.1:compile, commons-codec:commons-codec:jar:1.2:compile, org.apache.maven.doxia:doxia-decoration-model:jar:1.1.3:compile, org.apache.maven.doxia:doxia-module-xhtml:jar:1.1.3:compile, org.apache.maven.doxia:doxia-module-fml:jar:1.1.3:compile, org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile, org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile, org.apache.velocity:velocity:jar:1.5:compile, commons-collections:commons-collections:jar:3.2:compile, org.apache.maven.shared:maven-doxia-tools:jar:1.2.1:compile, commons-io:commons-io:jar:1.4:compile, com.google.code.findbugs:findbugs-ant:jar:2.0.1:compile, com.google.code.findbugs:findbugs:jar:2.0.1:compile, com.google.code.findbugs:bcel:jar:2.0.1:compile, com.google.code.findbugs:jsr305:jar:2.0.1:compile, com.google.code.findbugs:jFormatString:jar:2.0.1:compile, com.google.code.findbugs:annotations:jar:2.0.1:compile, dom4j:dom4j:jar:1.6.1:compile, jaxen:jaxen:jar:1.1.1:compile, jdom:jdom:jar:1.0:compile, xom:xom:jar:1.0:compile, xerces:xmlParserAPIs:jar:2.6.2:compile, xalan:xalan:jar:2.6.0:compile, com.ibm.icu:icu4j:jar:2.6.1:compile, asm:asm:jar:3.3:compile, asm:asm-tree:jar:3.3:compile, asm:asm-commons:jar:3.3:compile, jgoodies:plastic:jar:1.2.0:compile, org.codehaus.plexus:plexus-resources:jar:1.0-alpha-4:compile, org.codehaus.plexus:plexus-utils:jar:1.5.6:compile, org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile]
[DEBUG] outputFile is /Users/my_username/workspace/project/integration-module/target/findbugsXml.xml
[DEBUG] output Directory is /Users/my_username/workspace/project/integration-module/target
[DEBUG] Temp File is /Users/my_username/workspace/project/integration-module/target/findbugsTemp.xml
[INFO] Fork Value is true
[DEBUG] effort is Default
[DEBUG] effortParameter is default
[DEBUG] threshold is Default
[DEBUG] thresholdParameter is -medium
...
...
...
[DEBUG] Findbugs arg is -xml:withMessages
[DEBUG] Findbugs arg is -auxclasspathFromInput
[DEBUG] Findbugs arg is -projectName
[DEBUG] Findbugs arg is Integration Tests Module
[DEBUG] Findbugs arg is -effort:default
[DEBUG] Findbugs arg is -medium
[DEBUG] Findbugs arg is -nested:false
[DEBUG] Findbugs arg is -output
[DEBUG] Findbugs arg is /Users/my_username/workspace/project/integration-module/target/findbugsTemp.xml
[DEBUG] Findbugs arg is /Users/my_username/workspace/project/integration-module/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21:55 min
[INFO] Finished at: 2017-01-24T17:36:03-06:00
[INFO] Final Memory: 104M/252M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project integration-module: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Timeout: killed the sub-process -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project integration-module: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Timeout: killed the sub-process
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: Timeout: killed the sub-process
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: : Timeout: killed the sub-process
at org.apache.tools.ant.taskdefs.Java.fork(Java.java:794)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:756)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:730)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
at org.codehaus.mojo.findbugs.FindBugsMojo.executeFindbugs(FindBugsMojo.groovy:1004)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
at org.codehaus.mojo.findbugs.FindBugsMojo.executeReport(FindBugsMojo.groovy:640)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:219)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:319)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:135)
at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:175)
at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:138)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
[ERROR]
[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/PluginExecutionException
除了上述尝试之外,我还尝试将MAVEN_OPTS设置为包含-Dtimeout=25200000
(以毫秒为单位的时间相当于7小时)和其他一些荒谬的时间,但超时总是大约600000或10分钟(根据这一点,findbugs-maven-plugin的默认值:http://gleclaire.github.io/findbugs-maven-plugin/findbugs-mojo.html#timeout)。
这里的问题是我们已经删除了我们的版本,所以我们无法更改代码,这意味着我无法修改pom中的插件。
我有几个需要为集成测试模块运行的报告插件,但Findbugs报告是最不重要的,可以完全取出,但它恰好会导致问题。
有没有办法通过命令行或使用MAVEN_OPTS覆盖超时选项的findbugs-maven-plugin的默认设置?如果没有,有没有办法通过命令行跳过单个模块的Findbugs报告?即使Findbugs超时,另一种可能性是完成运行站点部署的选项;是否有Maven选项来防止站点部署失败?对这个问题的任何帮助都会很棒!