Rashi Saxena
Rashi Saxena

Reputation: 11

What maven goal is required to run maven sonar analysis?

I have seen sonar builds failing if I run mvn package or mvn verify as build goals, however if I change it to mvn install it passes.

Can you explain why maven install goal is needed for sonar to work properly?

Upvotes: 1

Views: 2328

Answers (1)

In a multi-module build an aggregator plugin can't resolve dependencies from target folder. So you have two options:

  • mvn clean install && mvn sonar:sonar as two separate processes
  • mvn clean package sonar:sonar as a single reactor

Upvotes: 2

Related Questions