-
Notifications
You must be signed in to change notification settings - Fork 13
Description
In order for Sonar to run on a subset of modules, it necessary to specify each module's parents. For example with a simple project set up as follows, to run Sonar on grandchild1
we need to include container1
and top-level
as a minimum.
top-level/pom.xml
(pom-packaging)container1/pom.xml
(pom-packaging)grandchild1/pom.xml
code
container2/pom.xml
(pom-packaging)grandchild2/pom.xml
code
With the partial-build-plugin
we can achieve this by using the following flags:
partial.impacted=true
: ensures any dependant projects are also Sonar'dpartial.ignoreAllReactorProjects=true
: ensures that all pom-package modules are included
If we make a change in grandchild1
, this has the result of selecting top-level
, container1
, container2
, and grandchild1
to run Sonar on.
The problem we are seeing is that if we make a change to only a pom-package module, then the impacted=true
has no effect. For example, if we modify container1/pom.xml
, then using the settings above only top-level
, container
and container2
are selected for Sonar. We would expect grandchild1
to be included, as it could have been affected by the change in its parent container (dependency changes, etc).
If we use partial.impacted=true
and partial.ignoreAllReactorProjects=false
, then we see container1
and grandchild1
selected, but we cannot run Sonar as we would also need top-level
to be included.
It seems as if the ignoreAllReactorProjects
flag ignores reactor projects when calculating impact, but this flag seems to be the only way to include parent projects in the build (which Sonar needs).
It would be useful to include an option that includes all parents of selected modules. This could be combined with impacted=true
to ensure that all modules that have been impacted by the change can be Sonar'd.
Note that because of the size of our code-base, we build the code multi-threaded, and perform Sonar in a separate single-threaded pass (it doesn't seem to cope with multi-thread).