parent pom.xml not included in analyse for multi module project

376 views
Skip to first unread message

pepa...@gmail.com

unread,
Dec 8, 2016, 8:43:39 AM12/8/16
to SonarQube
Hello,

I am developing some custom SonarQube plugin which loads some external reports and converts  them into isues (like owasp dependency check) . On multi module projects , I would like to place the issues on parent pom.xml , but it is never included into filesystem.  All submodules has pom.xml accessable but no the parent pom.xml. No succes modifing sonar.sources , sonar.includes etc...  

A structure of the project is:

parent module
          submodule1
          pom.xml = included
          submodule2
          pom.xml = included

pom.xml = never included

Thanks

Pepa Procházka

G. Ann Campbell

unread,
Dec 8, 2016, 10:19:56 AM12/8/16
to SonarQube, pepa...@gmail.com
Hi Pepa,

You'll need to either make the XML plugin an additional dependency of your plugin so XML files are indexed, or enable sonar.import_unknown_files (Administration > Analysis Scope) so that all files are indexed.


Ann

pepa...@gmail.com

unread,
Dec 8, 2016, 10:49:24 AM12/8/16
to SonarQube, pepa...@gmail.com
Hello Ann,

I have alredy tried to enable import uknown files (global settings and maven param) but it makes no diference. I am getting the pom.xml for all submodules but the parent project (most upper module) . Inside a scanner during debug I can see that the filesystem has only one FilePredicate for base directory.  When I call filesystem.getBaseDir() I can see all files (java.io.File not InputFile) in that directory even the pom.xml. But the fileSystem input files or directories are emty on the most upper module (project) . It seems to me that the project component is threated diferentlly then the submodules.  I will do some more investigation how it goes with simple maven project (no submodules) . 


Thank you

With regards 

Pepa Prochazka

Dne čtvrtek 8. prosince 2016 14:43:39 UTC+1 pepa...@gmail.com napsal(a):

Michel Pawlak

unread,
Dec 9, 2016, 3:13:32 AM12/9/16
to SonarQube, pepa...@gmail.com
Hi, 

This is a current (or rather historical) limitation of SQ: from a SQ perspective components either contain components (no issues can be added as issues are bound to files), or contain files (issues can then be added), not both (and yes your pom.xml is in a component containing components so no luck). Somebody submitted a PR to "fix this feature" in 5.x, but it was never merged. I personly requested this feature a long time ago (2 years ? maybe 3...) 

Michel

Michel Pawlak

unread,
Dec 9, 2016, 7:21:44 AM12/9/16
to SonarQube, pepa...@gmail.com
Reply all
Reply to author
Forward
0 new messages