</exclusion>
</exclusions>
</dependency>
+
+ <!-- TODO http://jira.codehaus.org/browse/SONAR-2011
+ We need following dependency, otherwise we will receive compilation error
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<artifactId>sonar-plugin-api</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- TODO http://jira.codehaus.org/browse/SONAR-2011
+ We need following dependency, otherwise we will receive compilation error
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
<artifactId>sonar-plugin-api</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- TODO http://jira.codehaus.org/browse/SONAR-2011
+ We need following dependency, otherwise we will receive compilation error
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- TODO http://jira.codehaus.org/browse/SONAR-2011
+ We need following dependency, otherwise we will receive
+ java.lang.NoClassDefFoundError: org/apache/maven/project/MavenProject
+ during call mock(org.sonar.api.resources.Project.class)
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
</exclusion>
</exclusions>
</dependency>
+
+ <!-- TODO http://jira.codehaus.org/browse/SONAR-2011
+ We need following dependency, otherwise we will receive compilation error
+ -->
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-squid</artifactId>
</dependency>
+
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-ehcache</artifactId>
+ </dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jta</artifactId>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
+
+ <!-- TODO remove dependencies on Maven
+ but for now they should be defined with scope provided
+ -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<artifactId>maven-project</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-common-artifact-filters</artifactId>
- </dependency>
+
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- </dependency>
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
/**
* A class that manipulates Projects in the Sonar way, i.e. mixing MavenProjects with the way it should be analyzed
- *
+ *
* @since 1.10
*/
public class Project extends Resource {
@Deprecated
public static final String PARAM_REUSE_RULES_CONFIG = "sonar.reuseExistingRulesConfiguration";
-
/**
* Enumerates the type of possible analysis
*/
private String[] exclusionPatterns;
private String analysisVersion;
private boolean latestAnalysis;
-
+
// modules tree
private Project parent;
private List<Project> modules = new ArrayList<Project>();
return this;
}
+ /**
+ * For internal use only.
+ */
public final Project setPom(MavenProject pom) {
this.pom = pom;
return this;
/**
* whether it's the latest analysis done on this project (displayed in sonar dashboard) or an analysis on a past revision.
+ *
* @since 2.0
*/
public boolean isLatestAnalysis() {
* For internal use only.
*/
public void removeFromParent() {
- if (parent!=null) {
+ if (parent != null) {
parent.modules.remove(this);
}
}
/**
* Sets the configuration
- *
+ *
* @return the current object
*/
public final Project setConfiguration(Configuration configuration) {