Sonarqube failing with "ECJ Unable to resolve type junit.framework.TestCase" error running on sonarcloud

Running on Github using Github Actions on Sonarcloud,
Project is multi-module Gradle build with a codebase which is evenly split between Java andKotlin running on a Java 11 platform.
command ran ./gradlew assemble sonarqube --info

Similar problem identified here: Java analyzer compile error after upgrading to OpenJDK11

Looking for practical solution to the below error:

Stacktrace:-

2021-11-26T17:19:32.2583570Z > Task :sonarqube
2021-11-26T17:19:32.2584952Z 0 files ignored because of inclusion/exclusion patterns
2021-11-26T17:19:32.2585997Z 316 files ignored because of scm ignore settings
2021-11-26T17:19:32.2589615Z Quality profile for java: Sonar way
2021-11-26T17:19:32.2590310Z Quality profile for kotlin: Sonar way
2021-11-26T17:19:32.2590908Z Quality profile for xml: Sonar way
2021-11-26T17:19:32.2592170Z ------------- Run sensors on module auth-perms
2021-11-26T17:19:32.2592789Z Load metrics repository
2021-11-26T17:19:32.2593377Z Load metrics repository (done) | time=173ms
2021-11-26T17:19:34.8575348Z Sensor JavaSensor [java]
2021-11-26T17:19:35.4575608Z Configured Java source version (sonar.java.source): 11
2021-11-26T17:19:35.4577438Z JavaClasspath initialization
2021-11-26T17:19:35.4578672Z JavaClasspath initialization (done) | time=11ms
2021-11-26T17:19:35.4579777Z JavaTestClasspath initialization
2021-11-26T17:19:35.4581195Z JavaTestClasspath initialization (done) | time=4ms
2021-11-26T17:19:35.4581890Z No "Main" source files to scan.
2021-11-26T17:19:35.4582489Z Java "Test" source files AST scan
2021-11-26T17:19:35.5577561Z 
2021-11-26T17:19:35.5578676Z 5 source files to be analyzed
2021-11-26T17:19:37.4602821Z ECJ Unable to resolve type junit.framework.TestCase
2021-11-26T17:19:37.4603556Z 
2021-11-26T17:19:37.4606259Z org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(1462) Type java.lang.Exception is indirectly referenced from required .class files but cannot be resolved since the declaring package java.lang exported from module java.base conflicts with a package accessible from module <unnamed>
2021-11-26T17:19:37.4608520Z > Task :sonarqube
2021-11-26T17:19:37.4610392Z               at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:162)
2021-11-26T17:19:37.4613048Z               at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:229)
2021-11-26T17:19:37.4616072Z               at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:2646)
2021-11-26T17:19:37.4619832Z               at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.conflictingPackageInModules(ProblemReporter.java:11483)
2021-11-26T17:19:37.4624831Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.flaggedJavaBaseTypeErrors(LookupEnvironment.java:1499)
2021-11-26T17:19:37.4629364Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromCompoundName(LookupEnvironment.java:1786)
2021-11-26T17:19:37.4633703Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromConstantPoolName(LookupEnvironment.java:1821)
2021-11-26T17:19:37.4637565Z               at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:947)
2021-11-26T17:19:37.4640939Z               at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:1125)
2021-11-26T17:19:37.4644496Z               at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:613)
2021-11-26T17:19:37.4648218Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1055)
2021-11-26T17:19:37.4659691Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1036)
2021-11-26T17:19:37.4662470Z               at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:308)
2021-11-26T17:19:37.4664715Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:257)
2021-11-26T17:19:37.4667598Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1732)
2021-11-26T17:19:37.4670294Z               at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1701)
2021-11-26T17:19:37.4672530Z               at org.eclipse.jdt.core.dom.ASTUtils.resolveType(ASTUtils.java:58)
2021-11-26T17:19:37.4673901Z               at org.sonar.java.model.JSema.resolveType(JSema.java:137)
2021-11-26T17:19:37.4675342Z               at org.sonar.java.model.JSema.lambda$getClassType$8(JSema.java:120)
2021-11-26T17:19:37.4676952Z               at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
2021-11-26T17:19:37.4678300Z               at org.sonar.java.model.JSema.getClassType(JSema.java:119)
2021-11-26T17:19:37.4679494Z               at org.sonar.java.model.JType.isSubtypeOf(JType.java:56)
2021-11-26T17:19:37.4681493Z               at org.sonar.java.checks.tests.NoTestInTestClassCheck.checkClass(NoTestInTestClassCheck.java:93)
2021-11-26T17:19:37.4684064Z               at org.sonar.java.checks.tests.NoTestInTestClassCheck.lambda$visitNode$1(NoTestInTestClassCheck.java:77)
2021-11-26T17:19:37.4686089Z               at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
2021-11-26T17:19:37.4687601Z               at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
2021-11-26T17:19:37.4689284Z               at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
2021-11-26T17:19:37.4690960Z               at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2021-11-26T17:19:37.4692804Z               at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2021-11-26T17:19:37.4694661Z               at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2021-11-26T17:19:37.4696319Z               at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2021-11-26T17:19:37.4697925Z               at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2021-11-26T17:19:37.4699636Z               at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
2021-11-26T17:19:37.4701847Z               at org.sonar.java.checks.tests.NoTestInTestClassCheck.visitNode(NoTestInTestClassCheck.java:77)
2021-11-26T17:19:37.4704194Z               at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$visit$5(VisitorsBridge.java:294)
2021-11-26T17:19:37.4706577Z               at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$forEach$8(VisitorsBridge.java:310)
2021-11-26T17:19:37.4762957Z               at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:161)
2021-11-26T17:19:37.4765115Z               at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.forEach(VisitorsBridge.java:310)
2021-11-26T17:19:37.4767275Z               at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.visit(VisitorsBridge.java:296)
2021-11-26T17:19:37.4769499Z               at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.scanFile(VisitorsBridge.java:258)
2021-11-26T17:19:37.4771589Z               at org.sonar.java.model.VisitorsBridge.lambda$runScanner$0(VisitorsBridge.java:156)
2021-11-26T17:19:37.4773242Z               at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:161)
2021-11-26T17:19:37.4775204Z               at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:156)
2021-11-26T17:19:37.4776999Z               at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:139)
2021-11-26T17:19:37.4778800Z               at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:104)
2021-11-26T17:19:37.4780347Z               at org.sonar.java.ast.JavaAstScanner.lambda$scan$1(JavaAstScanner.java:79)
2021-11-26T17:19:37.4781934Z               at org.sonar.java.model.JParserConfig$FileByFile.parse(JParserConfig.java:225)
2021-11-26T17:19:37.4783308Z               at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:77)
2021-11-26T17:19:37.4784774Z               at org.sonar.java.JavaFrontend.scanAndMeasureTask(JavaFrontend.java:178)
2021-11-26T17:19:37.4802911Z               at org.sonar.java.JavaFrontend.scan(JavaFrontend.java:131)
2021-11-26T17:19:37.4804317Z               at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:109)
2021-11-26T17:19:37.4806274Z               at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
2021-11-26T17:19:37.4808676Z               at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
2021-11-26T17:19:37.4810869Z               at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
2021-11-26T17:19:37.4813347Z               at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
2021-11-26T17:19:37.4816268Z               at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
2021-11-26T17:19:37.4868861Z               at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
2021-11-26T17:19:37.4871378Z               at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T17:19:37.4873565Z               at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T17:19:37.4875836Z               at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:440)
2021-11-26T17:19:37.4878162Z               at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:436)
2021-11-26T17:19:37.4880838Z               at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:433)
2021-11-26T17:19:37.4883165Z               at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:394)
2021-11-26T17:19:37.4885581Z               at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T17:19:37.4887753Z               at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T17:19:37.4889821Z               at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
2021-11-26T17:19:37.4892320Z               at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T17:19:37.4894485Z               at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T17:19:37.4896189Z               at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
2021-11-26T17:19:37.4897599Z               at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
2021-11-26T17:19:37.4899979Z               at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-11-26T17:19:37.4902516Z               at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-11-26T17:19:37.4904628Z               at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-11-26T17:19:37.4907331Z               at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-11-26T17:19:37.4909186Z               at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-11-26T17:19:37.4911095Z               at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-11-26T17:19:37.4913025Z               at com.sun.proxy.$Proxy359.execute(Unknown Source)
2021-11-26T17:19:37.4914474Z               at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-11-26T17:19:37.4916636Z               at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-11-26T17:19:37.4918267Z               at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:102)
2021-11-26T17:19:37.4919898Z               at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-11-26T17:19:37.4922005Z               at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-11-26T17:19:37.4924812Z               at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-11-26T17:19:37.4926779Z               at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-11-26T17:19:37.4930362Z               at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
2021-11-26T17:19:37.4932926Z               at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
2021-11-26T17:19:37.4936270Z               at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
2021-11-26T17:19:37.4939291Z               at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
2021-11-26T17:19:37.4942368Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:502)
2021-11-26T17:19:37.4945166Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
2021-11-26T17:19:37.5009137Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
2021-11-26T17:19:37.5012032Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
2021-11-26T17:19:37.5014894Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T17:19:37.5018081Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
2021-11-26T17:19:37.5021328Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T17:19:37.5024853Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
2021-11-26T17:19:37.5028856Z               at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
2021-11-26T17:19:37.5033008Z               at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
2021-11-26T17:19:37.5036937Z               at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74)
2021-11-26T17:19:37.5040644Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:487)
2021-11-26T17:19:37.5072210Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:470)
2021-11-26T17:19:37.5075995Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:106)
2021-11-26T17:19:37.5080010Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
2021-11-26T17:19:37.5083737Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:249)
2021-11-26T17:19:37.5087115Z               at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
2021-11-26T17:19:37.5089612Z               at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
2021-11-26T17:19:37.5091500Z               at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
2021-11-26T17:19:37.5093235Z               at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
2021-11-26T17:19:37.5096050Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
2021-11-26T17:19:37.5099724Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
2021-11-26T17:19:37.5102903Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
2021-11-26T17:19:37.5105698Z               at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T17:19:37.5269424Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
2021-11-26T17:19:37.5272558Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T17:19:37.5275643Z               at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
2021-11-26T17:19:37.5278755Z               at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
2021-11-26T17:19:37.5282979Z               at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
2021-11-26T17:19:37.5287224Z               at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
2021-11-26T17:19:37.5289924Z               at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
2021-11-26T17:19:37.5292635Z               at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
2021-11-26T17:19:37.5295293Z               at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
2021-11-26T17:19:37.5298523Z               at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
2021-11-26T17:19:37.5301702Z               at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50)
2021-11-26T17:19:37.5304856Z               at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
2021-11-26T17:19:37.5308112Z               at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
2021-11-26T17:19:37.5310795Z               at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
2021-11-26T17:19:37.5313158Z               at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
2021-11-26T17:19:37.5315386Z               at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
2021-11-26T17:19:37.5317824Z               at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
2021-11-26T17:19:37.5320840Z               at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:58)
2021-11-26T17:19:37.5324439Z               at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:39)
2021-11-26T17:19:37.5327928Z               at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
2021-11-26T17:19:37.5332847Z               at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
2021-11-26T17:19:37.5336283Z               at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:180)
2021-11-26T17:19:37.5339094Z               at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:75)
2021-11-26T17:19:37.5341899Z               at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
2021-11-26T17:19:37.5344700Z               at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40)
2021-11-26T17:19:37.5428278Z               at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29)
2021-11-26T17:19:37.5431225Z               at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
2021-11-26T17:19:37.5434437Z               at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
2021-11-26T17:19:37.5437288Z               at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:105)
2021-11-26T17:19:37.5440199Z               at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:98)
2021-11-26T17:19:37.5441819Z               at java.base/java.util.Optional.map(Optional.java:265)
2021-11-26T17:19:37.5443622Z               at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:53)
2021-11-26T17:19:37.5446067Z               at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
2021-11-26T17:19:37.5448833Z               at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:85)
2021-11-26T17:19:37.5451455Z               at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:42)
2021-11-26T17:19:37.5455451Z               at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
2021-11-26T17:19:37.5460250Z               at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
2021-11-26T17:19:37.5464300Z               at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:92)
2021-11-26T17:19:37.5467698Z               at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
2021-11-26T17:19:37.5470899Z               at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
2021-11-26T17:19:37.5473232Z               at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
2021-11-26T17:19:37.5476616Z               at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:73)
2021-11-26T17:19:37.5480671Z               at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
2021-11-26T17:19:37.5484411Z               at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
2021-11-26T17:19:37.5486547Z               at java.base/java.util.Optional.orElseGet(Optional.java:369)
2021-11-26T17:19:37.5488560Z               at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
2021-11-26T17:19:37.5491268Z               at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
2021-11-26T17:19:37.5494918Z               at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
2021-11-26T17:19:37.5498782Z               at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
2021-11-26T17:19:37.5502153Z               at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
2021-11-26T17:19:37.5505205Z               at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
2021-11-26T17:19:37.5589046Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
2021-11-26T17:19:37.5592257Z               at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
2021-11-26T17:19:37.5595047Z               at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
2021-11-26T17:19:37.5597768Z               at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
2021-11-26T17:19:37.5600511Z               at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
2021-11-26T17:19:37.5602772Z               at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
2021-11-26T17:19:37.5604852Z               at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
2021-11-26T17:19:37.5607109Z               at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
2021-11-26T17:19:37.5610278Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
2021-11-26T17:19:37.5614066Z               at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
2021-11-26T17:19:37.5617839Z               at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
2021-11-26T17:19:37.5621967Z               at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
2021-11-26T17:19:37.5626315Z               at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
2021-11-26T17:19:37.5630602Z               at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
2021-11-26T17:19:37.5634940Z               at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
2021-11-26T17:19:37.5638556Z               at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
2021-11-26T17:19:37.5641903Z               at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
2021-11-26T17:19:37.5644931Z               at 
<----  section removed for brevity    --->

