Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1813

Sonar fails on nested multiproject builds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Not A Bug
    • Affects Version/s: 1.0-milestone-5
    • Fix Version/s: 1.0-milestone-8

      Description

      When applying the sonar plugin to the gradle sample project (subprojects/docs/samples/java/multiproject) the build fails with the message:
      There's an extension registered with name 'sonar'. You should not reassign it via a property setter.

      It seems that applying the Plugin to (:services:shared) fails because the plugin was already applied to (:shared). INMHO, the full qualified project name is not considered. Find the full stack trace below:

      org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'multiproject'.
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
      at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
      at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
      at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
      at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:474)
      at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:73)
      at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
      at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
      at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
      at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
      at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:450)
      at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:445)
      at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:138)
      at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:109)
      at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:77)
      at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
      at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
      at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
      at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:231)
      at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:215)
      at org.gradle.launcher.Main.execute(Main.java:57)
      at org.gradle.launcher.Main.main(Main.java:42)
      Caused by: java.lang.IllegalArgumentException: There's an extension registered with name 'sonar'. You should not reassign it via a property setter.
      at org.gradle.api.internal.plugins.ExtensionsStorage.checkExtensionIsNotReassigned(ExtensionsStorage.java:49)
      at org.gradle.api.internal.plugins.DefaultConvention.propertyMissing(DefaultConvention.java:95)
      at org.gradle.api.plugins.sonar.SonarPlugin.configureSonarRootModel(SonarPlugin.groovy:54)
      at org.gradle.api.plugins.sonar.SonarPlugin.this$2$configureSonarRootModel(SonarPlugin.groovy)
      at org.gradle.api.plugins.sonar.SonarPlugin$this$2$configureSonarRootModel.callCurrent(Unknown Source)
      at org.gradle.api.plugins.sonar.SonarPlugin.apply(SonarPlugin.groovy:42)
      at org.gradle.api.plugins.sonar.SonarPlugin.apply(SonarPlugin.groovy)
      at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
      at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
      at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
      at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
      at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:841)
      at build_5cq9j6nrhfkicsrn91fucm243h$_run_closure1.doCall(/Users/Rene/temp/multiproject/build.gradle:4)
      at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:112)
      at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:61)
      at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:861)
      at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:866)
      at org.gradle.api.internal.project.AbstractProject.subprojects(AbstractProject.java:849)
      at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
      at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
      at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
      at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.groovy:72)
      at build_5cq9j6nrhfkicsrn91fucm243h.run(/Users/Rene/temp/multiproject/build.gradle:2)
      at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
      ... 23 more

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              breskeby René Gröschke
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: