Unexplainable Issue


I am trying to create custom rules for java. To do it, I add some jar files and remove somes other. One time it stoped working correctly. I had this error

[ERROR] Unable to parse source file : 'src/main/java/rules/IncludeHeaderError.java'
[ERROR] Parse error at line 12 column 22: Lambda expressions are allowed only at source level 1.8 or above

It make sense knowing the I create a rule about including header and an other about lambda expresions. But the errors doesn’t make sense to me because I’ve already tested it and the rule about including header worked and I am using java 17 and also knowing that I can create a jar file with mvn package correctly.
Moreover, I don’t have any file called IncludeHeaderError.java (maybe it’s a hidden one) and I don’t talk about any lamba expression in line 12 of any file.

So I thought I broke my sonar qube server somehow. I decided to delete my old server and create a new clean one.
Before adding any plugin, I tried to do the analysis with the normal rules and the very same errors appeared. It doesn’t make sense because it should not be link with the jar file I created
Does anyone know what happen ?

I am using sonarqube
java 17
Apache Maven 3.9.1


Well that’s odd.

Can you provide the full DEBUG logs of the analysis (mvn sonar:sonar -X) that results in this error?

I found a way to make it work. I don’t know what happen but I just recreated the rule and the test project from scratch and it worked. I am sorry, I can’t explain what happend.