iwarapter / gradle-sonar-packaging-plugin

Gradle Plugin for building SonarQube plugins.
Other
19 stars 11 forks source link

org.sonarsource.sonarqube:sonar-plugin-api should be declared in dependencies problem #19

Closed arturbosch closed 7 years ago

arturbosch commented 7 years ago

Heyho,

when trying to apply this plugin in my multiproject I get following:

* What went wrong:
Execution failed for task ':detekt-sonar-kotlin:pluginPackaging'.
> org.codehaus.sonar:sonar-plugin-api or org.sonarsource.sonarqube:sonar-plugin-api should be declared in dependencies

Versions: sonar: 5.6 or 6.4 gradle: 4.0-rc-1

My build.gradle looks like this:

plugins {
    id "com.iadams.sonar-packaging" version "0.1.3"
}

configurations {
    compile.extendsFrom kotlinCompile
    testCompile.extendsFrom kotlinTest
//  testRuntime.extendsFrom junitPlatform
}

dependencies {
    compile project(':detekt-core')
    compile "org.sonarsource.sonarqube:sonar-plugin-api:$sonarVersion"
    testCompile "org.sonarsource.sonarqube:sonar-testing-harness:$sonarVersion"
    testRuntime "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
    testRuntime "org.junit.platform:junit-platform-console:$junitPlatformVersion"
    testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$spekVersion"
}

sonarPackaging {
    serverUrl = 'http://localhost:9000'
    pluginDir = '/tmp/sonarqube/extensions/plugins'
    pluginKey = 'example'
    pluginClass = 'io.gitlab.arturbosch.detekt.sonar.DetektPlugin'
    pluginName = 'Sonar kotlin plugin using detekt.'
    pluginDescription = 'Work in progress kotlin sonar plugin.'
    pluginParent = null
    pluginLicense = 'APACHE 2.0'
    requirePlugins = null
    pluginUrl = 'http://github.com/arturbosch/detekt'
    pluginIssueTrackerUrl = 'http://github.com/arturbosch/detekt/issues'
    pluginTermsConditionsUrl = 'http://github.com/arturbosch/detekt'
    pluginSourceUrl = 'http://github.com/arturbosch/detekt'
    pluginDevelopers = 'Artur Bosch'
    skipDependenciesPackaging = false
    useChildFirstClassLoader = false
    basePlugin = ''
}

any ideas?

iwarapter commented 7 years ago
compile "org.sonarsource.sonarqube:sonar-plugin-api:$sonarVersion"

Needs to be

provided "org.sonarsource.sonarqube:sonar-plugin-api:$sonarVersion"

You should also use version 0.1.4 of the plugin!

arturbosch commented 7 years ago

Now I get this error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt-sonar-kotlin:pluginPackaging'.
> You cannot add child specs at execution time. Consider configuring this task during configuration time or using a separate task to do the configuration.

Seems to be connected to #18

iwarapter commented 7 years ago

This is due to the plugin only working with gradle up to 3.2 (i believe) i'm refactoring it currently to support 3.x/4.x

DhavalDalal commented 7 years ago

I get the same error, do you know by when you plan to release the refactored version?

iwarapter commented 7 years ago

I pushed the code for this last night, just need to sort some issues with travis out then i'll be making a release.

iwarapter commented 7 years ago

I have released 1.0-RC1 this support gradle 4.x, can you give it a go please :)

arturbosch commented 7 years ago

Jap, the new version works perfectly, thx you ! :) (with sonar-api as provided, compileOnly throws another exception)

iwarapter commented 7 years ago

@arturbosch i'll see whats wrong with using compileOnly, what was the error you got?