microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

[BUG]: Gradle 7 and JaCoCo gives Execution failed for task ':jacocoTestReport'. > The value for this file collection is final and cannot be changed. #18893

Closed morrowyn closed 8 months ago

morrowyn commented 1 year ago

Task name

Gradle

Task version

3.225.0

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu-Latest

Task log

Error: The process '/home/vsts/work/1/s/gradlew' failed with exit code 1
    at ExecState._setResult (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.225.0/node_modules/azure-pipelines-task-lib/toolrunner.js:943:25)
    at ExecState.CheckComplete (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.225.0/node_modules/azure-pipelines-task-lib/toolrunner.js:926:18)
    at ChildProcess.<anonymous> (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.225.0/node_modules/azure-pipelines-task-lib/toolrunner.js:839:19)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
Result Attachments will be stored in LogStore
Run Attachments will be stored in LogStore
##[warning]No code coverage results found to be published. This could occur if there were no tests executed or there was a build failure. Check the gradle output for details.
##[error]Code analysis failed. Gradle exit code: -1. Error: Error: The process '/home/vsts/work/1/s/gradlew' failed with exit code 1

Relevant log output

Welcome to Gradle 7.6.2!

Here are the highlights of this release:
 - Added support for Java 19.
 - Introduced `--rerun` flag for individual task rerun.
 - Improved dependency block for test suites to be strongly typed.
 - Added a pluggable system for Java toolchains provisioning.

For more details see https://docs.gradle.org/7.6.2/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

Finished generating test XML results (0.244 secs) into: /home/vsts/work/1/s/build/test-results/test
Generating HTML test report...
Finished generating test html results (0.274 secs) into: /home/vsts/work/1/s/build/reports/tests/test
Watching 233 directories to track changes
    at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:309)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:302)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:288)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:462)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:379)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)

Aditional info

Gradle 7.6.2
Pool: Azure Pipelines
Image: ubuntu-latest
Agent: Hosted Agent

Have to use Java 17 with latest SonarQube online job, which requires Java 17. See 
https://docs.sonarcloud.io/appendices/scanner-environment/

The build works fine when SonarQube online is disabled and Java 11 with Gradle 6 is being used.
KonstantinTyukalov commented 1 year ago

Similar to https://github.com/microsoft/azure-pipelines-tasks/issues/16860

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days