java - Run SonarScanner analysis with Java 11, run target code with Java 8
问题描述
As the following image points out, SonarSource ended support to run code Analyzers with pre-11 Java versions
I have tried to search for a full example about how to run a bitbucket pipeline to execute SonarScanner analysis using a java 11 Analyzer but having target code using pre-java 11 versions (e.g. java 8), but I wasn't able to found one. According to that image, it should be possible.
解决方案
我不确定是什么问题。公告通知您必须使用 Java 11+ 来执行扫描,但您仍然可以使用 Java <11 编译代码。您没有提供有关您的项目的任何信息,所以让我们以一个 Maven 项目为例。
这通常意味着您必须执行以下操作:
// set Java to 8
export JAVA_HOME=/path/to/jdk8/
// compile, test and build
mvn package
// set Java to 11
export JAVA_HOME=/path/to/jdk11/
// execute scanner
mvn sonar:sonar
推荐阅读
- android - NDK c++ r15 这个警告是什么意思?
- ios - ios:将数据发布到 Firestore 时出现问题
- html - 为什么一个ul比另一个低
- c - 为什么函数总是返回 0?(C)
- ios - 打开具有视频类型的 PhotoLibrary,无需压缩过程
- openstreetmap - 创建一个移动标记。机器人操作系统(ROS)
- android - android中的kotlin:删除意图的对象值,因为它只使用一次
- python - 'Final' 语句在递归函数中执行两次 [Python 3.6]p
- delphi - 如何将文本从 Indy TCPServer 发送到 TCPClient
- android - 活动轮换释放