summaryrefslogtreecommitdiffstats
path: root/sonar-maven-plugin
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-04-09 02:19:28 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-04-26 13:00:11 +0400
commite174628696636f74808f61c76a44da994edcadc7 (patch)
tree06af7a9e94d17294cce72ddded48a84c8b2b3f1f /sonar-maven-plugin
parent4eb630d0ff939898efdd9ef29330736ca4e50ebc (diff)
downloadsonarqube-e174628696636f74808f61c76a44da994edcadc7.tar.gz
sonarqube-e174628696636f74808f61c76a44da994edcadc7.zip
SONAR-2298 Add support for multi-modules for non-Maven projects
* Use ProjectDefinition in ProjectTree instead of MavenProject * Allow to specify extensions for project's container via ProjectDefinition, so MavenProject not passed directly to batch in mojos * ProjectDefinition should store all information in properties * Replace DefaultProjectFileSystem by DefaultProjectFileSystem2, which works not only for Maven projects * Add DefaultProjectClasspath, which works not only for Maven projects * Enable ProjectLinksSensor only for Maven
Diffstat (limited to 'sonar-maven-plugin')
-rw-r--r--sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java12
1 files changed, 8 insertions, 4 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 ab0123210f5..eb57053ba8a 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
@@ -19,8 +19,6 @@
*/
package org.sonar.maven;
-import java.io.InputStream;
-
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
@@ -42,8 +40,12 @@ import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
import org.slf4j.LoggerFactory;
import org.sonar.batch.Batch;
-import org.sonar.batch.MavenReactor;
+import org.sonar.batch.MavenProjectConverter;
import org.sonar.batch.bootstrapper.EnvironmentInformation;
+import org.sonar.batch.bootstrapper.ProjectDefinition;
+import org.sonar.batch.bootstrapper.Reactor;
+
+import java.io.InputStream;
/**
* @goal sonar
@@ -143,7 +145,9 @@ public final class SonarMojo extends AbstractMojo {
}
private void executeBatch() throws MojoExecutionException {
- MavenReactor reactor = new MavenReactor(session);
+ ProjectDefinition def = MavenProjectConverter.convert(session.getSortedProjects());
+ Reactor reactor = new Reactor(def);
+
Batch batch = new Batch(getInitialConfiguration(),
reactor, session, project, getLog(), lifecycleExecutor, pluginManager, artifactFactory,
localRepository, artifactMetadataSource, artifactCollector, dependencyTreeBuilder,