SonarQube on Jenkins appears to automatically clean target

322 views Asked by At

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?

0

There are 0 answers