Sudheer Konagalla
02/02/2025, 12:02 PMVampire
02/02/2025, 2:18 PMbuildSrc
or an included build is exactly the right way to centralize and reuse build logic.
For a set of common dependencies you could also use a bundle in a version catalog that you then use in the sub projects.
Btw. I strongly recommend switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support when using a good IDE like IntelliJ IDEA or Android Studio.Sudheer Konagalla
02/05/2025, 5:16 PM* What went wrong:
<https://github.com/chargebee/cb-openpay-libraries/actions/runs/13162527357/job/36734645017#step:6:37|36>
Execution failed for task ':buildSrc:compileJava'.
<https://github.com/chargebee/cb-openpay-libraries/actions/runs/13162527357/job/36734645017#step:6:38|37>
> Could not resolve all files for configuration ':buildSrc:compileClasspath'.
<https://github.com/chargebee/cb-openpay-libraries/actions/runs/13162527357/job/36734645017#step:6:39|38>
> Could not find org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929.
<https://github.com/chargebee/cb-openpay-libraries/actions/runs/13162527357/job/36734645017#step:6:40|39>
Searched in the following locations:
<https://github.com/chargebee/cb-openpay-libraries/actions/runs/13162527357/job/36734645017#step:6:41|40>
3 actionable tasks: 3 executed
It seems the sonar jar is not available, but i have added it in buildSrc build.gradle file as dependency, how can define this dependency to available for all sub gradle projects?Sudheer Konagalla
02/05/2025, 5:32 PMplugins {
id 'java'
id "maven-publish"
id "org.sonarqube" version "4.0.0.2929"
}
sonarqube {
properties {
property "sonar.projectKey", "${project.sonar_project_key}"
property "sonar.projectName", "${project.sonar_project_name}"
property "sonar.organization", "abc"
property "sonar.host.url", "<https://sonarcloud.io>"
}
}
I am getting "Invalid plugin request [id: 'org.sonarqube', version: '4.0.0.2929']. Plugin requests from precompiled scripts must not include a version number. Please remove the version from the offending request and make sure the module containing the requested plugin 'org.sonarqube' is an implementation dependency"Thomas Broyer
02/05/2025, 5:33 PMVampire
02/05/2025, 5:39 PMSudheer Konagalla
02/05/2025, 5:41 PMplugins {
id 'groovy-gradle-plugin'
}
repositories {
mavenCentral()
}
allprojects {
dependencies {
implementation 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929' // Add the SonarQube plugin dependency
}
}
Sudheer Konagalla
02/05/2025, 5:42 PMWelcome to Gradle 8.12!
Here are the highlights of this release:
- Enhanced error and warning reporting with the Problems API
- File-system watching support on Alpine Linux
- Build and test Swift 6 libraries and apps
For more details see <https://docs.gradle.org/8.12/release-notes.html>
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :buildSrc:extractPluginRequests
> Task :buildSrc:generatePluginAdapters
> Task :buildSrc:compileJava FAILED
3 actionable tasks: 3 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildSrc:compileJava'.
> Could not resolve all files for configuration ':buildSrc:compileClasspath'.
> Could not find org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929.
Searched in the following locations:
- <https://repo.maven.apache.org/maven2/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/4.0.0.2929/sonarqube-gradle-plugin-4.0.0.2929.pom>
Required by:
project :buildSrc
* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
Sudheer Konagalla
02/05/2025, 5:44 PMVampire
02/05/2025, 5:46 PMSudheer Konagalla
02/05/2025, 5:50 PMVampire
02/05/2025, 5:51 PMSudheer Konagalla
02/05/2025, 5:51 PMrepositories {
gradlePluginPortal()
mavenCentral()
Vampire
02/05/2025, 5:52 PMSudheer Konagalla
02/05/2025, 6:20 PM