iwarapter / gradle-sonar-packaging-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle Plugin for building SonarQube plugins.
License: Other
Gradle Plugin for building SonarQube plugins.
License: Other
There are some calls to internal API's this can cause issues between version of gradle. We should see if we can achieve the same functionality with public only API's.
pluginPackaging
fails
Stacktrace
* What went wrong:
Execution failed for task ':project:pluginPackaging'.
> Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':code-analysis:sonar-yreports:pluginPackaging'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:96)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:65)
at org.gradle.api.internal.tasks.execution.ActionEventFiringTaskExecuter.execute(ActionEventFiringTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.TimeoutTaskExecuter.execute(TimeoutTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.SnapshotAfterExecutionTaskExecuter.execute(SnapshotAfterExecutionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:49)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:61)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:49)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:44)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:337)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
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: groovy.lang.MissingPropertyException: Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)
at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:61)
at org.gradle.api.internal.tasks.DefaultSourceSetOutput_Decorated.getProperty(Unknown Source)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.checkPluginClass(PackagePluginTask.groovy:210)
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.StandardTaskAction.doExecute(StandardTaskAction.java:48)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:704)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:671)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:117)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:106)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:85)
... 35 more
* Get more help at https://help.gradle.org
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!
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?
Currently using a configuration and manually specifying the dependencies to package with the plugin.
The original maven plugin dynamically generates this, which would make our implementation ALOT nicer!
There is the following warning message on Gradle 2.14 during "pluginPackaging" task execution:
LoggingManager.setLevel(LogLevel) has been deprecated and is scheduled to be removed in Gradle 3.0. If you are using this method to expose Ant logging messages, please use AntBuilder.setLifecycleLogLevel() instead.
When executing gradle prints the following warning message:
Configuring child specs of a copy task at execution time of the task has been deprecated and is scheduled to be removed in Gradle 4.0. Consider configuring the spec during configuration time, or using a separate task to do the configuration.
Currently only added in support for the basic manifest attributes for a sonar plugin, will need to add the remaining.
I'm getting the following error when trying to use the plugin:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.iadams.sonar-packaging', version: '0.1.3']
By looking at --stacktrace, it seems to come from here:
at com.iadams.gradle.plugins.SonarPackagingPlugin.apply(SonarPackagingPlugin.groovy:56)
at com.iadams.gradle.plugins.SonarPackagingPlugin.apply(SonarPackagingPlugin.groovy)
I tried with Gradle version 7.4.2.
See here:
This means that in theory, we do not have to declare anymore a new provided
configuration and use that for the sonar-plugin-api jar.
If I try and use compileOnly
for the sonar-plugin-api jar, the plugin says that the jar cannot be found.
compile
is deprecated since Gradle 3.4, one should use implementation
instead
https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations
The plugin doesn't pick up any dependencies declared for the implementation
scope and consequently doesn't package them into the plugin jar.
The plugin fails due to change in the DefaultManifest constructor.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pluginPackaging'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.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:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoSuchMethodError: org.gradle.api.java.archives.internal.DefaultManifest.<init>(Lorg/gradle/api/internal/file/FileResolver;)V
at com.iadams.gradle.plugins.core.PluginManifest.<init>(PluginManifest.groovy:60)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:116)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 14 more
Getting the following error when building the jar:
org.codehaus.sonar:sonar-plugin-api or org.sonarsource.sonarqube:sonar-plugin-api should be declared in dependencies
My build.grade:
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.com.iadams.plugins:gradle-sonar-packaging-plugin:0.1.3'
}
}
apply plugin: 'groovy'
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.4'
compile 'org.sonarsource.sonarqube:sonar-plugin-api:5.2'
}
apply plugin: 'com.iadams.sonar-packaging'
sonarPackaging {
serverUrl = 'http://localhost:9000'
pluginDir = '/a/b/c/d/e/f/g'
pluginKey = 'abcdefg'
pluginClass = 'a.b.c.d.e.f.Something'
pluginName = 'An Example Plugin.'
pluginDescription = 'This plugin is an example.'
pluginParent = null
pluginLicense = 'MIT'
requirePlugins = null
pluginUrl = 'http://mypluginwebsite.com'
pluginIssueTrackerUrl = 'http://mypluginwebsite.com/issues'
pluginTermsConditionsUrl = 'http://mypluginwebsite.com/terms'
pluginSourceUrl = 'http://github.com'
pluginDevelopers = 'Bob Smith'
skipDependenciesPackaging = false
useChildFirstClassLoader = false
basePlugin = ''
organization{
name = 'company-corp'
url = 'http://company-corp.com'
}
}
I have Gradle compile dependency on 'com.thoughtworks.xstream:xstream:1.4.8', but it is not being added to the generated plugin jar.
The plugin writes The following dependencies should be defined with scope 'provided': [log4j]
in a loop for some time and then crashes.
After I added the following configuration execution continued to the pluginPackaging stage and failed with StackOverflowError
configurations {
compile.exclude group: 'log4j', module: 'log4j'
}
The stacktrace:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pluginPackaging'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(Exec
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActi
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(Post
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateT
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskE
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipE
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTask
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskE
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteA
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(Abstrac
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecut
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.j
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.jav
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationEx
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationEx
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.ja
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationEx
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationEx
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InPro
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRu
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExec
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExec
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionEx
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionEx
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnec
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecation
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestSt
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.ja
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.ja
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.j
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTrack
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuil
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.jav
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExec
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrR
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(Executo
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:
Caused by: java.lang.StackOverflowError
at org.gradle.internal.classloader.FilteringClassLoader.getResource(FilteringClassLoader.
at com.iadams.gradle.plugins.core.DependencyQuery.getPomPackagingType(DependencyQuery.gro
at com.iadams.gradle.plugins.core.DependencyQuery$getPomPackagingType$4.callCurrent(Unkno
at com.iadams.gradle.plugins.core.DependencyQuery.isSonarPlugin(DependencyQuery.groovy:18
at com.iadams.gradle.plugins.core.DependencyQuery$isSonarPlugin$3.callCurrent(Unknown Sou
at com.iadams.gradle.plugins.core.DependencyQuery.getNotProvidedDependencies(DependencyQu
at com.iadams.gradle.plugins.core.DependencyQuery$getNotProvidedDependencies$1.call(Unkno
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:159)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
at com.iadams.gradle.plugins.tasks.PackagePluginTask.copy(PackagePluginTask.groovy:186)
In order to use current 6.x
APIs but remain compatibility with 5.6 LTS, we would need to specify this in the sonar manifest. See for example https://github.com/SonarSource/sonar-php/blob/master/pom.xml#L266
Contents of the generated plugin by maven and gradle:
fge@alustriel:~/work/src/sonar-objectscript$ jar tf sonar-objectscript-plugin/target/sonar-objectscript-plugin-0.1.0-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
es/
es/litesolutions/
es/litesolutions/sonar/
es/litesolutions/sonar/objectscript/
es/litesolutions/sonar/objectscript/ObjectScriptProfile.class
es/litesolutions/sonar/objectscript/ObjectScriptRulesDefinition.class
es/litesolutions/sonar/objectscript/ObjectScriptPluginProperties.class
es/litesolutions/sonar/objectscript/ObjectScriptSquidSensor.class
es/litesolutions/sonar/objectscript/ObjectScriptLanguage.class
es/litesolutions/sonar/objectscript/ObjectScriptPlugin.class
es/litesolutions/sonar/SonarConstants.class
META-INF/lib/
META-INF/lib/grappa-2.0.0-beta.4.jar
META-INF/lib/asm-debug-all-5.0.3.jar
META-INF/lib/jitescript-0.4.0.jar
META-INF/lib/jaxen-1.1.4.jar
META-INF/lib/sonar-objectscript-checks-0.1.0-SNAPSHOT.jar
META-INF/lib/sslr-core-1.20.jar
META-INF/lib/sslr-squid-bridge-2.6.jar
META-INF/lib/sonar-objectscript-squid-0.1.0-SNAPSHOT.jar
META-INF/lib/sslr-xpath-1.20.jar
META-INF/maven/
META-INF/maven/es.litesolutions/
META-INF/maven/es.litesolutions/sonar-objectscript-plugin/
META-INF/maven/es.litesolutions/sonar-objectscript-plugin/pom.xml
META-INF/maven/es.litesolutions/sonar-objectscript-plugin/pom.properties
fge@alustriel:~/work/src/sonar-objectscript$ jar tf sonar-objectscript-plugin/build/libs/sonar-objectscript-plugin-0.1.0-SNAPSHOT.jar
META-INF/
META-INF/MANIFEST.MF
es/
es/litesolutions/
es/litesolutions/sonar/
es/litesolutions/sonar/SonarConstants.class
es/litesolutions/sonar/objectscript/
es/litesolutions/sonar/objectscript/ObjectScriptPluginProperties.class
es/litesolutions/sonar/objectscript/ObjectScriptLanguage.class
es/litesolutions/sonar/objectscript/ObjectScriptRulesDefinition.class
es/litesolutions/sonar/objectscript/ObjectScriptProfile.class
es/litesolutions/sonar/objectscript/ObjectScriptPlugin.class
es/litesolutions/sonar/objectscript/ObjectScriptSquidSensor.class
META-INF/lib/
META-INF/lib/sonar-objectscript-checks-0.1.0-SNAPSHOT.jar
META-INF/lib/sonar-objectscript-squid-0.1.0-SNAPSHOT.jar
META-INF/lib/grappa-2.0.0-beta.4-all.jar
META-INF/lib/asm-debug-all-5.0.3.jar
META-INF/lib/jitescript-0.4.0.jar
META-INF/lib/sslr-squid-bridge-2.6.jar
META-INF/lib/sslr-core-1.20.jar
META-INF/lib/sslr-xpath-1.20.jar
META-INF/lib/jaxen-1.1.4.jar
What Sonar tells me when I start it up (5.1) is:
java.lang.IllegalArgumentException: Dependency META-INF/lib/sonar-objectscript-checks:0.1.0-SNAPSHOT.jar can not be found in sonar-objectscript-plugin-0.1.0-SNAPSHOT.jar
at org.sonar.core.plugins.PluginJarInstaller.copyDependencies(PluginJarInstaller.java:53) ~[sonar-core-5.1.jar:na]
at org.sonar.core.plugins.PluginJarInstaller.install(PluginJarInstaller.java:40) ~[sonar-core-5.1.jar:na]
at org.sonar.server.plugins.ServerPluginJarInstaller.installToDir(ServerPluginJarInstaller.java:37) ~[sonar-server-5.1.jar:na]
at org.sonar.server.plugins.ServerPluginJarsInstaller.deploy(ServerPluginJarsInstaller.java:235) ~[sonar-server-5.1.jar:na]
at org.sonar.server.plugins.ServerPluginJarsInstaller.deployPlugins(ServerPluginJarsInstaller.java:217) ~[sonar-server-5.1.jar:na]
at org.sonar.server.plugins.ServerPluginJarsInstaller.install(ServerPluginJarsInstaller.java:73) ~[sonar-server-5.1.jar:na]
at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:49) ~[sonar-server-5.1.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_40]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_40]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_40]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) ~[picocontainer-2.14.3.jar:na]
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) ~[picocontainer-2.14.3.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) ~[picocontainer-2.14.3.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) ~[picocontainer-2.14.3.jar:na]
[etc etc]
All other components compile etc correctly.
The build.gradle in the packaging directory looks like this:
fge@alustriel:~/work/src/sonar-objectscript$ cat sonar-objectscript-plugin/build.gradle
buildscript {
repositories {
mavenCentral();
mavenLocal();
}
dependencies {
classpath(group: "com.iadams.plugins",
name: "gradle-sonar-packaging-plugin",
version: "0.1-SNAPSHOT");
}
};
apply(plugin: "com.iadams.sonar-packaging");
configurations {
provided;
compile.extendsFrom(provided);
}
dependencies {
compile project(":sonar-objectscript-checks");
provided(group: "org.codehaus.sonar", name: "sonar-plugin-api",
version: "5.0.1");
}
sonarPackaging {
pluginKey = "objectscript";
pluginClass = "es.litesolutions.sonar.objectscript.ObjectScriptPlugin";
pluginName = "ObjectScript";
pluginDescription = "Plugin for ObjectScript language";
}
Note that checks
defines the version
, which is defined in the main build.gradle
as being 0.1.0-SNAPSHOT (by the way, why do I have to redefine it in subprojects
?)
More details on demand.
I set-up a gradle multi project for sonar plugin, and every time i do ./gradlew clean build
, the build failed on pluginPackaging
task.
I need to have the sonar plugin as part of a gradle multiproject set up, and i have the following gradle.build
buildscript {
ext {
versions = [
gradleSonar : "0.1.4"
]
sonar_example_plugin = "0.0.1"
}
dependencies {
classpath "gradle.plugin.com.iadams.plugins:gradle-sonar-packaging-plugin:${versions.gradleSonar}"
}
repositories {
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
jcenter()
}
}
allprojects {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
jcenter()
}
}
subprojects {
apply plugin: 'java'
}
project (":sonar-example-plugin"){
apply plugin: 'com.iadams.sonar-packaging'
dependencies {
provided 'org.sonarsource.sonarqube:sonar-plugin-api:5.6'
}
pluginPackaging.dependsOn "compileJava"
sonarPackaging {
serverUrl = 'http://localhost:9000'
pluginDir = '/tmp/sonarqube-5.1/extensions/plugins'
pluginKey = 'example'
pluginClass = 'org.sonarsource.plugins.example.ExamplePlugin'
pluginName = 'Example'
pluginDescription = 'Exmaple'
pluginParent = null
pluginLicense = 'MIT'
requirePlugins = null
pluginDevelopers = 'Gama Ogi Prayogo'
skipDependenciesPackaging = false
useChildFirstClassLoader = false
}
}
The error that I've got when executing build
* What went wrong:
Execution failed for task ':sonar-example-plugin:pluginPackaging'.
> Plugin class not found: org.sonarsource.plugins.example.ExamplePlugin
If I execute gradle build
in the child directory with the build.gradle
as suggested in README.md, all is good.
I faced a similar issue like #8
If I am using the sonar-plugin-api
lower than version 5.5, I faced no issue.
However, when I use plugin version 5.5 and above, i encountered the problem as described in #8.
FAILURE: Build failed with an exception.
16:23:42.580 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
16:23:42.580 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
16:23:42.580 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':analyzer:pluginPackaging'.
16:23:42.580 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > org.codehaus.sonar:sonar-plugin-api or org.sonarsource.sonarqube:sonar-plugin-api should be declared in dependencies
Stacktrace
Caused by: org.gradle.api.GradleException: org.codehaus.sonar:sonar-plugin-api or org.sonarsource.sonarqube:sonar-plugin-api should be declared in dependencies
at com.iadams.gradle.plugins.core.DependencyQuery.checkApiDependency(DependencyQuery.groovy:89)
at com.iadams.gradle.plugins.core.DependencyQuery$checkApiDependency.call(Unknown Source)
Currently plugin sets the packaging task to have a dependency on the 'build' task, this should instead be on the 'jar' task, as certain publishing tasks will call assemble/jar instead of build.
The plugin is not copied to the configured location.
13:56:03.073 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':localDeploy'.
13:56:03.074 [INFO] [org.gradle.api.Task] Deploying null to null
13:56:03.122 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':localDeploy'
Edit: I was sure that '/' points to disk root, but it was Gradle project root.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.