SonarQube在报告分析期间抛出DirectoryNotEmptyException吗?

时间:2018-07-24 05:40:19

标签: sonarqube

<b>INFO] Analysis reports compressed in 1466ms, zip size=1 MB<br/>
[ERROR] Failed to delete temp folder <br/>
java.nio.file.DirectoryNotEmptyException: 
 D:\MyModule\target\sonar\.sonartmp</b><br/>
        at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:266)
        at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
        at java.nio.file.Files.deleteIfExists(Files.java:1165)
        at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.postVisitDirectory(DefaultTempFolder.java:121)
        at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.postVisitDirectory(DefaultTempFolder.java:110)
        at java.nio.file.Files.walkFileTree(Files.java:2688)
        at java.nio.file.Files.walkFileTree(Files.java:2742)
        at org.sonar.api.utils.internal.DefaultTempFolder.clean(DefaultTempFolder.java:97)
        at org.sonar.api.utils.internal.DefaultTempFolder.stop(DefaultTempFolder.java:106)
        at org.sonar.scanner.analysis.AnalysisTempFolderProvider.stop(AnalysisTempFolderProvider.java:61)
        at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1048)
        at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:803)
        at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentContainer.java:165)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:124)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:81)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:132)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy26.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
        at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65)
        at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        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:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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)

1 个答案:

答案 0 :(得分:0)

Linux 计算机上尝试相同的操作,它将完美执行。如果您对 .sonartmp 文件夹没有足够的权限(R / W),则会​​出现此错误。这通常发生在Windows框中。