SpotBugs и Maven с машиной Linux, использующей excludeFilterFile и сбой конфигурации плагина
Я использую плагин SpotBugs для Maven.
Я смог создать свой собственный FilterFile и использовать его с конфигурацией excludeFilterFile. Я использовал следующую страницу: SpotBugs Maven Plugin исключить каталог
Я также смог создать свою собственную реализацию плагина SpotBugs, используя https://spotbugs.readthedocs.io/en/latest/implement-plugin.html и использовать его в другом модуле.
Когда я пытался использовать файл фильтра и мою собственную реализацию плагина SpotBugs, я получал ошибку. Примечание. Это прекрасно работает, когда я создаю только с файлом фильтра или только с моей собственной конфигурацией плагина. Вопрос в том, когда я определяю оба. Это ошибка или у меня что-то не так с моей конфигурацией?
Что также интересно, я могу успешно построить проект на компьютере с Windows. Похоже, это уникально для машины Linux.
Мой фрагмент кода:
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}</version>
<executions>
<execution>
<configuration combine.self="override">
<excludeFilterFile>${basedir}/src/main/resources/spotBugsIgnore.xml</excludeFilterFile>
<plugins>
<plugin>
<groupId>veeva.ecm.framework</groupId>
<version>${version}</version>
<artifactId>spotbugs4caf</artifactId>
</plugin>
</plugins>
</configuration>
<phase>compile</phase>
<id>run spotbugs</id>
<goals>
<goal>spotbugs</goal>
</goals>
</execution>
</executions>
</plugin>
Моя ошибка:
11:59:30 [ERROR] Cannot create file-based resource. /home/centos/workspace/AutoInfra/Common_Automation_Framework_Commit/common-automation-framework/target/classes -> [Help 1]
11:59:30 org.codehaus.plexus.resource.loader.FileResourceCreationException: Cannot create file-based resource.
11:59:30 at org.codehaus.plexus.resource.loader.FileResourceLoader.getResourceAsFile(FileResourceLoader.java:112)
11:59:30 at org.codehaus.plexus.resource.loader.FileResourceLoader$getResourceAsFile.call(Unknown Source)
11:59:30 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:143)
11:59:30 at org.codehaus.mojo.spotbugs.ResourceHelper.getResourceAsFile(ResourceHelper.groovy:82)
11:59:30 at org.codehaus.mojo.spotbugs.ResourceHelper.getResourceFile(ResourceHelper.groovy:72)
11:59:30 at org.codehaus.mojo.spotbugs.ResourceHelper$getResourceFile.call(Unknown Source)
11:59:30 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsPluginsTrait$Trait$Helper$_getSpotbugsPlugins_closure2.doCall(SpotBugsPluginsTrait.groovy:105)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
11:59:30 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:59:30 at java.lang.reflect.Method.invoke(Method.java:497)
11:59:30 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
11:59:30 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
11:59:30 at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
11:59:30 at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
11:59:30 at groovy.lang.Closure.call(Closure.java:411)
11:59:30 at groovy.lang.Closure.call(Closure.java:427)
11:59:30 at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2102)
11:59:30 at org.codehaus.groovy.runtime.dgm$181.invoke(Unknown Source)
11:59:30 at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:246)
11:59:30 at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:55)
11:59:30 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsPluginsTrait$Trait$Helper.getSpotbugsPlugins(SpotBugsPluginsTrait.groovy:96)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsPluginsTrait$Trait$Helper$getSpotbugsPlugins$0.call(Unknown Source)
11:59:30 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsMojo.getSpotbugsPlugins(SpotBugsMojo.groovy)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsMojo.getSpotbugsArgs(SpotBugsMojo.groovy:832)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
11:59:30 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:59:30 at java.lang.reflect.Method.invoke(Method.java:497)
11:59:30 at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
11:59:30 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
11:59:30 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsMojo.executeSpotbugs(SpotBugsMojo.groovy:1007)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
11:59:30 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:59:30 at java.lang.reflect.Method.invoke(Method.java:497)
11:59:30 at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
11:59:30 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
11:59:30 at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
11:59:30 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:168)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsMojo.canGenerateReport(SpotBugsMojo.groovy:547)
11:59:30 at org.codehaus.mojo.spotbugs.SpotBugsMojo.execute(SpotBugsMojo.groovy:682)
11:59:30 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
11:59:30 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
11:59:30 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
11:59:30 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
11:59:30 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
11:59:30 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
11:59:30 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
11:59:30 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
11:59:30 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
11:59:30 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
11:59:30 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
11:59:30 at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
11:59:30 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:59:30 at java.lang.reflect.Method.invoke(Method.java:497)
11:59:30 at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
11:59:30 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
11:59:30 at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:59:30 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
11:59:30 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
11:59:30 at java.lang.reflect.Method.invoke(Method.java:497)
11:59:30 at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
11:59:30 at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
11:59:30 at hudson.remoting.UserRequest.perform(UserRequest.java:120)
11:59:30 at hudson.remoting.UserRequest.perform(UserRequest.java:48)
11:59:30 at hudson.remoting.Request$2.run(Request.java:326)
11:59:30 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
11:59:30 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11:59:30 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
11:59:30 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
11:59:30 at java.lang.Thread.run(Thread.java:745)
11:59:30 Caused by: java.nio.file.DirectoryNotEmptyException: /home/centos/workspace/AutoInfra/Common_Automation_Framework_Commit/common-automation-framework/target/classes
11:59:30 at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:564)
11:59:30 at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
11:59:30 at java.nio.file.Files.copy(Files.java:1274)
11:59:30 at org.codehaus.plexus.util.NioFiles.copy(NioFiles.java:140)
11:59:30 at org.codehaus.plexus.util.FileUtils.doCopyFileUsingNewIO(FileUtils.java:1150)
11:59:30 at org.codehaus.plexus.util.FileUtils.doCopyFile(FileUtils.java:1100)
11:59:30 at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1085)
11:59:30 at org.codehaus.plexus.resource.loader.FileResourceLoader.getResourceAsFile(FileResourceLoader.java:106)
11:59:30 ... 87 more