From e9990905e6c5dfd0910a3800f5e3bf5d3dc7ae13 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Sun, 23 Jan 2011 19:25:12 +0300 Subject: [PATCH] SONAR-2126: Change api to work with project file system --- .../src/main/java/org/sonar/batch/MavenProjectBuilder.java | 2 ++ .../src/test/java/org/sonar/api/test/MavenTestUtils.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java index e05a557bbee..0145b07d7a9 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/MavenProjectBuilder.java @@ -88,6 +88,8 @@ 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()); projectConfiguration.setProperty("sonar.java.sourceVersion", MavenUtils.getJavaSourceVersion(pom)); projectConfiguration.setProperty("sonar.java.targetVersion", MavenUtils.getJavaVersion(pom)); } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/MavenTestUtils.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/MavenTestUtils.java index 7b4d9dcf186..a681327409e 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/test/MavenTestUtils.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/test/MavenTestUtils.java @@ -75,6 +75,8 @@ public final class MavenTestUtils { for (File dir : fs.resolvePaths(project.getPom().getTestCompileSourceRoots())) { fs.addTestDir(dir); } + project.getConfiguration().setProperty("project.build.outputDirectory", pom.getBuild().getOutputDirectory()); + project.getConfiguration().setProperty("project.reporting.outputDirectory", pom.getReporting().getOutputDirectory()); fs.setBaseDir(project.getPom().getBasedir()); fs.setBuildDir(project.getPom().getBuild().getDirectory()); return project; -- 2.39.5