SonarQube setup for MicroEJ project

Hello all,

I am trying to setup SonarQube for the project i’m currently working on and I bumped into an issue while doing so.

I have setup the SonarQube server in docker and installed all the prerequisite plugins (Checkstyle, Findbugs and PMD) and generated my user token. Everything is running ok on this part.

The problem I am facing is when I am building the ExampleTool-Sonar project. While running the sonarAnalysis.ant file I receive the following error inside the console.

It seems that the sonar profile file cannot be restored properly on the server.
This may be because either the file is not correctly formatted or that the http request is not correctly formed. I looked inside the ant file, but the request seems to be ok. I tried also pushing the file using the curl command:

curl -v POST -u admin:nimda “http://localhost:9000/api/qualityprofiles/restore” --form backup=@MicroEJ_rules.xml

but in the results I see that the MicroEJ_rules.xml file is not correctly formed or at least this is what I understand from the message I get back:
Screenshot 2022-09-23 at 11.40.26

Another thing that I tried to do is to manually import the file from the browser but I get the same error as I get from the curl command:

If anyone has any idea on how I can get over this step and restore the profile properly so i can see the analysis report, that would be great.

Thanks!
Bogdan

Hello Bogdan,

You are right we have an issue on this example of SonarQube use. A fix is on the way, in the meantime try using this set of rules.

MicroEJ_rules.xml (35.5 KB)

Let me know if it fixes the issue.
Gaëtan for MicroEJ

Hello Gaetan,

The new rules file fixed the problem.

Thank you!