aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-maven-plugin/src
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-01-11 19:59:09 +0300
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-01-18 15:11:11 +0300
commit231a993de184196c75be888dab2da539a600fac0 (patch)
tree22b7054e9317b8bd8077500e8613554ee3a337b4 /sonar-maven-plugin/src
parenta88512126dc63e77c19c62a495b984379a01f020 (diff)
downloadsonarqube-231a993de184196c75be888dab2da539a600fac0.tar.gz
sonarqube-231a993de184196c75be888dab2da539a600fac0.zip
SONAR-1514: Add support for a new Ant task to analyze projects
* Add new environment - Ant. * Introduce new component (Reactor) in order to break dependency on MavenSession. * Add annotation SupportedEnvironment and corresponding check to BatchPluginRepository. To allow specify in which environments BatchExtension should be active. * Use this new annotation to disable MavenDependenciesSensor in Ant environment.
Diffstat (limited to 'sonar-maven-plugin/src')
-rw-r--r--sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
index 516b2500c3b..51dd2a82d0e 100644
--- a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
+++ b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java
@@ -40,6 +40,7 @@ import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
import org.slf4j.LoggerFactory;
import org.sonar.api.platform.Environment;
import org.sonar.batch.Batch;
+import org.sonar.batch.MavenReactor;
import java.io.InputStream;
@@ -78,7 +79,7 @@ public final class SonarMojo extends AbstractMojo {
/**
* The artifact factory to use.
- *
+ *
* @component
* @required
* @readonly
@@ -87,7 +88,7 @@ public final class SonarMojo extends AbstractMojo {
/**
* The artifact repository to use.
- *
+ *
* @parameter expression="${localRepository}"
* @required
* @readonly
@@ -96,7 +97,7 @@ public final class SonarMojo extends AbstractMojo {
/**
* The artifact metadata source to use.
- *
+ *
* @component
* @required
* @readonly
@@ -105,7 +106,7 @@ public final class SonarMojo extends AbstractMojo {
/**
* The artifact collector to use.
- *
+ *
* @component
* @required
* @readonly
@@ -114,7 +115,7 @@ public final class SonarMojo extends AbstractMojo {
/**
* The dependency tree builder to use.
- *
+ *
* @component
* @required
* @readonly
@@ -133,16 +134,15 @@ public final class SonarMojo extends AbstractMojo {
executeBatch();
}
-
private void executeBatch() throws MojoExecutionException {
+ MavenReactor reactor = new MavenReactor(session);
Batch batch = new Batch(getInitialConfiguration(),
- session, project, getLog(), lifecycleExecutor, pluginManager, artifactFactory,
+ reactor, session, project, getLog(), lifecycleExecutor, pluginManager, artifactFactory,
localRepository, artifactMetadataSource, artifactCollector, dependencyTreeBuilder,
projectBuilder, Environment.MAVEN2, Maven2PluginExecutor.class);
batch.execute();
}
-
private void initLogging() throws MojoExecutionException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator jc = new JoranConfigurator();