aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2024-05-07 12:50:18 +0200
committersonartech <sonartech@sonarsource.com>2024-05-13 20:02:41 +0000
commit4ccf1c5a389156e3a4a2155a3663092542e166da (patch)
tree39264651d3c6c0503cf6030c3d46a3dd986ceec9 /sonar-scanner-engine/src
parent792b34433b4a7f98c9ae1749378e68e426343728 (diff)
downloadsonarqube-4ccf1c5a389156e3a4a2155a3663092542e166da.tar.gz
sonarqube-4ccf1c5a389156e3a4a2155a3663092542e166da.zip
Log the Java version
Diffstat (limited to 'sonar-scanner-engine/src')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerMain.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerMain.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerMain.java
index 1dbafef4ce9..887844a1756 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerMain.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/ScannerMain.java
@@ -55,6 +55,7 @@ public class ScannerMain {
public static int run(InputStream in) {
try {
LOG.info("Starting SonarScanner Engine...");
+ LOG.atInfo().log(ScannerMain::java);
var properties = parseInputProperties(in);
@@ -72,6 +73,20 @@ public class ScannerMain {
}
}
+ static String java() {
+ StringBuilder sb = new StringBuilder();
+ sb
+ .append("Java ")
+ .append(System.getProperty("java.version"))
+ .append(" ")
+ .append(System.getProperty("java.vendor"));
+ String bits = System.getProperty("sun.arch.data.model");
+ if ("32".equals(bits) || "64".equals(bits)) {
+ sb.append(" (").append(bits).append("-bit)");
+ }
+ return sb.toString();
+ }
+
private static void handleException(Exception e) {
var messageException = unwrapMessageException(e);
if (messageException.isPresent()) {