Transfer of source code trees to pipeline matrix cells running on different agents

Jenkins setup:

Jenkins: 2.426.3
OS: Linux - 4.18.0-193.1.2.el8_2.x86_64
Java: 11.0.13 - Red Hat, Inc. (OpenJDK 64-Bit Server VM)

In the context of a Jenkinsfile pipeline script in a source tree checked out from a git repository, how can/do pipeline matrix cells running on different agents get access to the source tree? Will Jenkins copy the source tree between machines automatically? Do I have to manually ensure that source code is checked out in each cell?

The documentation doesn’t seem to mention anything about it: Pipeline Syntax

Thanks

Declarative Pipelines include an implicit checkout step that retrieves the source code from the repository that provided the Jenkinsfile (the Pipeline definition). Since matrix is a feature of declarative Pipeline, it will perform the implicit checkout on each of the agents unless the skipDefaultCheckout option has been used.

The matrix announcement blog post says:

Sometimes, you may only want to disable automatic checkout of your repository, using the skipDefaultCheckout(true) option, for one specific stage in your Pipeline. … To make those things possible, we’ve added a new options direction to stage . You can use a subset of the top-level options content in a stage’s options- wrapper steps, and Declarative-specific options that are marked as legal in astage` .

So, unless you specifically disable the implicit checkout, it will happen for every element of the matrix.

The most recent Java 11 patch version is Java 11.0.23. You should consider yum update to get the most recent packages (Java and otherwise) for your operating system.