Our project uses Gradle + Java 8. At the moment it's not possible to migrate over to Java 11.
SonarCloud needs Java 11.
Does anyone know how to setup Bitbucket pipelines where Java 8 is used for building our project and Java 11 is used for SonarCloud analysis?
Hi Fred,
For every step you define in your bitbucket-pipelines.yml file, a Docker container starts, the repo is cloned in that container and then the commands of the script are executed.
If you don't define an image for the Docker container, then the default one (atlassian/default-image:2) will be used.
It is possible to define which Docker image you want to use either at the global level or at the step level (so each step can run on a different image).
What you can do is
- create a step for your build, and for this step use a Docker image that has Java 8
- create another step for SonarCloud analysis, and for this step use a Docker image that has Java 11
We support public and private Docker images including those hosted on Docker Hub, AWS, GCP, Azure and self-hosted registries accessible on the internet.
If you need in the SonarCloud analysis step any files that were generated during the build in the previous step, you can define them as artifacts so that these files will be available in the next step:
If you don't need that and the second step is not dependant on the first one, you can also run these two steps as parallel ones.
If you have any questions and/or need more information about my suggestions, please feel free to let me know.
Kind regards,
Theodora
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.