From c8dd1e72592de2dbeef28a2ab03f045eab74e4fb Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 28 Apr 2011 14:34:51 +0400 Subject: [PATCH] Force creation of project workDir --- .../sonar/batch/DefaultProjectFileSystem2.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java index 00c85b67ccb..90e8ec2e658 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java +++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java @@ -154,18 +154,18 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem { @Override public File getSonarWorkingDirectory() { + File dir; if (pom != null) { - try { - File dir = new File(getBuildDir(), "sonar"); - FileUtils.forceMkdir(dir); - return dir; - - } catch (IOException e) { - throw new SonarException("Unable to retrieve Sonar working directory.", e); - } + dir = new File(getBuildDir(), "sonar"); } else { - return def.getWorkDir(); + dir = def.getWorkDir(); + } + try { + FileUtils.forceMkdir(dir); + } catch (IOException e) { + throw new SonarException("Unable to retrieve Sonar working directory.", e); } + return dir; } } -- 2.39.5