From the logs, I found the following warnings for this file:
[INFO] 14:31:22.466 Starting batch processing.
[INFO] 14:31:28.045 100% analyzed
[INFO] 14:31:28.046 Batch processing: Done.
[INFO] 14:31:28.081 Did not optimize analysis for any files, performed a full analysis for all 22 files.
[INFO] 14:31:28.082 No "Generated" source files to scan.
[INFO] 14:31:28.082 Sensor JavaSensor [java] (done) | time=20391ms
[INFO] 14:31:28.083 Sensor SurefireSensor [java]
[INFO] 14:31:28.096 parsing [/home/jenkins/agent/workspace/eshop-project/target/surefire-reports]
[DEBUG] 14:31:28.613 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.614 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.614 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.615 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.616 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.616 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.616 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.616 Class not found in resource cache : bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[DEBUG] 14:31:28.616 Resource not found: bla.bla.bla.bla.projectname.test.service.InferenceServiceImplTest
[INFO] 14:31:28.658 Sensor SurefireSensor [java] (done) | time=576ms
[INFO] 14:31:28.658 Sensor XML Sensor [xml]
[DEBUG] 14:31:28.673 'pom.xml' generated metadata with charset 'UTF-8'
[INFO] 14:31:28.702 1 source file to be analyzed
However, I read the Surefire XML file, and it shows that all 16 tests ran successfully.
I get an error for this test file, but I’m not sure if it’s related because all tests are executing.
[INFO] Running bla.bla.bla.projectname.test.service.InferenceServiceImplTest
09:05:55.131 [main] ERROR org.apache.jena.riot -- [line: 1, col: 1 ] Content is not allowed in prolog.
09:05:56.615 [main] WARN bla.bla.bla.projectname.service.InferenceServiceImpl -- No inference SPARQL queries could be retrieved from the application.yml file, triples will be missing after the inference
09:05:57.960 [main] WARN bla.bla.bla.projectname.service.InferenceServiceImpl -- No inference SPARQL queries could be retrieved from the application.yml file, triples will be missing after the inference
09:06:03.501 [main] WARN bla.bla.bla.projectname.service.InferenceServiceImpl -- No inference SPARQL queries could be retrieved from the application.yml file, triples will be missing after the inference
09:06:04.412 [main] WARN bla.bla.bla.projectname.service.InferenceServiceImpl -- Extended model not defined, empty model will be used.
09:06:04.613 [main] WARN bla.bla.bla.projectname.service.InferenceServiceImpl -- No inference SPARQL queries could be retrieved from the application.yml file, triples will be missing after the inference
09:06:07.824 [main] WARN bla.bla.bla.projectname.utils.ModelUtils -- Couldn't find a lang name for name ''
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 25.66 s -- in bla.bla.bla.projectname.test.service.InferenceServiceImplTest
In the second stage, I run the SonarQube command.
I can’t find anything in the pom.xml for excluding the file.
What I was asking was: when you open the Surefire XML file and look at the contents, do the listings for the other files look similar in format and content to the one for InferenceServiceImplTest.java?
After reviewing the information and logs you provided, I see that InferenceServiceImplTest has some issues.
Can you please try to fix the test and successfully build the project with the command: mvn clean install ?
The error and warning in the logs of InferenceServiceImplTest do not impact test results, as all tests ran successfully, which is confirmed by the Surefire xml for InferenceServiceImplTest. Also, I tried running Sonnar scanner with Java version 17 and 21, but without success.