Hey there.

I’m not too familiar with the gradle task assemble, but some internet sleuthing tells me it’s not quite the same as gradle build.

  • Does gradle test run as a part of this build, and your tests are actually compiled/ran?
  • Does the behavior change if you alter your command to ./gradlew build sonarqube --info

gradle “assemble” is similar to gradle “build” but without the tests. ie assemble runs faster.

it makes no difference if I run with assemble or build. Im only running assemble so I can test changes quicker wrt to sonarqube.

how should i change this command?

./gradlew build sonarqube --info

The reason I’m focusing on whether or not tests are run is that the error appears on a moddule that appears to have no product code, only test code;

2021-11-26T17:19:35.4581890Z No "Main" source files to scan.
2021-11-26T17:19:35.4582489Z Java "Test" source files AST scan
2021-11-26T17:19:35.5577561Z 
2021-11-26T17:19:35.5578676Z 5 source files to be analyzed

And the first type it can’t resolve is a test dependency

2021-11-26T17:19:35.5578676Z 5 source files to be analyzed
2021-11-26T17:19:37.4602821Z ECJ Unable to resolve type junit.framework.TestCase

This would be quite sensible if tests are not being compiled/ran, and that sounds like it’s the case for the assemble task. Are you sure you face the exact same error on SonarCloud analysis after using gradle build as gradle assemble?

