Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin class not found after just updating kotlin dependencies #20

Open
arturbosch opened this issue Nov 20, 2017 · 4 comments
Open

Plugin class not found after just updating kotlin dependencies #20

arturbosch opened this issue Nov 20, 2017 · 4 comments

Comments

@arturbosch
Copy link

I do not why but after updating just the kotlin dependencies in my project, the plugin class can not be found anymore. Nothing besides the dependencies changed:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pluginPackaging'.
> Plugin class not found: io.gitlab.arturbosch.detekt.sonar.DetektPlugin

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pluginPackaging'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.GradleException: Plugin class not found: io.gitlab.arturbosch.detekt.sonar.DetektPlugin
	at com.iadams.gradle.plugins.tasks.PackagePluginTask.checkPluginClass(PackagePluginTask.groovy:211)
	at com.iadams.gradle.plugins.tasks.PackagePluginTask.checkMandatoryAttributes(PackagePluginTask.groovy:200)
	at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:115)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:731)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:705)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
	... 27 more

Thanks you for the time and help!

@iwarapter
Copy link
Owner

Can you share your build script?

@arturbosch
Copy link
Author

arturbosch commented Nov 21, 2017

The build file. i also liked the project above.

buildscript {

	repositories {
		mavenCentral()
		mavenLocal()
		jcenter()
		maven { url "http://dl.bintray.com/jetbrains/spek" }
		maven { url "https://plugins.gradle.org/m2" }
	}

	dependencies {
		classpath "org.junit.platform:junit-platform-gradle-plugin:$junitPlatformVersion"
		classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
	}
}

plugins {
	id "com.iadams.sonar-packaging" version "1.0-RC1"
	id "org.sonarqube" version "2.5"
	id "io.gitlab.arturbosch.detekt" version "1.0.0.RC4-3"
}

apply plugin: 'kotlin'
apply plugin: 'jacoco'

group 'io.gitlab.arturbosch.detekt'
version = "$detektSonarVersion"

repositories {
	jcenter()
	mavenLocal()
	mavenCentral()
}

dependencies {
	compile "io.gitlab.arturbosch.detekt:detekt-core:$detektVersion"
	compile "io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
	compile "io.gitlab.arturbosch.detekt:detekt-rules:$detektVersion"
	compileOnly "org.sonarsource.sonarqube:sonar-plugin-api:$sonarVersion"
	compile "org.sonarsource.java:java-jacoco:4.11.0.10660"

	testCompile "junit:junit:4.12"
	testCompile "com.nhaarman:mockito-kotlin-kt1.1:$mockitoKotlinVersion"
	testCompile "org.junit.jupiter:junit-jupiter-api:$junitEngineVersion"
	testCompile "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
	testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
	testCompile "org.assertj:assertj-core:$assertjVersion"
	testCompile "org.jetbrains.spek:spek-api:$spekVersion"
	testCompile "org.jetbrains.spek:spek-subject-extension:$spekVersion"
	testCompile "org.junit.jupiter:junit-jupiter-engine:$junitEngineVersion"
	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"
}

sourceSets {
	main.java.srcDirs += 'src/main/kotlin'
}


jacocoTestReport {
	dependsOn test
	reports {
		xml.enabled = true
		html.enabled = true
	}
}

check.dependsOn jacocoTestReport

def USER_HOME = System.getProperty("user.home")

sonarPackaging {
	serverUrl = 'http://localhost:9000'
	pluginDir = "$USER_HOME/Downloads/sonarqube-6.4/extensions/plugins"
	pluginKey = 'kotlin'
	pluginClass = 'io.gitlab.arturbosch.detekt.sonar.DetektPlugin'
	pluginName = 'Kotlin'
	pluginDescription = 'Work in progress kotlin sonar plugin.'
	pluginParent = null
	pluginLicense = 'APACHE 2.0'
	requirePlugins = null
	pluginUrl = 'http://github.com/arturbosch/sonar-kotlin'
	pluginIssueTrackerUrl = 'http://github.com/arturbosch/sonar-kotlin/issues'
	pluginTermsConditionsUrl = 'http://github.com/arturbosch/sonar-kotlin'
	pluginSourceUrl = 'http://github.com/arturbosch/sonar-kotlin'
	pluginDevelopers = 'Artur Bosch'
	skipDependenciesPackaging = false
	useChildFirstClassLoader = false
	basePlugin = ''
	sonarQubeMinVersion = '5.6'
}

detekt {
	version = usedDetektGradlePlugin
	profile("main") {
		input = "$project.projectDir"
		filters = '.*/test/.*, .*/resources/.*, .*/build/.*'
		baseline = "$project.projectDir/reports/baseline.xml"
	}
	idea {
		path = "$USER_HOME/.idea"
		codeStyleScheme = "$USER_HOME/.idea/idea-code-style.xml"
		inspectionsProfile = "$USER_HOME/.idea/inspect.xml"
		report = "$project.projectDir/reports"
		mask = "*.kt,"
	}
}
compileKotlin {
	kotlinOptions {
		jvmTarget = "1.8"
	}
}
compileTestKotlin {
	kotlinOptions {
		jvmTarget = "1.8"
	}
}

@iwarapter
Copy link
Owner

Which dependency versions did you update? just tried this on current master branch and its built successfully.

@arturbosch
Copy link
Author

arturbosch commented Nov 27, 2017

As mentioned in the title, if I update the kotlin dependency (try 1.1.60), I get the error.
No on master I did not increment the version. Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants