facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.89k stars 2.01k forks source link

[java] fix the source and target compatibility failures on the Maven tests #1672

Closed jeremydubreil closed 2 years ago

jeremydubreil commented 2 years ago

Compiling the Maven tests was failing before these changes with the following errors:

$ mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.16, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-47-generic", arch: "amd64", family: "unix"

$ cd infer/infer/tests/build_systems/codetoanalyze/mvn/simple_app

$ mvn clean compile
...
[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.
...

Specifying the source and target version in the Maven configuration file fixes the errors and the compilation works with Java 8, Java 11 and Java 18.

This does not affect the Maven integration tests and all the tests are passing locally with make -j test.

jvillard commented 2 years ago

Welcome back @jeremydubreil!! :tada:

facebook-github-bot commented 2 years ago

@jvillard has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.