0

I'm taking over supporting a jenkins build server, so still trying to work out it's configuration and all projects and qwerks setup. One project has just started failing after a refactor and I'm trying to work out how the build and sonarqube interact with each other.

If a developer does "mvn clean install", everything builds and tests pass successfully, but jenkins it still fails at the SonarQube step due to tests failing.

Jenkins was doing "mvn clean install -DskipTests", it builds about 20 modules and skips tests so they are not executed twice. SonarQube is added as a post build step.

The refactor means the git repo has been split. Some of the tests require files in the now seperate repo. So I added a maven-remote-resource-plugin step so these are unzipped into ${project.build.directory}/maven-shared-archive-resources and this is added as a testResources directory. That works find till SonarQube tries to test.

Checking the jenkins project log, I can see the clean install and tests passing, then I can see SonarQube start, tests pass, then it gets to the altered module where it fails. I check the server and the ${project.build.directory}/maven-shared-archive-resources directory doesn't exist. I scan back though the log to the end of the successful build and not reports that it's doing a clean or directory delete.

Has anyone else had issues with SonarQube appearing to silently delete delete target directories before execution?

  • 1
    Please [edit] your question to provide the versions of the SonarQube server (found in the footer of any page of the interface) and the Java plugin (found in the Update Center which is visible only to instance admins) – G. Ann - SonarSource Team Dec 16 '16 at 19:35
  • Did you try to analyse the project without Jenkins? – Jeroen Heier Dec 16 '16 at 19:51
  • SonarQube v4.2 SonarQube Java Plugin v2.1 Jenkins v1.609.3 Jenkins SonarQube Plugin v2.2.1 I accept they are not the newest versions, but I'm not able to upgrade them currently. – John Patrick Dec 19 '16 at 11:25

0 Answers0