Skip to content

Commit

Permalink
Updated Sonar Scanner to version 5.0.1.3006, compatible with Java 17. (
Browse files Browse the repository at this point in the history
…#186)

<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
This update addresses the need for keeping our environment aligned with
the latest supported Java version for Sonar Scanner. The deprecated
support for Java 11 necessitated this upgrade. These changes ensure our
build and analysis processes remain efficient and up-to-date with
current standards.

Sonar community link--->
https://community.sonarsource.com/t/java-11-is-deprecated-as-a-runtime-env-to-scan-your-projects/96597

<!--- Describe your changes in detail -->

## Related GitHub Issue
usdot-fhwa-stol/carma-platform#2292
<!--- This project only accepts pull requests related to open GitHub
issues or Jira Keys -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please DO NOT name partially fixed issues, instead open an issue
specific to this fix -->
<!--- Please link to the issue here: -->

## Related Jira Key

<!-- e.g. CAR-123 -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
Docker build process tested locally to ensure the successful
installation of Java 17 and the new Sonar Scanner version to remove the
deprecated warning
Ensured that existing functionalities are not affected by this upgrade.
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the
[**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
SaikrishnaBairamoni authored Jan 25, 2024
2 parents bc30b32 + 58a22f8 commit 93b9fa5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2018-2021 LEIDOS.
# Copyright (C) 2018-2024 LEIDOS.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -222,7 +222,7 @@ RUN sed -i 's|http://archive.ubuntu.com|http://us.archive.ubuntu.com|g' /etc/apt
SONAR_DIR=/opt/sonarqube && \
# Pull scanner from internet
mkdir $SONAR_DIR && \
curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip && \
curl -o $SONAR_DIR/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip && \
curl -o $SONAR_DIR/build-wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && \
# Unzip scanner
unzip $SONAR_DIR/sonar-scanner.zip -d "$SONAR_DIR"/ && \
Expand Down Expand Up @@ -261,6 +261,8 @@ RUN sed -i 's|http://archive.ubuntu.com|http://us.archive.ubuntu.com|g' /etc/apt
sudo -u carma rosdep --rosdistro noetic install --from-paths /home/carma/.base-image/workspace/src --ignore-src -y && \
sudo -u carma echo "source ~/.base-image/init-env.sh" >> /home/carma/.bashrc && \
sudo -u carma echo "cd /opt/carma" >> /home/carma/.bashrc && \
# Install Java 17
apt-get install -y openjdk-17-jdk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit 93b9fa5

Please sign in to comment.