I have a directory structure something like this:
- base
- subdir1
- subdir2
- subdir3
- subsubdir1
- subsubdir2
- subdir4
- unittests
How do I set up my pom.xml so that it only processes the folders in bold? If possible, I want them to all be processed in one mvn sonar:sonar
call, and to show up as separate projects in Sonar. I tried looking at the documentation for the Project Object Model, but I found it to be overwhelming, and couldn't figure out how to set it up as I described. This is what my pom.xml, located in base, currently looks like:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo.bar.baz</groupId>
<artifactId>subsubdir2</artifactId>
<name>MyProject</name>
<version>1.0</version>
<build>
<sourceDirecto开发者_StackOverflow中文版ry>subdir3/subsubdir2</sourceDirectory>
<testSourceDirectory>unittests</testSourceDirectory>
</build>
<properties>
<sonar.language>php</sonar.language>
<sonar.phase>generate-sources</sonar.phase>
</properties>
</project>
You can build the top level pom and use the sonar.skippedModules or sonar.includedModules property to set up the list of modules to build. This won't show each module as a separate project at the top level of sonar, but if you go into the project and select "modules", then you'll see each one listed, as if it were a separate project.
精彩评论