Raphael
09/19/2023, 6:45 AMimport org.sonarqube.gradle.SonarExtension
gradle is not able to resolve the class. (Unresolved reference: sonarqube
) It clearly is there as the package org.sonarqube.gradle
can be inspected and contains the File SonarExtension
. Adding the sonarqube plugin in the build.gradle.kts of the plugin project changes nothing.
Does anyone have any experience/hints regarding that matter? Thanks in advance.Vampire
09/19/2023, 6:53 AMRaphael
09/19/2023, 7:00 AMRaphael
09/19/2023, 7:19 AM/gradlePlugins
and the class trying to importing the SonarExtension
is SonarForAndroidPlugin
. In this project also the plugin sources are not listed anymore.
I feel like I am missing a dependency declaration, so that the sources are getting added to the classpath. But I have no idea what. A plugin cannot be added as implementation, hope you have some ideas.Chrimaeon
09/19/2023, 7:29 AMRaphael
09/19/2023, 7:32 AMapply false
doesn't change anything.
is there something I miss?Chrimaeon
09/19/2023, 7:35 AMdependencies
in the implementation
configurationChrimaeon
09/19/2023, 7:38 AMRaphael
09/19/2023, 7:42 AMRaphael
09/19/2023, 7:44 AMgradlePluginPortal()
as repository together with the link seems to work.Vampire
09/19/2023, 8:10 AMNo before it was a Groovy .gradle file. And as our team is used to write code in kotlin and using kotlin classes etc.
Yeah, that's clear. What I wanted to say is, if all you want is type safety, you can just use Kotlin DSL instead. If there are other reasons like cleaner build script, reusing the logic in multiple projects and so on, that's a different story then of course. :-) Regarding the problem it seems you found out already. The artifact you found there is the "plugin marker artifact". It is always
<plugin id>:<plugin id>.gradle.plugin:<plugin version>
and is the way how the id in the plugins
block is translated to a dependency. Some plugins also publish them to other places like Maven Central, but for just you need the plugin portal repo, yes. Alternatively, for example if you don't like to use transitive dependencies, you can also depend on the actual code artifact directly. For that either open the plugin portal page of the plugin and find the coordinates in the legacy application section, or just have a look on what the marker artifact depends.Raphael
09/19/2023, 8:17 AMVampire
09/19/2023, 8:21 AMVampire
09/19/2023, 8:22 AMRaphael
09/19/2023, 8:22 AMVampire
09/19/2023, 8:23 AMincludeBuild
within pluginManagement { ... }
, not top-level. :-)Raphael
09/19/2023, 8:25 AMsettings.gradle
, right?
What does that change?
(Sorry for all the questions, we just started to migrate to the new dsl)Vampire
09/19/2023, 8:26 AMRaphael
09/19/2023, 8:28 AM