I get innumerable versions of the same error in both cases. The error code changes and the class being referenced changes, but it’s essentially the same structure of error message each time, either as assemble or build.

021-11-26T14:20:01.0472766Z Status ERROR: org.eclipse.jdt.core code=4 Could not retrieve declared methods org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(324) The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
2021-11-26T14:20:01.0475665Z ECJ Unable to resolve type junit.framework.TestCase
2021-11-26T14:20:01.0478439Z org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(324) The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
2021-11-26T14:20:01.0490454Z 	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:162)
2021-11-26T14:20:01.0493412Z 	at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:229)
2021-11-26T14:20:01.0496140Z 	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:2646)
2021-11-26T14:20:01.0643353Z 	at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.isClassPathCorrect(ProblemReporter.java:5117)
2021-11-26T14:20:01.0646595Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromCompoundName(LookupEnvironment.java:1791)
2021-11-26T14:20:01.0650133Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromConstantPoolName(LookupEnvironment.java:1821)
2021-11-26T14:20:01.0653853Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromConstantPoolName(LookupEnvironment.java:1829)
2021-11-26T14:20:01.0657181Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromSignature(LookupEnvironment.java:1899)
2021-11-26T14:20:01.0660803Z 	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createFields(BinaryTypeBinding.java:798)
2021-11-26T14:20:01.0663739Z 	at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:611)
2021-11-26T14:20:01.0666797Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1055)
2021-11-26T14:20:01.0671118Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1036)
2021-11-26T14:20:01.0674224Z 	at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:308)
2021-11-26T14:20:01.0677232Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:257)
2021-11-26T14:20:01.0680456Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1732)
2021-11-26T14:20:01.0682853Z 	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getType(LookupEnvironment.java:1701)
2021-11-26T14:20:01.0685001Z 	at org.eclipse.jdt.core.dom.ASTUtils.resolveType(ASTUtils.java:58)
2021-11-26T14:20:01.0686368Z 	at org.sonar.java.model.JSema.resolveType(JSema.java:137)
2021-11-26T14:20:01.0687391Z 	at org.sonar.java.model.JSema.lambda$getClassType$8(JSema.java:120)
2021-11-26T14:20:01.0688406Z 	at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
2021-11-26T14:20:01.0689450Z 	at org.sonar.java.model.JSema.getClassType(JSema.java:119)
2021-11-26T14:20:01.0690503Z 	at org.sonar.java.model.JType.isSubtypeOf(JType.java:56)
2021-11-26T14:20:01.0692126Z 	at org.sonar.java.checks.tests.NoTestInTestClassCheck.checkClass(NoTestInTestClassCheck.java:93)
2021-11-26T14:20:01.0694592Z 	at org.sonar.java.checks.tests.NoTestInTestClassCheck.lambda$visitNode$1(NoTestInTestClassCheck.java:77)
2021-11-26T14:20:01.0696400Z 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
2021-11-26T14:20:01.0697601Z 	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
2021-11-26T14:20:01.0699854Z 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
2021-11-26T14:20:01.0701836Z 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2021-11-26T14:20:01.0704387Z 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2021-11-26T14:20:01.0706651Z 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
2021-11-26T14:20:01.0708335Z 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
2021-11-26T14:20:01.0709882Z 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2021-11-26T14:20:01.0711380Z 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
2021-11-26T14:20:01.0713548Z 	at org.sonar.java.checks.tests.NoTestInTestClassCheck.visitNode(NoTestInTestClassCheck.java:77)
2021-11-26T14:20:01.0715681Z 	at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$visit$5(VisitorsBridge.java:294)
2021-11-26T14:20:01.0718720Z 	at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.lambda$forEach$8(VisitorsBridge.java:310)
2021-11-26T14:20:01.0759819Z 	at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:161)
2021-11-26T14:20:01.0761700Z 	at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.forEach(VisitorsBridge.java:310)
2021-11-26T14:20:01.0763665Z 	at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.visit(VisitorsBridge.java:296)
2021-11-26T14:20:01.0765634Z 	at org.sonar.java.model.VisitorsBridge$IssuableSubscriptionVisitorsRunner.scanFile(VisitorsBridge.java:258)
2021-11-26T14:20:01.0767361Z 	at org.sonar.java.model.VisitorsBridge.lambda$runScanner$0(VisitorsBridge.java:156)
2021-11-26T14:20:01.0768805Z 	at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:161)
2021-11-26T14:20:01.0770687Z 	at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:156)
2021-11-26T14:20:01.0772744Z 	at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:139)
2021-11-26T14:20:01.0774912Z 	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:104)
2021-11-26T14:20:01.0776219Z 	at org.sonar.java.ast.JavaAstScanner.lambda$scan$1(JavaAstScanner.java:79)
2021-11-26T14:20:01.0777655Z 	at org.sonar.java.model.JParserConfig$FileByFile.parse(JParserConfig.java:225)
2021-11-26T14:20:01.0779127Z 	at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:77)
2021-11-26T14:20:01.0780500Z 	at org.sonar.java.JavaFrontend.scanAndMeasureTask(JavaFrontend.java:178)
2021-11-26T14:20:01.0781771Z 	at org.sonar.java.JavaFrontend.scan(JavaFrontend.java:131)
2021-11-26T14:20:01.0783611Z 	at org.sonar.plugins.java.JavaSensor.execute(JavaSensor.java:109)
2021-11-26T14:20:01.0785496Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
2021-11-26T14:20:01.0787660Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
2021-11-26T14:20:01.0789816Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
2021-11-26T14:20:01.0792080Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
2021-11-26T14:20:01.0794306Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
2021-11-26T14:20:01.0796267Z 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
2021-11-26T14:20:01.0798271Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T14:20:01.0802031Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T14:20:01.0804198Z 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:440)
2021-11-26T14:20:01.0806949Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:436)
2021-11-26T14:20:01.0809118Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:433)
2021-11-26T14:20:01.0811211Z 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:394)
2021-11-26T14:20:01.0813248Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T14:20:01.0815114Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T14:20:01.0816930Z 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
2021-11-26T14:20:01.0818917Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
2021-11-26T14:20:01.0821442Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
2021-11-26T14:20:01.0823399Z 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
2021-11-26T14:20:01.0825300Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
2021-11-26T14:20:01.0827684Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2021-11-26T14:20:01.0829966Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-11-26T14:20:01.0832001Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-11-26T14:20:01.0921653Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-11-26T14:20:01.0924656Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-11-26T14:20:01.0926660Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2021-11-26T14:20:01.0928469Z 	at com.sun.proxy.$Proxy366.execute(Unknown Source)
2021-11-26T14:20:01.0929780Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2021-11-26T14:20:01.0932605Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2021-11-26T14:20:01.0934184Z 	at org.sonarqube.gradle.SonarQubeTask.run(SonarQubeTask.java:102)
2021-11-26T14:20:01.0935710Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-11-26T14:20:01.0937678Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-11-26T14:20:01.0939965Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-11-26T14:20:01.0941675Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-11-26T14:20:01.0942886Z 	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
2021-11-26T14:20:01.0945789Z 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
2021-11-26T14:20:01.0949120Z 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
2021-11-26T14:20:01.0952127Z 	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
2021-11-26T14:20:01.0955000Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:502)
2021-11-26T14:20:01.0957557Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
2021-11-26T14:20:01.0978161Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
2021-11-26T14:20:01.0980618Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
2021-11-26T14:20:01.0983012Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.0986166Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
2021-11-26T14:20:01.0988886Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.0991510Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
2021-11-26T14:20:01.0994185Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
2021-11-26T14:20:01.0997577Z 	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
2021-11-26T14:20:01.1001316Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74)
2021-11-26T14:20:01.1005415Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:487)
2021-11-26T14:20:01.1009828Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:470)
2021-11-26T14:20:01.1014166Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:106)
2021-11-26T14:20:01.1017709Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
2021-11-26T14:20:01.1021812Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:249)
2021-11-26T14:20:01.1025640Z 	at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:89)
2021-11-26T14:20:01.1028742Z 	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:40)
2021-11-26T14:20:01.1031139Z 	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:53)
2021-11-26T14:20:01.1032884Z 	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
2021-11-26T14:20:01.1035225Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
2021-11-26T14:20:01.1038999Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
2021-11-26T14:20:01.1164373Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
2021-11-26T14:20:01.1166975Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.1169543Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
2021-11-26T14:20:01.1172752Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.1176012Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
2021-11-26T14:20:01.1178946Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
2021-11-26T14:20:01.1182878Z 	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
2021-11-26T14:20:01.1186542Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
2021-11-26T14:20:01.1189144Z 	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:50)
2021-11-26T14:20:01.1190948Z 	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:40)
2021-11-26T14:20:01.1193468Z 	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
2021-11-26T14:20:01.1196505Z 	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
2021-11-26T14:20:01.1199232Z 	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50)
2021-11-26T14:20:01.1201998Z 	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
2021-11-26T14:20:01.1205414Z 	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
2021-11-26T14:20:01.1209295Z 	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
2021-11-26T14:20:01.1211794Z 	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
2021-11-26T14:20:01.1213997Z 	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
2021-11-26T14:20:01.1216897Z 	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
2021-11-26T14:20:01.1219844Z 	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:58)
2021-11-26T14:20:01.1224950Z 	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:39)
2021-11-26T14:20:01.1228716Z 	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
2021-11-26T14:20:01.1231851Z 	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
2021-11-26T14:20:01.1234962Z 	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:180)
2021-11-26T14:20:01.1237330Z 	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:75)
2021-11-26T14:20:01.1239385Z 	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
2021-11-26T14:20:01.1263750Z 	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40)
2021-11-26T14:20:01.1266404Z 	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29)
2021-11-26T14:20:01.1268830Z 	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
2021-11-26T14:20:01.1272447Z 	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
2021-11-26T14:20:01.1275615Z 	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:105)
2021-11-26T14:20:01.1278429Z 	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:98)
2021-11-26T14:20:01.1279897Z 	at java.base/java.util.Optional.map(Optional.java:265)
2021-11-26T14:20:01.1281542Z 	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:53)
2021-11-26T14:20:01.1284085Z 	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
2021-11-26T14:20:01.1286433Z 	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:85)
2021-11-26T14:20:01.1288637Z 	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:42)
2021-11-26T14:20:01.1291670Z 	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
2021-11-26T14:20:01.1295923Z 	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
2021-11-26T14:20:01.1299339Z 	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:92)
2021-11-26T14:20:01.1301900Z 	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:50)
2021-11-26T14:20:01.1305036Z 	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:114)
2021-11-26T14:20:01.1308724Z 	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
2021-11-26T14:20:01.1371099Z 	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:73)
2021-11-26T14:20:01.1375492Z 	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
2021-11-26T14:20:01.1378979Z 	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:92)
2021-11-26T14:20:01.1381652Z 	at java.base/java.util.Optional.orElseGet(Optional.java:369)
2021-11-26T14:20:01.1383731Z 	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:92)
2021-11-26T14:20:01.1482871Z 	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:33)
2021-11-26T14:20:01.1486755Z 	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
2021-11-26T14:20:01.1490309Z 	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
2021-11-26T14:20:01.1492969Z 	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
2021-11-26T14:20:01.1495502Z 	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
2021-11-26T14:20:01.1499515Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
2021-11-26T14:20:01.1503714Z 	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
2021-11-26T14:20:01.1506616Z 	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
2021-11-26T14:20:01.1511109Z 	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
2021-11-26T14:20:01.1513952Z 	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
2021-11-26T14:20:01.1516440Z 	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
2021-11-26T14:20:01.1518725Z 	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
2021-11-26T14:20:01.1521412Z 	at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
2021-11-26T14:20:01.1526252Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
2021-11-26T14:20:01.1530175Z 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
2021-11-26T14:20:01.1534586Z 	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
2021-11-26T14:20:01.1539027Z 	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
2021-11-26T14:20:01.1543994Z 	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
2021-11-26T14:20:01.1548992Z 	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
2021-11-26T14:20:01.1552868Z 	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
2021-11-26T14:20:01.1556488Z 	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
2021-11-26T14:20:01.1561016Z 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
2021-11-26T14:20:01.1563821Z 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
2021-11-26T14:20:01.1566496Z 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
2021-11-26T14:20:01.1569670Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
2021-11-26T14:20:01.1572906Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
2021-11-26T14:20:01.1575779Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
2021-11-26T14:20:01.1578317Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.1581949Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
2021-11-26T14:20:01.1585728Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
2021-11-26T14:20:01.1589965Z 	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
2021-11-26T14:20:01.1594463Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
2021-11-26T14:20:01.1598112Z 	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
2021-11-26T14:20:01.1602136Z 	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
2021-11-26T14:20:01.1605179Z 	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
2021-11-26T14:20:01.1607996Z 	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
2021-11-26T14:20:01.1614511Z 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402)
2021-11-26T14:20:01.1617531Z 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389)
2021-11-26T14:20:01.1620822Z 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382)
2021-11-26T14:20:01.1624193Z 	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368)
2021-11-26T14:20:01.1626905Z 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
2021-11-26T14:20:01.1628968Z 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
2021-11-26T14:20:01.1631284Z 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
2021-11-26T14:20:01.1633701Z 	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
2021-11-26T14:20:01.1636379Z 	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
2021-11-26T14:20:01.1638517Z 	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
2021-11-26T14:20:01.1721288Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2021-11-26T14:20:01.1723987Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2021-11-26T14:20:01.1726198Z 	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
2021-11-26T14:20:01.1727597Z 	at java.base/java.lang.Thread.run(Thread.java:829)

