Can't build sonarlint-intellij from source

The following steps when trying to build SonarLint from source lead to an error:
$ git clone GitHub - SonarSource/sonarlint-intellij: SonarLint for IntelliJ
$ cd sonarlint-intellij
$ ./gradlew build

This is the error one runs in to:


> Configure project :
The 'sonarqube' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.
The 'sonar' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':prepareSandbox'.
> Could not resolve all files for configuration ':runtimeClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10.
     Required by:
         project :
         project : > project :common
         project : > project :rider
         project : > project :git
      > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10.
         > Could not get resource 'https://repox.jfrog.io/repox/sonarsource/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.8.10/kotlin-stdlib-jdk8-1.8.10.pom'.
            > Could not HEAD 'https://repox.jfrog.io/repox/sonarsource/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.8.10/kotlin-stdlib-jdk8-1.8.10.pom'. Received status code 401 from server: 
   > Could not resolve org.sonarsource.sonarlint.core:sonarlint-core:9.8.0.76914.
     Required by:
         project :
         project : > project :common
         project : > project :clion
         project : > project :rider
         project : > project :git
      > Could not resolve org.sonarsource.sonarlint.core:sonarlint-core:9.8.0.76914.
         > Could not get resource 'https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/core/sonarlint-core/9.8.0.76914/sonarlint-core-9.8.0.76914.pom'.
            > Could not HEAD 'https://repox.jfrog.io/repox/sonarsource/org/sonarsource/sonarlint/core/sonarlint-core/9.8.0.76914/sonarlint-core-9.8.0.76914.pom'. Received status code 401 from server: 
   > Could not resolve commons-lang:commons-lang:2.6.
     Required by:
         project :
      > Could not resolve commons-lang:commons-lang:2.6.
         > Could not get resource 'https://repox.jfrog.io/repox/sonarsource/commons-lang/commons-lang/2.6/commons-lang-2.6.pom'.
            > Could not HEAD 'https://repox.jfrog.io/repox/sonarsource/commons-lang/commons-lang/2.6/commons-lang-2.6.pom'. Received status code 401 from server: 


Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s

in the build.gradle.kts file, The comments tell me to set a username and password, where to get these values from? Did I miss some other important information?


// The environment variables ARTIFACTORY_PRIVATE_USERNAME and ARTIFACTORY_PRIVATE_PASSWORD are used on CI env
// On local box, please add artifactoryUsername and artifactoryPassword to ~/.gradle/gradle.properties

Hi @zhenyuqiaotencent ,

We are aware of this issue and a fix might be implemented depending on the priorities of our team.

Thank you

Following @eray.felek’s message, I created this ticket so you can track the status. The changes got merged and should already be available on the main branch.

Thank you for using SonarLint! :sonarlint:

I update the repositories priorities value to mavencentral() solve the issue.

That’s the idea, yes. Note that you might encounter some access issues because we only publish artifacts to Maven Central when the dependency is released, meaning that during the development phase, you might experience some issues due to artifacts not being released. You should not face any problems building from a tag version, though.