aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-maven-batch-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-01-27 11:47:19 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2014-01-27 12:28:40 +0100
commitdf04c42a7d286b89cf9fa602b4aa03af0125dae9 (patch)
tree9c61ff3442bbb75fbfc2897ea9e8ade0c5dd30b0 /plugins/sonar-maven-batch-plugin
parent593a0d77a318f5cd35e4efb0a2ec5bf62e2f6d83 (diff)
downloadsonarqube-df04c42a7d286b89cf9fa602b4aa03af0125dae9.tar.gz
sonarqube-df04c42a7d286b89cf9fa602b4aa03af0125dae9.zip
SONAR-926 Expose new FileSystem API based on InputFile/InputDir
Diffstat (limited to 'plugins/sonar-maven-batch-plugin')
-rw-r--r--plugins/sonar-maven-batch-plugin/src/main/java/org/sonar/plugins/maven/DefaultMavenPluginExecutor.java37
1 files changed, 19 insertions, 18 deletions
diff --git a/plugins/sonar-maven-batch-plugin/src/main/java/org/sonar/plugins/maven/DefaultMavenPluginExecutor.java b/plugins/sonar-maven-batch-plugin/src/main/java/org/sonar/plugins/maven/DefaultMavenPluginExecutor.java
index 4dea1968071..cab684b55c6 100644
--- a/plugins/sonar-maven-batch-plugin/src/main/java/org/sonar/plugins/maven/DefaultMavenPluginExecutor.java
+++ b/plugins/sonar-maven-batch-plugin/src/main/java/org/sonar/plugins/maven/DefaultMavenPluginExecutor.java
@@ -56,8 +56,8 @@ public class DefaultMavenPluginExecutor implements MavenPluginExecutor {
}
MavenPlugin plugin = MavenPlugin.getPlugin(project.getPom(), handler.getGroupId(), handler.getArtifactId());
execute(project,
- fs,
- getGoal(handler.getGroupId(), handler.getArtifactId(), plugin != null && plugin.getPlugin() != null ? plugin.getPlugin().getVersion() : null, goal));
+ fs,
+ getGoal(handler.getGroupId(), handler.getArtifactId(), plugin != null && plugin.getPlugin() != null ? plugin.getPlugin().getVersion() : null, goal));
}
return handler;
}
@@ -76,20 +76,21 @@ public class DefaultMavenPluginExecutor implements MavenPluginExecutor {
Thread.currentThread().setContextClassLoader(currentClassLoader);
profiler.stop();
}
-
- MavenProjectConverter.synchronizeFileSystem(project.getPom(), fs);
+ if (!fs.isInitialized()) {
+ MavenProjectConverter.synchronizeFileSystem(project.getPom(), fs);
+ }
}
}
static String getGoal(String groupId, String artifactId, @Nullable String version, String goal) {
String defaultVersion = version == null ? "" : version;
return new StringBuilder()
- .append(groupId).append(":")
- .append(artifactId).append(":")
- .append(defaultVersion)
- .append(":")
- .append(goal)
- .toString();
+ .append(groupId).append(":")
+ .append(artifactId).append(":")
+ .append(defaultVersion)
+ .append(":")
+ .append(goal)
+ .toString();
}
public void concreteExecute(MavenProject pom, String goal) {
@@ -130,14 +131,14 @@ public class DefaultMavenPluginExecutor implements MavenPluginExecutor {
try {
ReactorManager reactor = new ReactorManager(Arrays.asList(pom));
MavenSession clonedSession = new MavenSession(mavenSession.getContainer(),
- mavenSession.getSettings(),
- mavenSession.getLocalRepository(),
- mavenSession.getEventDispatcher(),
- reactor,
- Arrays.asList(goal),
- mavenSession.getExecutionRootDirectory(),
- mavenSession.getExecutionProperties(),
- mavenSession.getStartTime());
+ mavenSession.getSettings(),
+ mavenSession.getLocalRepository(),
+ mavenSession.getEventDispatcher(),
+ reactor,
+ Arrays.asList(goal),
+ mavenSession.getExecutionRootDirectory(),
+ mavenSession.getExecutionProperties(),
+ mavenSession.getStartTime());
executeMethod.invoke(lifecycleExecutor, clonedSession, reactor, clonedSession.getEventDispatcher());
} catch (Exception e) {
throw new SonarException("Unable to execute Maven 2 plugin", e);