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?
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.
...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events