SonarQube for IntelliJ locks dependency jar files

Environment:

  • Java: Eclipse Adoptium jdk-21.0.5.11-hotspot
  • OS: Windows 10 Enterprise
  • IDE: IntelliJ IDEA 2024.3.1.1 (Community Edition)
  • SonarQube for IDE (Intellij): 10.14.1.80220
  • SonarQube Server: Community Edition Version 9.9.1 (build 69595)
  • Node.js: 23.6.0
  • Maven: 3.9.9

When using the SonarLint plugin in IntelliJ, the Java process org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli does not terminate after performing an analysis and keeps a handle on many jar files used as dependencies in the (maven) project. This results in locked JAR files, preventing them from being overwritten during development. The issue persists until the process is manually killed.

Steps to Reproduce

  • Create a Maven project with the following pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test-sonar</artifactId>
    <version>1.0.0-SNAPSHOT</version>
	<dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>33.4.0-jre</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-runtime</artifactId>
            <version>1.2.71</version>
        </dependency>
	</dependencies>
</project>
  • Create a dummy Kotlin class:
package test

class AKotlinClass {
}
  • Configure a connection to a SonarQube Server.
  • Bind the project to the SonarQube Server.
  • Run an analysis with SonarQube for IDE.
  • Wait for the analysis to complete.

At this point the the files “kotlin-runtime-1.2.71.jar” and “guava-33.4.0-jre.jar” are locked. Trying to delete them from the Maven’s local repository (default location should be: %USERPROFILE%.m2\repo) will fail.
LockHunter shows that the Java process org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli owns the files (as well as some other transitive dependencies):

Hey @jflecomte

Sorry for the long delay in a response.

Are you still facing this issue, including with the latest version of SonarQube for IDE?

I upgraded to SonarQube for IDE version 10.23.0.81344.
Also updated Node.js to 24.0.1.
Other components remain unchanged.

I’m still able to reproduce the issue, and a few members of my team experience it as well - though, interestingly, not all of them. I haven’t been able to pinpoint any configuration differences between those affected and those who are not.

One notable detail: the issue does not seem to occur in pure Java projects. However, as soon as Kotlin files are added, the problem begins to manifest.

Do you have any suggestions on how I could gather more meaningful diagnostic information to help narrow this down?

Hello @jflecomte, as a first step, it would be interesting to get the full logs of SonarQube for IDE.

Thank you!

Hello @jflecomte,

To investigate the issue further we still need analyzer log as first step, we might need something more.

Another point, from the pom.xml you shared the Kotlin version is 1.2.71. It’s a very old version, and we don’t guarantee to support it for a long time. The current supported Kotlin versions are 1.6..2.1 (see docs).

Best,
Margarita

Apologies for the delay—I’ve been a bit busy lately.

I updated the Kotlin dependency. Here’s the updated project:
SonarForIntelliJTest.zip (7.4 KB)

I performed a manual scan of my sample Kotlin file. Here is the output log from SonarQube for IDE with both the Analysis logs and Verbose output enabled:
SonarQubeForIDE.log (136.4 KB)

Here is a thread dump of IntelliJ - I think I can’t provide the full “Logs and Diagnostic Data” zip as it is too large (18,1 Mo).
threadDump-20250610-160509.txt (638.8 KB)

Note: In the mean time that my PC was upgraded from Windows 10 Enterprise to Windows 11 Enterprise (not a clean install, just an upgrade). I’m still having the issue.

Please let me know if you need anything else — I’ll do my best to provide any additional information you need!

Best regards,
JF

1 Like

Thanks for the update, I will have a look.

Best,
Margarita