{"record":{"id":"3cf95f7417e08c23","repo":"SonarSource/sonarqube","slug":"propname-is-enabled-but-the-sonarqube-unificati","errorCode":null,"errorMessage":"${propName} is enabled but the sonarqube-unification path is not configured.\nSet sonarqubeUnificationPath in ~/.gradle/gradle.properties or export SONARQUBE_UNIFICATION_PATH.","messagePattern":"(.+?) is enabled but the sonarqube-unification path is not configured\\.\nSet sonarqubeUnificationPath in ~/\\.gradle/gradle\\.properties or export SONARQUBE_UNIFICATION_PATH\\.","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"settings.gradle","lineNumber":86,"sourceCode":"include 'sonar-markdown'\ninclude 'sonar-plugin-api-impl'\ninclude 'sonar-shutdowner'\ninclude 'sonar-testing-harness'\ninclude 'sonar-testing-ldap'\ninclude 'sonar-ws'\ninclude 'sonar-ws-generator'\n\n// Registers a local composite build from the sonarqube-unification repo as a substitute for published artifacts.\n// Set the property to true and optionally sonarqubeUnificationPath in ~/.gradle/gradle.properties.\n// Falls back to the SONARQUBE_UNIFICATION_PATH environment variable if the Gradle property is not set.\n// opts: group (default 'org.sonarsource.sonarqube'), projectPaths (map of name -> project path, default ':name')\ndef useLocalUnificationModule = { String propName, String subPath, List<String> modules, Map opts = [:] ->\n  if (settings.hasProperty(propName) && settings[propName].toBoolean()) {\n    def basePath = settings.hasProperty('sonarqubeUnificationPath')\n      ? settings['sonarqubeUnificationPath']\n      : System.getenv('SONARQUBE_UNIFICATION_PATH')\n    if (!basePath) {\n      throw new GradleException(\n        \"${propName} is enabled but the sonarqube-unification path is not configured.\\n\" +\n        \"Set sonarqubeUnificationPath in ~/.gradle/gradle.properties or export SONARQUBE_UNIFICATION_PATH.\"\n      )\n    }\n    def group = opts.group ?: 'org.sonarsource.sonarqube'\n    def groups = opts.groups ?: [:]\n    def projectPaths = opts.projectPaths ?: [:]\n    def dir = new File(basePath, subPath)\n    println \"Using local build [${propName}] from: ${dir.absolutePath}\"\n    if (opts.autoSubstitution) {\n      // Preserve project-to-project variants for composites with mixed public and private modules.\n      includeBuild(dir.absolutePath)\n    } else {\n      includeBuild(dir.absolutePath) {\n        dependencySubstitution {\n          modules.each { name ->\n            def moduleGroup = groups[name] ?: group\n            def projectPath = projectPaths[name] ?: \":${name}\"","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/settings.gradle#L68-L104","documentation":"The useLocalUnificationModule helper in settings.gradle lets developers substitute the remote sonarqube-unification dependency with a local checkout by setting a per-module property (e.g. useLocalUnification=true). If that flag is enabled but neither the sonarqubeUnificationPath gradle property nor the SONARQUBE_UNIFICATION_PATH env var provides the local checkout location, the settings evaluation fails with this GradleException.","triggerScenarios":"Adding e.g. useLocalUnification=true to ~/.gradle/gradle.properties (or a matching per-module flag) while SONARQUBE_UNIFICATION_PATH is not exported and sonarqubeUnificationPath is absent from gradle.properties.","commonSituations":"Switching machines and forgetting to re-export SONARQUBE_UNIFICATION_PATH; copying a colleague's gradle.properties with the flag but no path; running a build in a fresh CI container where only the flag was set.","solutions":["Set sonarqubeUnificationPath=/absolute/path/to/sonarqube-unification in ~/.gradle/gradle.properties","Or export SONARQUBE_UNIFICATION_PATH=/absolute/path/to/sonarqube-unification in your shell/CI","Or disable the local module by removing/setting the property (e.g. useLocalUnification=false) to fall back to the published artifact"],"exampleFix":"// before (gradle.properties)\nuseLocalUnification=true\n// after (gradle.properties)\nuseLocalUnification=true\nsonarqubeUnificationPath=/home/dev/src/sonarqube-unification","handlingStrategy":"validation","validationCode":"// shell: fail fast if local unification flag set without path\nif grep -q '^useLocalUnification=true' ~/.gradle/gradle.properties 2>/dev/null; then\n  if [ -z \"$SONARQUBE_UNIFICATION_PATH\" ] && ! grep -q '^sonarqubeUnificationPath=' ~/.gradle/gradle.properties; then\n    echo \"Set sonarqubeUnificationPath or SONARQUBE_UNIFICATION_PATH\" >&2\n    exit 1\n  fi\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set sonarqubeUnificationPath in gradle.properties when using local unification flags","Export SONARQUBE_UNIFICATION_PATH in your shell profile and CI environment","Disable local-module flags when building on a new machine without the checkout"],"tags":["gradle","local-development","configuration","environment"],"backgroundTag":"missing-required-config-field","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}