bear in mind they there are 1000s of these errors in our logs.

any update on this?

@Colin any update?

Greetings @jshattu

This is a community forum – while we try and help users as much as we can (as fast as we can), operators are not standing by and it’s not appropriate to bump threads after only a day. Your patience is appreciated.

ok, thanks @Colin, appreciate the efforts. We’re keen to get a direction on this, as this problem is currently undermining our sonarqube strategy at the moment.

Thanks for your patience @jshattu and for giving some more details about the issue.

Any error like this:

2021-11-26T17:19:37.4602821Z ECJ Unable to resolve type junit.framework.TestCase

or this

Pb(324) The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

Is typically the result of some scanner properties not being filled correctly (which should automatically be derived) which tells the scanner about Java classes it should know about during analysis.

To start, let me ask that you grab --debug level Gradle logs and look for the logs that read like this:

2021-12-01T16:17:45.312+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] Sensor JavaSensor [java]
2021-12-01T16:17:45.697+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] Configured Java source version (sonar.java.source): 11
2021-12-01T16:17:45.705+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] JavaClasspath initialization
2021-12-01T16:17:45.707+0100 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Property 'sonar.java.jdkHome' resolved with:
[]
2021-12-01T16:17:45.707+0100 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Property 'sonar.java.libraries' resolved with:
[]
2021-12-01T16:17:45.707+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] JavaClasspath initialization (done) | time=2ms
2021-12-01T16:17:45.707+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] JavaTestClasspath initialization
2021-12-01T16:17:45.707+0100 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Property 'sonar.java.jdkHome' resolved with:
[]
2021-12-01T16:17:45.709+0100 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Property 'sonar.java.test.libraries' resolved with:
[/Users/colin/Source/sonar-scanning-examples/sonarqube-scanner-gradle/gradle-multimodule/module-one/build/classes/java/main]
2021-12-01T16:17:45.709+0100 [INFO] [org.sonarqube.gradle.SonarQubeTask] JavaTestClasspath initialization (done) | time=2ms

