]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2126: Change api to work with project file system
authorEvgeny Mandrikov <mandrikov@gmail.com>
Sun, 23 Jan 2011 17:58:49 +0000 (20:58 +0300)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Sun, 23 Jan 2011 17:58:49 +0000 (20:58 +0300)
sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java
sonar-plugin-api/src/test/java/org/sonar/api/test/MavenTestUtils.java

index 0145b07d7a9301331cbb10ee832c83ef95396bf6..2bd3866cd16e8997193de83636149466b250871f 100644 (file)
@@ -89,7 +89,9 @@ public class MavenProjectBuilder {
       fs.setBaseDir(pom.getBasedir());
       fs.setBuildDir(pom.getBuild().getDirectory());
       projectConfiguration.setProperty("project.build.outputDirectory", pom.getBuild().getOutputDirectory());
-      projectConfiguration.setProperty("project.reporting.outputDirectory", pom.getReporting().getOutputDirectory());
+      if (pom.getReporting() != null) {
+        projectConfiguration.setProperty("project.reporting.outputDirectory", pom.getReporting().getOutputDirectory());
+      }
       projectConfiguration.setProperty("sonar.java.sourceVersion", MavenUtils.getJavaSourceVersion(pom));
       projectConfiguration.setProperty("sonar.java.targetVersion", MavenUtils.getJavaVersion(pom));
     }
index a681327409e8d3d12f75e43d2d867fe61b66e216..3afd4569eb839758d1195c05147fe40d9e54cbcf 100644 (file)
@@ -76,7 +76,9 @@ public final class MavenTestUtils {
       fs.addTestDir(dir);
     }
     project.getConfiguration().setProperty("project.build.outputDirectory", pom.getBuild().getOutputDirectory());
-    project.getConfiguration().setProperty("project.reporting.outputDirectory", pom.getReporting().getOutputDirectory());
+    if (pom.getReporting() != null) {
+      project.getConfiguration().setProperty("project.reporting.outputDirectory", pom.getReporting().getOutputDirectory());
+    }
     fs.setBaseDir(project.getPom().getBasedir());
     fs.setBuildDir(project.getPom().getBuild().getDirectory());
     return project;