4
大約一天兩次,我們得到我們構建一個NullPointerException:奇怪的NullPointerException Maven的資源 - 插件
[06:44:23]: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project spring-lib: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed. NullPointerException -> [Help 1]
[06:44:23]: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources (default-resources) on project spring-lib: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed.
[06:44:23]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
[06:44:23]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[06:44:23]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[06:44:23]: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[06:44:23]: at org.apache.maven.lifecycle.internal.LifecycleThreadedBuilder$1.call(LifecycleThreadedBuilder.java:167)
[06:44:23]: at org.apache.maven.lifecycle.internal.LifecycleThreadedBuilder$1.call(LifecycleThreadedBuilder.java:164)
[06:44:23]: at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[06:44:23]: at java.util.concurrent.FutureTask.run(FutureTask.java:138)
[06:44:23]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
[06:44:23]: at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
[06:44:23]: at java.util.concurrent.FutureTask.run(FutureTask.java:138)
[06:44:23]: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[06:44:23]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[06:44:23]: at java.lang.Thread.run(Thread.java:619)
[06:44:23]: Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed.
[06:44:23]: at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
[06:44:23]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[06:44:23]: ... 13 more
[06:44:23]: Caused by: java.lang.NullPointerException
[06:44:23]: at java.util.ArrayList.<init>(ArrayList.java:131)
[06:44:23]: at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filteredFileExtension(DefaultMavenResourcesFiltering.java:115)
[06:44:23]: at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:264)
[06:44:23]: at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo.java:310)
[06:44:23]: at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[06:44:23]: ... 14 more
這都在隨機時間,以及未來建設不會失敗。
我已經搜索了這個故障,沒有發現任何東西。我有這種直覺,認爲這可能是由maven-resources-plugin中的併發問題引起的。
我們得到這個錯誤與maven資源插件2.4.3,現在與2.5。我們的Maven版本是3.0.3。
我們用下面的參數執行上的TeamCity構建:
Goals: install
Additional Maven command line parameters: -T 2C -e -P!releasex,integration
-Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true
-Dmaven.test.haltafterfailure=false -Dmaven.junit.timeout=1000000
-DwarProject.packaging=jar
任何形式的解決此問題的幫助表示讚賞。
問題是,這種情況在罕見的情況下發生,而構建每10分鐘左右運行一次。使用-X運行會減慢構建速度。我也不感興趣的無用日誌的Gig,直到這個問題彈出agin。 –
看到我上面的修改。 –
我沒有更改Maven插件代碼。 maven-resource-plugin被標記爲線程安全的,雖然可能有一個bug ...我也會在那裏發佈一個jira的問題。 –