And share them here.

thanks @Colin, I’m just running with the --debug option now, might take a few minutes.

What’s your view on this previous ticket?

Java analyzer compile error after upgrading to OpenJDK11

the reason, i mention this, is because in our codebase we also use the same HFT library.

My understanding of this thread is that with sonar.java.jdkHome set to a proper value, the issue will go away (I don’t think there’s a lingering issue with a specific library, but I’m not 100% sure). In any case, let’s find out how it is set (if it gets set) on your project.

I’ve got an 83MB log file to share with you, Your upload here is only 4MB? Can we share the file another way perhaps?

or perhaps you know the snippets you need?

These right here!

Log.txt (2.3 MB)

@Colin , here’s an excert from our logs, including some of the properties you listed as well as some errors

1 Like

Thanks @jshattu

Based on the logs, it does appear that sonar.java.jdkHome is being derived and used during analysis.

2021-12-01T15:49:36.5267863Z 2021-12-01T15:49:36.450+0000 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Property ‘sonar.java.jdkHome’ set with: /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64

Is this the Java distribution actually being used to build your project, and is your project actually targeting Java 11? Just want to do a sanity check here.

:warning: I took another look at the other thread you referenced and the reproducer martinroucek/sonar-ecj-problem and upgraded the version of OpenHFT/Java-Thread-Affinity used to the latest version 3.21ea82) and the problem went away. It looks like they tried to address the issue.

It might be worth testing upgrading this dependency to see if it’s in fact the root cause, but I would also like to confirm the previous point about Java.

yep, it is using that java. I’ve already tried different distributiosn of java, it doesn’t solve the problem. It’s the ECJ compiler that’s complaining anyway.

Our project is targetted to Java 11.

I’ll try upgrading the hft affinity package, I think this sounds promising, and will tell you how it goes.

Thanks for your help so far.

Hey @jshattu – did this manage to fix the problem? Would love to hear how it went.