aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects
diff options
context:
space:
mode:
authorSimon Brandhof <SimonBrandhof@imac2-sonarsource.local>2011-01-05 20:56:04 +0100
committerSimon Brandhof <SimonBrandhof@imac2-sonarsource.local>2011-01-05 20:56:04 +0100
commitbe6dab9351f7ffff361781c44c51fc7d77421a98 (patch)
tree78a9936850d3563c10ac3bae962dc7886d1060a3 /subprojects
parent17c6a868aaa0d90d60d29e074d8faef32811aed6 (diff)
downloadsonarqube-be6dab9351f7ffff361781c44c51fc7d77421a98.tar.gz
sonarqube-be6dab9351f7ffff361781c44c51fc7d77421a98.zip
extracted sonar-dev-maven-plugin to its own repository
Diffstat (limited to 'subprojects')
-rw-r--r--subprojects/sonar-dev-maven-plugin/RELEASE_NOTES.txt13
-rw-r--r--subprojects/sonar-dev-maven-plugin/pom.xml471
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/java/org/sonar/dev/TrimMojo.java157
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-db.sql0
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-user.sql0
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-db.sql0
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-user.sql0
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-db.sql3
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-user.sql3
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-user.sql5
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-db.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-user.sql1
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/server/sonar.properties103
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/resources/server/wrapper.conf121
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.build.xml457
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.mojos.xml417
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/test/java/org/sonar/dev/TrimMojoTest.java106
-rw-r--r--subprojects/sonar-dev-maven-plugin/src/test/resources/org/sonar/dev/TrimMojoTest/whitespace-indented.txt9
29 files changed, 0 insertions, 1878 deletions
diff --git a/subprojects/sonar-dev-maven-plugin/RELEASE_NOTES.txt b/subprojects/sonar-dev-maven-plugin/RELEASE_NOTES.txt
deleted file mode 100644
index 5f15a84a3d0..00000000000
--- a/subprojects/sonar-dev-maven-plugin/RELEASE_NOTES.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Temporary release notes - waiting for a dedicated project/component in JIRA
-
--------------------------------------------------------------------------------
-Upgrade from sonar-dev-mojo 2.2-SNAPSHOT to sonar-dev-maven-plugin 1.0-SNAPSHOT
--------------------------------------------------------------------------------
-* Remove the parameter 'environment'
-* The goal 'stop' requires the parameter 'sonar.runtimeVersion'
-* The goals 'start' and 'stop' now use the standalone mode (Jetty)
-* Add the goals 'start-war' and 'stop-war' to use the WAR mode (Tomcat)
-* Increase allocated memory (needed for Derby tests)
-* Add predefined database profiles. For example selecting database=mysql sets default url and driver for MySQL.
-* Add the goal "analyze" with required parameter "sonar.projectsDir". It replaces the parameters "mavenProjectsDir" and "analyzeProjects"
-
diff --git a/subprojects/sonar-dev-maven-plugin/pom.xml b/subprojects/sonar-dev-maven-plugin/pom.xml
deleted file mode 100644
index a224bfe1c5b..00000000000
--- a/subprojects/sonar-dev-maven-plugin/pom.xml
+++ /dev/null
@@ -1,471 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.codehaus.sonar</groupId>
- <artifactId>sonar-dev-maven-plugin</artifactId>
- <version>1.1-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
- <name>Sonar :: Development Maven Plugin</name>
- <description>Maven plugin for Sonar development environment</description>
-
- <repositories>
- <repository>
- <id>sonar</id>
- <url>http://repository.sonarsource.org/content/repositories/sonar</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <inceptionYear>2010</inceptionYear>
- <organization>
- <name>SonarSource</name>
- <url>http://www.sonarsource.com</url>
- </organization>
- <licenses>
- <license>
- <name>GNU Lesser General Public License (LGPL), v.3</name>
- <url>http://www.gnu.org/licenses/lgpl.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <developers>
- <developer>
- <id>simon.brandhof</id>
- <name>Simon Brandhof</name>
- <email>simon.brandhof@sonarsource.com</email>
- <organization>SonarSource</organization>
- <roles>
- <role>developer</role>
- </roles>
- <timezone>+1</timezone>
- </developer>
- <developer>
- <id>godin</id>
- <name>Evgeny Mandrikov</name>
- <email>mandrikov@gmail.com</email>
- <roles>
- <role>developer</role>
- </roles>
- <timezone>+3</timezone>
- </developer>
- </developers>
-
- <scm>
- <connection>scm:svn:http://svn.codehaus.org/sonar/trunk/subprojects/sonar-dev-maven-plugin</connection>
- <developerConnection>scm:svn:https://svn.codehaus.org/sonar/trunk/subprojects/sonar-dev-maven-plugin</developerConnection>
- <url>https://svn.codehaus.org/sonar/trunk/subprojects/sonar-dev-maven-plugin</url>
- </scm>
-
- <issueManagement>
- <system>jira</system>
- <url>http://jira.codehaus.org/browse/SONAR</url>
- </issueManagement>
- <ciManagement>
- <system>bamboo</system>
- <url>http://bamboo.ci.codehaus.org/browse/SONAR</url>
- </ciManagement>
- <distributionManagement>
- <repository>
- <id>codehaus.org</id>
- <url>dav:https://dav.codehaus.org/repository/sonar</url>
- <uniqueVersion>false</uniqueVersion>
- </repository>
- <snapshotRepository>
- <id>codehaus.org</id>
- <url>dav:https://dav.codehaus.org/snapshots.repository/sonar</url>
- <uniqueVersion>false</uniqueVersion>
- </snapshotRepository>
- </distributionManagement>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.min.version>2.0</maven.min.version>
- <jdk.min.version>1.5</jdk.min.version>
- <mavenVersion>2.0.9</mavenVersion>
- </properties>
-
- <build>
- <pluginManagement>
- <plugins>
- <!-- Plugins ordered by shortname (archetype, assembly ...) -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.5</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>1.5</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.7</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.6</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-ant</artifactId>
- <version>2.6</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-7</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireMavenVersion>
- <message>To build this project Maven ${maven.min.version} (or upper) is required. Please install it.
- </message>
- <version>${maven.min.version}</version>
- </requireMavenVersion>
- <requireJavaVersion>
- <message>To build this project JDK ${jdk.min.version} (or upper) is required. Please install it.
- </message>
- <version>${jdk.min.version}</version>
- </requireJavaVersion>
- <requirePluginVersions>
- <!-- TODO
- This rule produces warning under maven-3.0-beta-1 :
- "This rule is not compatible with the current version of Maven."
- -->
- <message>Build reproducibility : always define plugin versions</message>
- <banLatest>true</banLatest>
- <banRelease>true</banRelease>
- <phases>clean,deploy</phases>
- </requirePluginVersions>
- <!--bannedDependencies>
- <message>Don't use banned dependencies</message>
- <searchTransitive>true</searchTransitive>
- <excludes>
- <exclude>commons-logging:commons-logging</exclude>
- </excludes>
- </bannedDependencies-->
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${jdk.min.version}</source>
- <target>${jdk.min.version}</target>
- <encoding>${project.build.sourceEncoding}</encoding>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.6</version>
- <executions>
- <execution>
- <id>check-java-version</id>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <signature>
- <groupId>org.codehaus.mojo.signature</groupId>
- <artifactId>java15</artifactId>
- <version>1.0</version>
- </signature>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <tagBase>https://svn.codehaus.org/sonar/tags</tagBase>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <executions>
- <execution>
- <id>help-mojo</id>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-
- <dependencies>
- <dependency>
- <groupId>fikin</groupId>
- <artifactId>fikin-ant</artifactId>
- <version>1.7.3</version>
- </dependency>
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b3</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- maven -->
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-archiver</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>${mavenVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>${mavenVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>${mavenVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${mavenVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-script-ant</artifactId>
- <version>2.0.10</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- <version>1.7.1</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>1.5.6</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-ant</artifactId>
- <!-- Godin:
- Seems that version 1.0 has corrupted metadata in central maven repo,
- so in this case project can't be built with Maven 2.2
- And versions 1.0.1 - 1.0.3 doesn't work for us.
- -->
- <version>1.0-beta-2</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- JDBC drivers are used when the database is created (property dropDatabase is true) -->
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.13</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbyclient</artifactId>
- <version>10.4.2.0</version>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.3-603.jdbc3</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>1.2.2</version>
- </dependency>
-
- <!-- fikin dependencies -->
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- </dependency>
-
- <!-- unit tests -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <version>1.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.6</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1</version>
- <reportSets>
- <reportSet>
- <reports>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
-</project>
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/java/org/sonar/dev/TrimMojo.java b/subprojects/sonar-dev-maven-plugin/src/main/java/org/sonar/dev/TrimMojo.java
deleted file mode 100644
index abe8e8df8bb..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/java/org/sonar/dev/TrimMojo.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.dev;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.LineIterator;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * @goal trim
- */
-public class TrimMojo extends AbstractMojo {
-
- /**
- * @parameter
- * @required
- */
- private File directory;
-
- /**
- * List of ant-style patterns. If
- * this is not specified, allfiles in the project source directories are included.
- *
- * @parameter
- */
- private String[] includes;
-
- /**
- * @parameter
- */
- private String[] excludes;
-
-
- /**
- * Specifies the encoding of the source files.
- *
- * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
- */
- private String sourceEncoding;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- if (shouldExecute()) {
- trimDirectory();
- }
- }
-
- private void trimDirectory() throws MojoExecutionException {
- File[] files = scanFiles();
- for (File file : files) {
- StringBuilder sb = new StringBuilder();
- try {
- LineIterator lines = FileUtils.lineIterator(file, sourceEncoding);
- while (lines.hasNext()) {
- String line = lines.nextLine();
- if (StringUtils.isNotBlank(line)) {
- sb.append(StringUtils.trim(line));
- sb.append(IOUtils.LINE_SEPARATOR);
- }
- }
- FileUtils.writeStringToFile(file, sb.toString(), sourceEncoding);
-
- } catch (IOException e) {
- throw new MojoExecutionException("Can not trim the file " + file, e);
- }
- }
- getLog().info("Trimmed files: " + files.length);
- }
-
- private boolean shouldExecute() {
- return directory != null && directory.exists();
- }
-
- /**
- * gets a list of all files in the source directory.
- *
- * @return the list of all files in the source directory;
- */
- private File[] scanFiles() {
- String[] defaultIncludes = {"**\\*"};
- DirectoryScanner ds = new DirectoryScanner();
- if (includes == null) {
- ds.setIncludes(defaultIncludes);
- } else {
- ds.setIncludes(includes);
- }
- ds.addDefaultExcludes(); // .svn, ...
- if (excludes != null) {
- ds.setExcludes(excludes);
- }
- ds.setBasedir(directory);
- getLog().info("Scanning directory " + directory);
- ds.scan();
- int maxFiles = ds.getIncludedFiles().length;
- File[] result = new File[maxFiles];
- for (int i = 0; i < maxFiles; i++) {
- result[i] = new File(directory, ds.getIncludedFiles()[i]);
- }
- return result;
- }
-
- public File getDirectory() {
- return directory;
- }
-
- public void setDirectory(File directory) {
- this.directory = directory;
- }
-
- public String[] getIncludes() {
- return includes;
- }
-
- public void setIncludes(String[] includes) {
- this.includes = includes;
- }
-
- public String[] getExcludes() {
- return excludes;
- }
-
- public void setExcludes(String[] excludes) {
- this.excludes = excludes;
- }
-
- public String getSourceEncoding() {
- return sourceEncoding;
- }
-
- public void setSourceEncoding(String sourceEncoding) {
- this.sourceEncoding = sourceEncoding;
- }
-}
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-db.sql
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-db.sql
+++ /dev/null
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-user.sql
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/create-user.sql
+++ /dev/null
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-db.sql
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-db.sql
+++ /dev/null
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-user.sql
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/derby/drop-user.sql
+++ /dev/null
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-db.sql
deleted file mode 100644
index 63989086b88..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-db.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-create database ${jdbcUsername};
-USE ${jdbcUsername};
-sp_addalias ${jdbcUsername}, dbo;
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-user.sql
deleted file mode 100644
index 7dbe22ac4af..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/create-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-CREATE LOGIN ${jdbcUsername} WITH PASSWORD = '${jdbcPassword}', CHECK_POLICY=OFF;
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-db.sql
deleted file mode 100644
index 0df041a5fe1..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-drop database ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-user.sql
deleted file mode 100644
index 2c26c0be78b..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mssql/drop-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-drop login ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-db.sql
deleted file mode 100644
index abeeba33763..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-create database ${jdbcUsername} character set utf8; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-user.sql
deleted file mode 100644
index b2bb96a7b8d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/create-user.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-create user '${jdbcUsername}' IDENTIFIED BY '${jdbcPassword}';
-GRANT ALL ON ${jdbcUsername}.* TO '${jdbcUsername}'@'%' IDENTIFIED BY '${jdbcPassword}';
-GRANT ALL ON ${jdbcUsername}.* TO '${jdbcUsername}'@'localhost' IDENTIFIED BY '${jdbcPassword}'; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-db.sql
deleted file mode 100644
index ac1ee5da0b7..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-drop database IF EXISTS ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-user.sql
deleted file mode 100644
index cae40f993ef..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/mysql/drop-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-drop user '${jdbcUsername}'@'%'; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-db.sql
deleted file mode 100644
index eef971b76be..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-// nothing to do under oracle \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-user.sql
deleted file mode 100644
index 302aef07595..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/create-user.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-CREATE USER ${jdbcUsername} IDENTIFIED BY ${jdbcPassword} DEFAULT TABLESPACE USERS ACCOUNT UNLOCK;
-GRANT CONNECT TO ${jdbcUsername};
-GRANT RESOURCE TO ${jdbcUsername};
-GRANT CREATE TABLE to ${jdbcUsername};
-GRANT CREATE SEQUENCE to ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-db.sql
deleted file mode 100644
index eef971b76be..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-// nothing to do under oracle \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-user.sql
deleted file mode 100644
index dc0c5cf34d3..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/oracle/drop-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP USER ${jdbcUsername} CASCADE; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-db.sql
deleted file mode 100644
index 9f21e36bd2e..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-CREATE DATABASE ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-user.sql
deleted file mode 100644
index 96822e499d8..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/create-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-CREATE USER ${jdbcUsername} WITH PASSWORD '${jdbcPassword}' CREATEDB; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-db.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-db.sql
deleted file mode 100644
index 7c7c5cb0f38..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-db.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP DATABASE IF EXISTS ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-user.sql b/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-user.sql
deleted file mode 100644
index 646dd40346d..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/database/postgresql/drop-user.sql
+++ /dev/null
@@ -1 +0,0 @@
-DROP USER IF EXISTS ${jdbcUsername}; \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/server/sonar.properties b/subprojects/sonar-dev-maven-plugin/src/main/resources/server/sonar.properties
deleted file mode 100644
index 2dd5f5fca27..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/server/sonar.properties
+++ /dev/null
@@ -1,103 +0,0 @@
-#--------------------------------------------------------
-# To use an environment variable, use the following syntax : ${env:NAME_OF_ENV_VARIABLE}
-# For example :
-# sonar.jdbc.url: ${env:SONAR_JDBC_URL}
-#
-#
-# See also the file conf/wrapper.conf for JVM advanced settings
-#---------------------------------------------------------
-
-
-#---------------------------------------------------------
-# WEB
-#---------------------------------------------------------
-# Listen host/port and context path (for example / or /sonar). Default values are 0.0.0.0:9000/
-# ONLY IF STANDALONE MODE. NOT USED IF DEPLOYED AS A WAR.
-#sonar.web.host: 0.0.0.0
-#sonar.web.port: 9000
-#sonar.web.context: /
-
-# Apache mod_jk connector. Supported only in standalone mode.
-# Uncomment to activate AJP13 connector.
-#sonar.ajp13.port: 8009
-
-#---------------------------------------------------------
-# DATABASE
-#---------------------------------------------------------
-
-#----- Embedded database
-# Comment the following lines to deactivate the default embedded database (used only for tests and demos)
-#sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true
-#sonar.jdbc.driverClassName: org.apache.derby.jdbc.ClientDriver
-#sonar.jdbc.validationQuery: values(1)
-# data directory, autodetected : /data if standalone application, /WEB-INF/classes/data if WAR deployement (exploded mode)
-#sonar.embeddedDatabase.dataDir:
-# derby embedded database server listening port, defaults to 1527
-#sonar.derby.drda.portNumber: 1527
-
-#----- MySQL 5.x/6.x
-# Comment the embedded database and uncomment the following lines to use MySQL
-#sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
-#sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
-#sonar.jdbc.validationQuery: select 1
-
-
-#----- Oracle 10g/11g
-# Comment the embedded database and uncomment the following lines to use Oracle
-#sonar.jdbc.url: jdbc:oracle:thin:@localhost/XE
-#sonar.jdbc.driverClassName: oracle.jdbc.driver.OracleDriver
-#sonar.jdbc.validationQuery: select 1 from dual
-
-# Activate if more than one Sonar Oracle schemas on the data server (for example different versions installed).
-# In that case, use the same property during maven analysis (-Dsonar.hibernate.default_schema=xxx)
-#sonar.hibernate.default_schema: sonar
-
-#----- PostgreSQL 8.x
-# uncomment the 3 following lines to use PostgreSQL
-#sonar.jdbc.url: jdbc:postgresql://localhost/sonar
-#sonar.jdbc.driverClassName: org.postgresql.Driver
-#sonar.jdbc.validationQuery: select 1
-
-
-#----- Microsoft SQLServer - NOT TESTED and NOT SUPPORTED.
-# The Jtds open source driver is available in extensions/jdbc-driver/mssql. More details on http://jtds.sourceforge.
-#sonar.jdbc.url: jdbc:jtds:sqlserver://localhost;databaseName=SONAR;SelectMethod=Cursor
-#sonar.jdbc.driverClassName: net.sourceforge.jtds.jdbc.Driver
-#sonar.jdbc.validationQuery: select 1
-
-
-#----- Global database settings
-#sonar.jdbc.username: sonar
-#sonar.jdbc.password: sonar
-sonar.jdbc.maxActive: 10
-sonar.jdbc.maxIdle: 5
-sonar.jdbc.minIdle: 2
-sonar.jdbc.maxWait: 5000
-sonar.jdbc.minEvictableIdleTimeMillis: 600000
-sonar.jdbc.timeBetweenEvictionRunsMillis: 30000
-
-# Transaction isolation level. Default driver setting is used by default.
-# Values : 1 (TRANSACTION_READ_UNCOMMITED), 2 (TRANSACTION_READ_COMMITTED), 4 (TRANSACTION_REPEATABLE_READ), 8 (TRANSACTION_SERIALIZABLE)
-#sonar.jdbc.defaultTransactionIsolation: 2
-
-
-# When packaged in a WAR, JDBC datasource can be configured into the application server then registered to JNDI.
-# In such a case Sonar uses this datasource to connect to database, else if binds itself its own datasource.
-# Note : Jonas does not accept to bind subcontexts, so name should be something like 'jdbc-sonar', without slashes.
-#sonar.jdbc.jndiName: jdbc/sonar
-
-# If you don't use the default JDBC drivers, as listed above, then you have to explicitly set the dialect to use.
-# Values are : mysql, derby, oracle, postgresql
-#sonar.jdbc.dialect=
-
-
-#---------------------------------------------------------
-# EXTENSIONS
-#---------------------------------------------------------
-# Absolute path of coding rules extensions (custom rules that are not provided with tools like Checkstyle or PMD).
-# This parameter is useful when Sonar is deployed as a WAR. It avoids from packaging the WAR file each time extensions JARs are updated.
-# The directory contains subdirectories like checkstyle/ and pmd/
-# Example :
-# sonar.rules.extensionsPath: /user/home/jdoe/sonar/extensions
-# Example for windows platform (backslash char must be escaped) :
-# sonar.rules.extensionsPath: D:\\softwares\\sonar-1.8\\extensions
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/resources/server/wrapper.conf b/subprojects/sonar-dev-maven-plugin/src/main/resources/server/wrapper.conf
deleted file mode 100644
index 232e2fb8d02..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/resources/server/wrapper.conf
+++ /dev/null
@@ -1,121 +0,0 @@
-wrapper.java.additional.1=-Djava.awt.headless=true
-wrapper.java.additional.2=-XX:MaxPermSize=256m
-wrapper.java.additional.3=-server
-wrapper.java.initmemory=256
-wrapper.java.maxmemory=1024
-
-#********************************************************************
-# Wrapper Java Properties
-#********************************************************************
-# JVM
-# Can be an absolute path, for example:
-#wrapper.java.command=/path/to/my/jdk/bin/java
-wrapper.java.command=java
-
-# Java Main class. This class must implement the WrapperListener interface
-# or guarantee that the WrapperManager class is initialized. Helper
-# classes are provided to do this for you. See the Integration section
-# of the documentation for details.
-wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
-
-# Java Classpath (include wrapper.jar) Add class path elements as
-# needed starting from 1
-wrapper.java.classpath.1=../../lib/*.jar
-wrapper.java.classpath.2=../../
-wrapper.java.classpath.3=../../extensions/jdbc-driver/derby/*.jar
-wrapper.java.classpath.4=../../extensions/jdbc-driver/mysql/*.jar
-wrapper.java.classpath.5=../../extensions/jdbc-driver/oracle/*.jar
-wrapper.java.classpath.6=../../extensions/jdbc-driver/postgresql/*.jar
-wrapper.java.classpath.7=../../extensions/jdbc-driver/mssql/*.jar
-wrapper.java.classpath.8=../../conf/
-
-# Java Library Path (location of Wrapper.DLL or libwrapper.so)
-wrapper.java.library.path.1=./lib
-
-# Application parameters. Add parameters as needed starting from 1
-wrapper.app.parameter.1=org.sonar.application.StartServer
-
-#********************************************************************
-# Profiling and debbuging - for development only
-# If wrapper.java.additional.3=-server is not commented, parameter ids should start from 4 instead of 3.
-#********************************************************************
-# Java remote debugging
-#wrapper.java.additional.3=-agentlib:jdwp=transport=dt_socket,server=y,address=8000
-
-# JProfiler 5
-#wrapper.java.additional.3=-Xint
-#wrapper.java.additional.4=-agentlib:jprofilerti=port=8849
-#wrapper.java.additional.5=-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar
-
-# JMX remote monitoring on Sun JVM (warning, security is disabled)
-#wrapper.java.additional.3=-Dcom.sun.management.jmxremote
-#wrapper.java.additional.4=-Dcom.sun.management.jmxremote.port=9005
-#wrapper.java.additional.5=-Dcom.sun.management.jmxremote.authenticate=false
-#wrapper.java.additional.6=-Dcom.sun.management.jmxremote.ssl=false
-
-#********************************************************************
-# Wrapper Logging Properties
-#********************************************************************
-# Format of output for the console. (See docs for formats)
-wrapper.console.format=PM
-
-# Log Level for console output. (See docs for log levels)
-wrapper.console.loglevel=NONE
-
-# Log file to use for wrapper output logging.
-wrapper.logfile=../../logs/sonar.log
-
-# Format of output for the log file. (See docs for formats)
-wrapper.logfile.format=LPTM
-
-# Log Level for log file output. (See docs for log levels)
-wrapper.logfile.loglevel=INFO
-
-# Maximum size that the log file will be allowed to grow to before
-# the log is rolled. Size is specified in bytes. The default value
-# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
-# 'm' (mb) suffix. For example: 10m = 10 megabytes.
-#wrapper.logfile.maxsize=0
-
-# Maximum number of rolled log files which will be allowed before old
-# files are deleted. The default value of 0 implies no limit.
-#wrapper.logfile.maxfiles=0
-
-# Log Level for sys/event log output. (See docs for log levels)
-wrapper.syslog.loglevel=NONE
-
-#********************************************************************
-# Wrapper Windows Properties
-#********************************************************************
-# Title to use when running as a console
-wrapper.console.title=Sonar
-
-#********************************************************************
-# Wrapper Windows NT/2000/XP Service Properties
-#********************************************************************
-# WARNING - Do not modify any of these properties when an application
-# using this configuration file has been installed as a service.
-# Please uninstall the service before modifying this section. The
-# service can then be reinstalled.
-
-# Name of the service
-wrapper.ntservice.name=Sonar
-
-# Display name of the service
-wrapper.ntservice.displayname=Sonar
-
-# Description of the service
-wrapper.ntservice.description=Sonar
-
-# Service dependencies. Add dependencies as needed starting from 1
-wrapper.ntservice.dependency.1=
-
-# Mode in which the service is installed. AUTO_START or DEMAND_START
-wrapper.ntservice.starttype=AUTO_START
-
-# Allow the service to interact with the desktop.
-wrapper.ntservice.interactive=false
-
-#********************************************************************
-# restart the process if CPU is heavily loaded during 240 seconds.
-wrapper.ping.timeout=240 \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.build.xml b/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.build.xml
deleted file mode 100644
index 0ff6e5c60f3..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.build.xml
+++ /dev/null
@@ -1,457 +0,0 @@
-<project>
- <property name="tmpdir" value="${java.io.tmpdir}/sonar"/>
- <property name="tomcat6.home" value="${tmpdir}/tomcat6"/>
-
- <taskdef resource="cargo.tasks"/>
- <taskdef name="httpmpost" classname="net.sf.fikin.ant.httpclientanttask.AntMultipartPostMethod"/>
- <taskdef name="httppost" classname="net.sf.fikin.ant.httpclientanttask.AntPostMethod"/>
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
-
- <!-- entry points : start and stop -->
- <target name="start" depends="expand-database-profile,prepare-standalone-configuration,drop-database,configure-sonar">
- <parallel>
- <antcall target="start-standalone"/>
- <antcall target="setup"/>
- </parallel>
- </target>
-
- <target name="stop" depends="prepare-standalone-configuration,stop-standalone"/>
-
- <target name="prepare-standalone-configuration">
- <condition property="sonar.bin.path" value="bin/macosx-universal-64/sonar.sh">
- <os family="mac"/>
- </condition>
- <condition property="sonar.bin.path" value="bin/windows-x86-32/StartSonar.bat">
- <os family="windows"/>
- </condition>
- <condition property="sonar.bin.path" value="bin/linux-x86-32/sonar.sh">
- <os family="unix"/>
- </condition>
- </target>
-
- <!--
-
- DATABASE PROFILES
-
- -->
- <target name="expand-database-profile">
- <!-- derby -->
- <condition property="jdbcUrl" value="jdbc:derby://localhost:1527/sonar;create=true">
- <and>
- <equals arg1="${database}" arg2="derby"/>
- <not>
- <isset property="jdbcUrl"/>
- </not>
- </and>
- </condition>
- <condition property="jdbcDriver" value="org.apache.derby.jdbc.ClientDriver">
- <and>
- <equals arg1="${database}" arg2="derby"/>
- <not>
- <isset property="jdbcDriver"/>
- </not>
- </and>
- </condition>
-
- <!-- mysql -->
- <condition property="jdbcUrl"
- value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8">
- <and>
- <equals arg1="${database}" arg2="mysql"/>
- <not>
- <isset property="jdbcUrl"/>
- </not>
- </and>
- </condition>
- <condition property="jdbcDriver" value="com.mysql.jdbc.Driver">
- <and>
- <equals arg1="${database}" arg2="mysql"/>
- <not>
- <isset property="jdbcDriver"/>
- </not>
- </and>
- </condition>
-
- <!-- postgresql -->
- <condition property="jdbcUrl" value="jdbc:postgresql://localhost/sonar">
- <and>
- <equals arg1="${database}" arg2="postgresql"/>
- <not>
- <isset property="jdbcUrl"/>
- </not>
- </and>
- </condition>
- <condition property="jdbcDriver" value="org.postgresql.Driver">
- <and>
- <equals arg1="${database}" arg2="postgresql"/>
- <not>
- <isset property="jdbcDriver"/>
- </not>
- </and>
- </condition>
-
- <!-- oracle -->
- <condition property="jdbcUrl" value="jdbc:oracle:thin:@localhost/XE">
- <and>
- <equals arg1="${database}" arg2="oracle"/>
- <not>
- <isset property="jdbcUrl"/>
- </not>
- </and>
- </condition>
- <condition property="jdbcDriver" value="oracle.jdbc.driver.OracleDriver">
- <and>
- <equals arg1="${database}" arg2="oracle"/>
- <not>
- <isset property="jdbcDriver"/>
- </not>
- </and>
- </condition>
-
- <!-- SQLServer -->
- <condition property="jdbcUrl" value="jdbc:jtds:sqlserver://localhost;databaseName=SONAR;SelectMethod=Cursor">
- <and>
- <equals arg1="${database}" arg2="mssql"/>
- <not>
- <isset property="jdbcUrl"/>
- </not>
- </and>
- </condition>
- <condition property="jdbcDriver" value="net.sourceforge.jtds.jdbc.Driver">
- <and>
- <equals arg1="${database}" arg2="mssql"/>
- <not>
- <isset property="jdbcDriver"/>
- </not>
- </and>
- </condition>
- </target>
-
-
- <target name="start-war" depends="expand-database-profile,drop-database,configure-sonar">
- <parallel>
- <antcall target="start-tomcat"/>
- <antcall target="setup"/>
- </parallel>
- </target>
-
- <target name="stop-war" depends="stop-tomcat"/>
-
- <!-- STEP 1 : initialize the database -->
- <target name="drop-database">
- <condition property="execute.drop.database">
- <istrue value="${dropDatabase}"/>
- </condition>
- <antcall target="do-drop-database"/>
- </target>
-
- <target name="do-drop-database" if="execute.drop.database">
- <sql driver="${jdbcDriver}"
- url="${jdbcRootUrl}"
- userid="${jdbcRootUsername}"
- password="${jdbcRootPassword}"
- onerror="continue"
- autocommit="true"
- expandProperties="true">
- <resources>
- <javaresource name="database/${database}/drop-db.sql"/>
- <javaresource name="database/${database}/drop-user.sql"/>
- <javaresource name="database/${database}/create-user.sql"/>
- <javaresource name="database/${database}/create-db.sql"/>
- </resources>
- </sql>
-
- <echo>Database is ready</echo>
- </target>
-
-
- <!-- STEP 2 : install Sonar -->
- <target name="clean-sonar-home" if="execute.sonar.clean">
- <delete dir="${tmpdir}/sonar-${runtimeVersion}"/>
- <mkdir dir="${tmpdir}"/>
- </target>
-
-
- <target name="prepare-sonar-home" unless="is.installed">
- <copy tofile="${tmpdir}/sonar-${runtimeVersion}.zip" overwrite="true" verbose="true" flatten="true"
- failonerror="false"
- file="${localRepository}/org/codehaus/sonar/sonar-application/${runtimeVersion}/sonar-application-${runtimeVersion}.zip">
- </copy>
- <condition property="execute.download-sonar">
- <not>
- <available file="${tmpdir}/sonar-${runtimeVersion}.zip"/>
- </not>
- </condition>
- <antcall target="download-sonar"/>
- <unzip src="${tmpdir}/sonar-${runtimeVersion}.zip" dest="${tmpdir}"/>
- </target>
-
-
- <target name="download-sonar" if="execute.download-sonar">
- <echo>Downloading sonar</echo>
- <get src="http://dist.sonar.codehaus.org/sonar-${runtimeVersion}.zip"
- dest="${tmpdir}/sonar-${runtimeVersion}.zip"/>
- <echo>Installing to local maven repo</echo>
- <mvninstall groupId="org.codehaus.sonar"
- artifactId="sonar-application"
- version="${runtimeVersion}"
- packaging="zip"
- file="${tmpdir}/sonar-${runtimeVersion}.zip"/>
- </target>
-
- <target name="copy-extensions" if="has.extensions">
- <echo>Copy extensions...</echo>
- <copy todir="${tmpdir}/sonar-${runtimeVersion}/extensions" overwrite="true" verbose="true" flatten="false">
- <fileset dir="${extensionsDir}"/>
- </copy>
- </target>
-
-
- <target name="copy-plugin-artifact" if="has.plugin.artifact">
- <echo>Copy plugin artifact...</echo>
- <copy todir="${tmpdir}/sonar-${runtimeVersion}/extensions/plugins" overwrite="true" verbose="true"
- flatten="true"
- file="${pluginArtifact}">
- </copy>
- </target>
-
-
- <target name="configure-sonar">
- <condition property="execute.sonar.clean" value="true">
- <istrue value="${clean}"/>
- </condition>
- <antcall target="clean-sonar-home" />
-
- <available property="is.installed" file="${tmpdir}/sonar-${runtimeVersion}/conf/sonar.properties"/>
- <antcall target="prepare-sonar-home"/>
-
- <copy todir="${tmpdir}/sonar-${runtimeVersion}/conf/" overwrite="true" verbose="true" flatten="true">
- <resources>
- <javaresource name="server/sonar.properties"/>
- <javaresource name="server/wrapper.conf"/>
- </resources>
- </copy>
-
- <available property="has.extensions" file="${extensionsDir}"/>
- <antcall target="copy-extensions"/>
-
- <condition property="has.plugin.artifact">
- <and>
- <available file="${pluginArtifact}" />
- <istrue value="${copyPluginArtifact}"/>
- </and>
- </condition>
- <antcall target="copy-plugin-artifact"/>
-
- </target>
-
-
- <!-- STEP 3 : start web server -->
- <target name="start-standalone">
- <echo>Start server</echo>
-
- <chmod perm="777" type="file">
- <fileset dir="${tmpdir}/sonar-${runtimeVersion}/bin">
- <include name="**/*"/>
- </fileset>
- </chmod>
-
- <condition property="windows">
- <os family="windows"/>
- </condition>
-
- <antcall target="start-standalone-windows" />
- <antcall target="start-standalone-unix" />
- </target>
-
- <target name="start-standalone-windows" if="windows">
-<!-- <condition property="sonar.command" value="restart" else="console">
- <istrue value="${background}"/>
- </condition>-->
- <exec executable="${tmpdir}/sonar-${runtimeVersion}/${sonar.bin.path}">
- <env key="sonar.jdbc.url" value="${jdbcUrl}"/>
- <env key="sonar.jdbc.driverClassName" value="${jdbcDriver}"/>
- <env key="sonar.jdbc.username" value="${jdbcUsername}"/>
- <env key="sonar.jdbc.password" value="${jdbcPassword}"/>
- </exec>
- </target>
-
- <target name="start-standalone-unix" unless="windows">
- <condition property="sonar.command" value="restart" else="console">
- <istrue value="${background}"/>
- </condition>
- <exec executable="${tmpdir}/sonar-${runtimeVersion}/${sonar.bin.path}">
- <arg line="${sonar.command}"/>
- <env key="sonar.jdbc.url" value="${jdbcUrl}"/>
- <env key="sonar.jdbc.driverClassName" value="${jdbcDriver}"/>
- <env key="sonar.jdbc.username" value="${jdbcUsername}"/>
- <env key="sonar.jdbc.password" value="${jdbcPassword}"/>
- </exec>
- </target>
-
- <target name="stop-standalone">
- <exec executable="${tmpdir}/sonar-${runtimeVersion}/${sonar.bin.path}">
- <arg line="stop"/>
- </exec>
- </target>
-
-
- <target name="start-tomcat">
- <echo>Build WAR</echo>
- <ant dir="${tmpdir}/sonar-${runtimeVersion}/war/" inheritAll="false"/>
-
- <mkdir dir="${tomcat6.home}"/>
- <mkdir dir="${tmpdir}/sonar-${runtimeVersion}/logs"/>
-
- <condition property="sonar.wait" value="true" else="false">
- <isfalse value="${background}"/>
- </condition>
- <echo>Start tomcat, background mode: ${background}</echo>
-
- <cargo containerId="tomcat6x" action="start" wait="${sonar.wait}" id="tmptmct6-${runtimeVersion}"
- output="${tmpdir}/sonar-${runtimeVersion}/logs/output.log"
- log="${tmpdir}/sonar-${runtimeVersion}/logs/cargo.log">
- <zipurlinstaller
- installurl="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.zip"/>
- <configuration type="standalone" home="${tomcat6.home}">
- <property name="cargo.jvmargs"
- value="-Xmx1024m -XX:MaxPermSize=256m -server -Dsonar.jdbc.url=${jdbcUrl} -Dsonar.jdbc.driverClassName=${jdbcDriver} -Dsonar.jdbc.username=${jdbcUsername} -Dsonar.jdbc.password=${jdbcPassword}"/>
- <property name="cargo.servlet.port" value="9000"/>
- <property name="cargo.remote.username" value="admin"/>
- <property name="cargo.remote.password" value=""/>
- <deployable type="war" file="${tmpdir}/sonar-${runtimeVersion}/war/sonar.war">
- <property name="context" value="ROOT"/>
- </deployable>
- </configuration>
- </cargo>
- <antcall target="wait-for-server"/>
- </target>
-
- <target name="stop-tomcat">
- <echo>Stopping tomcat</echo>
- <cargo containerId="tomcat6x" action="stop" wait="true" id="tmptmct6-${runtimeVersion}">
- <zipurlinstaller
- installurl="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.zip"/>
- <configuration type="standalone" home="${tomcat6.home}">
- <property name="cargo.jvmargs" value="-Xmx512m -server"/>
- <property name="cargo.servlet.port" value="9000"/>
- <property name="cargo.remote.username" value="admin"/>
- <property name="cargo.remote.password" value=""/>
- </configuration>
- </cargo>
- </target>
-
- <!-- STEP 4 : setup sonar -->
-
- <target name="wait-for-server">
- <waitfor maxwait="5" maxwaitunit="minute" checkevery="10" checkeveryunit="second">
- <http url="http://localhost:9000"/>
- </waitfor>
- <echo>Sonar started</echo>
- </target>
-
- <target name="setup" depends="wait-for-server">
- <httppost url="http://localhost:9000/setup/setup_database" logLevel="none"/>
- <echo message="Database is up."/>
-
- <condition property="execute.restore.backup" value="true">
- <isset property="configBackup"/>
- </condition>
- <antcall target="restore-backup"/>
- </target>
-
-
- <target name="restore-backup" if="execute.restore.backup">
- <echo message="Restoring sonar backup"/>
-
- <httppost url="http://localhost:9000/sessions/login" logLevel="none">
- <post name="login" value="admin"/>
- <post name="password" value="admin"/>
- </httppost>
- <echo message="Logged in."/>
-
- <httpmpost url="http://localhost:9000/backup/import" logLevel="none">
- <postFile name="file" file="${configBackup}"/>
- </httpmpost>
- <echo message="Backup is restored."/>
- </target>
-
-
- <!-- STEP 5 : analyze projects -->
-
- <target name="analyze" depends="expand-database-profile">
- <for param="pom">
- <path>
- <fileset dir="${projectsDir}" includes="*/pom.xml"/>
- </path>
- <sequential>
- <mvn pom="@{pom}" failonerror="false" args="clean install -DskipTests"/>
- <mvnsonar pom="@{pom}"/>
- </sequential>
- </for>
- </target>
-
-
- <macrodef name="mvn">
- <attribute name="failonerror" default="true"/>
- <attribute name="pom"/>
- <attribute name="args" default=""/>
-
- <sequential>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn.bat" osfamily="Windows">
- <arg line="-f @{pom}"/>
- <arg line="@{args}"/>
- </exec>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn" osfamily="unix">
- <arg line="-f @{pom}"/>
- <arg line="@{args} "/>
- </exec>
- </sequential>
- </macrodef>
-
- <macrodef name="mvnsonar">
- <attribute name="failonerror" default="true"/>
- <attribute name="args" default=""/>
- <attribute name="pom"/>
-
- <sequential>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn.bat" osfamily="Windows">
- <arg line="sonar:sonar @{args} -B -e"/>
- <arg line="-f @{pom}"/>
- <arg value='-Dsonar.jdbc.url="${jdbcUrl}"'/>
- <!-- double quotes for windows -->
- <arg value="-Dsonar.jdbc.driver=${jdbcDriver}"/>
- <arg value="-Dsonar.jdbc.username=${jdbcUsername}"/>
- <arg value="-Dsonar.jdbc.password=${jdbcPassword}"/>
- </exec>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn" osfamily="unix">
- <arg line="sonar:sonar @{args} -B -e"/>
- <arg line="-f @{pom}"/>
- <arg value='-Dsonar.jdbc.url=${jdbcUrl}'/>
- <arg value="-Dsonar.jdbc.driver=${jdbcDriver}"/>
- <arg value="-Dsonar.jdbc.username=${jdbcUsername}"/>
- <arg value="-Dsonar.jdbc.password=${jdbcPassword}"/>
- </exec>
- </sequential>
- </macrodef>
-
- <macrodef name="mvninstall">
- <attribute name="failonerror" default="false"/>
- <attribute name="groupId"/>
- <attribute name="artifactId"/>
- <attribute name="version"/>
- <attribute name="packaging" default="jar"/>
- <attribute name="file"/>
-
- <sequential>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn.bat" osfamily="Windows">
- <arg
- line="install:install-file -DgroupId=@{groupId} -DartifactId=@{artifactId} -Dversion=@{version} -Dpackaging=@{packaging} -Dfile=@{file}"/>
- </exec>
- <exec failonerror="@{failonerror}" executable="${mavenHome}/bin/mvn" osfamily="unix">
- <arg
- line="install:install-file -DgroupId=@{groupId} -DartifactId=@{artifactId} -Dversion=@{version} -Dpackaging=@{packaging} -Dfile=@{file}"/>
- </exec>
- </sequential>
- </macrodef>
-</project>
diff --git a/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.mojos.xml b/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.mojos.xml
deleted file mode 100644
index 22c7978f48c..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/main/scripts/dev.mojos.xml
+++ /dev/null
@@ -1,417 +0,0 @@
-<pluginMetadata>
- <mojos>
- <mojo>
- <goal>start</goal>
- <description>Start Sonar.</description>
- <call>start</call>
- <requiresProject>false</requiresProject>
- <parameters>
- <parameter>
- <name>runtimeVersion</name>
- <description>Sonar version.</description>
- <property>runtimeVersion</property>
- <expression>${sonar.runtimeVersion}</expression>
- <required>true</required>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>database</name>
- <description>Database profile: [derby, mssql, mysql, oracle, postgresql].</description>
- <property>database</property>
- <required>false</required>
- <expression>${sonar.database}</expression>
- <type>java.lang.String</type>
- <defaultValue>derby</defaultValue>
- </parameter>
- <parameter>
- <name>dropDatabase</name>
- <description>Set to true to drop database.</description>
- <property>dropDatabase</property>
- <expression>${sonar.dropDatabase}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>false</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcUrl</name>
- <description>Database URL.</description>
- <property>jdbcUrl</property>
- <required>false</required>
- <expression>${sonar.jdbc.url}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcDriver</name>
- <description>Database driver.</description>
- <property>jdbcDriver</property>
- <required>false</required>
- <expression>${sonar.jdbc.driver}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootUsername</name>
- <description>Database root username. Used when dropDatabase is true.</description>
- <property>jdbcRootUsername</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootUsername}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootPassword</name>
- <description>Database root password. Used when dropDatabase is true.</description>
- <property>jdbcRootPassword</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootPassword}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootUrl</name>
- <description>Database root URL. Used when dropDatabase is true.</description>
- <property>jdbcRootUrl</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootUrl}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcUsername</name>
- <description>Database username.</description>
- <property>jdbcUsername</property>
- <required>false</required>
- <expression>${sonar.jdbc.username}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcPassword</name>
- <description>Database password.</description>
- <property>jdbcPassword</property>
- <required>false</required>
- <expression>${sonar.jdbc.password}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>pluginArtifact</name>
- <description>Plugin to install.</description>
- <property>pluginArtifact</property>
- <expression>${sonar.pluginArtifact}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- <defaultValue>${project.build.directory}/${project.build.finalName}.jar</defaultValue>
- </parameter>
- <parameter>
- <name>copyPluginArtifact</name>
- <description>Should copy plugin artifact in Sonar plugins ?</description>
- <property>copyPluginArtifact</property>
- <expression>${sonar.copyPluginArtifact}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>true</defaultValue>
- </parameter>
- <parameter>
- <name>extensionsDir</name>
- <description>Directory from where extensions should be copied.</description>
- <property>extensionsDir</property>
- <expression>${sonar.extensionsDir}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- <defaultValue>${project.build.directory}/extensions</defaultValue>
- </parameter>
- <parameter>
- <name>background</name>
- <description>Set to true to run Sonar in background mode.</description>
- <property>background</property>
- <expression>${sonar.background}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>false</defaultValue>
- </parameter>
- <parameter>
- <name>clean</name>
- <description>Set to false to prevent clean installation.</description>
- <property>clean</property>
- <expression>${sonar.clean}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>true</defaultValue>
- </parameter>
- <parameter>
- <name>localRepository</name>
- <description>Local Maven repository.</description>
- <property>localRepository</property>
- <expression>${settings.localRepository}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- </parameter>
- <parameter>
- <name>configBackup</name>
- <description>File from where Sonar configuration should be restored.</description>
- <property>configBackup</property>
- <expression>${sonar.configBackup}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- </parameter>
- </parameters>
- </mojo>
-
- <mojo>
- <goal>stop</goal>
- <description>Stop Sonar.</description>
- <call>stop</call>
- <requiresProject>false</requiresProject>
- <parameters>
- <parameter>
- <name>runtimeVersion</name>
- <description>Sonar version.</description>
- <property>runtimeVersion</property>
- <required>true</required>
- <type>java.lang.String</type>
- <expression>${sonar.runtimeVersion}</expression>
- </parameter>
- </parameters>
- </mojo>
-
- <mojo>
- <goal>start-war</goal>
- <description>Starts Sonar WAR.</description>
- <call>start-war</call>
- <requiresProject>false</requiresProject>
- <parameters>
- <parameter>
- <name>runtimeVersion</name>
- <description>Sonar version.</description>
- <property>runtimeVersion</property>
- <required>true</required>
- <type>java.lang.String</type>
- <expression>${sonar.runtimeVersion}</expression>
- </parameter>
- <parameter>
- <name>database</name>
- <description>Database profile: [derby, mssql, mysql, oracle, postgresql].</description>
- <property>database</property>
- <required>false</required>
- <expression>${sonar.database}</expression>
- <type>java.lang.String</type>
- <defaultValue>derby</defaultValue>
- </parameter>
- <parameter>
- <name>dropDatabase</name>
- <description>Set to true to drop database.</description>
- <property>dropDatabase</property>
- <expression>${sonar.dropDatabase}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>false</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcUrl</name>
- <description>Database URL.</description>
- <property>jdbcUrl</property>
- <required>false</required>
- <expression>${sonar.jdbc.url}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcDriver</name>
- <description>Database driver.</description>
- <property>jdbcDriver</property>
- <required>false</required>
- <expression>${sonar.jdbc.driver}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootUsername</name>
- <description>Database root username. Used when dropDatabase is true.</description>
- <property>jdbcRootUsername</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootUsername}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootPassword</name>
- <description>Database root password. Used when dropDatabase is true.</description>
- <property>jdbcRootPassword</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootPassword}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcRootUrl</name>
- <description>Database root URL. Used when dropDatabase is true.</description>
- <property>jdbcRootUrl</property>
- <required>false</required>
- <expression>${sonar.jdbc.rootUrl}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcUsername</name>
- <description>Database username.</description>
- <property>jdbcUsername</property>
- <required>false</required>
- <expression>${sonar.jdbc.username}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcPassword</name>
- <description>Database password.</description>
- <property>jdbcPassword</property>
- <required>false</required>
- <expression>${sonar.jdbc.password}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>pluginArtifact</name>
- <description>Plugin to install.</description>
- <property>pluginArtifact</property>
- <expression>${sonar.pluginArtifact}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- <defaultValue>${project.build.directory}/${project.build.finalName}.jar</defaultValue>
- </parameter>
- <parameter>
- <name>copyPluginArtifact</name>
- <description>Should copy plugin artifact in Sonar plugins ?</description>
- <property>copyPluginArtifact</property>
- <expression>${sonar.copyPluginArtifact}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>true</defaultValue>
- </parameter>
- <parameter>
- <name>extensionsDir</name>
- <description>Directory from where extensions should be copied.</description>
- <property>extensionsDir</property>
- <expression>${sonar.extensionsDir}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- <defaultValue>${project.build.directory}/extensions</defaultValue>
- </parameter>
- <parameter>
- <name>background</name>
- <description>Set to true to run Sonar in background mode.</description>
- <property>background</property>
- <expression>${sonar.background}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>false</defaultValue>
- </parameter>
- <parameter>
- <name>clean</name>
- <description>Set to false to prevent clean installation.</description>
- <property>clean</property>
- <expression>${sonar.clean}</expression>
- <required>false</required>
- <type>java.lang.Boolean</type>
- <defaultValue>true</defaultValue>
- </parameter>
- <parameter>
- <name>localRepository</name>
- <description>Local Maven repository.</description>
- <property>localRepository</property>
- <expression>${settings.localRepository}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- </parameter>
- <parameter>
- <name>configBackup</name>
- <description>File from where Sonar configuration should be restored.</description>
- <property>configBackup</property>
- <expression>${sonar.configBackup}</expression>
- <required>false</required>
- <type>java.lang.File</type>
- </parameter>
- </parameters>
- </mojo>
-
- <mojo>
- <goal>stop-war</goal>
- <description>Stops Sonar WAR.</description>
- <call>stop-war</call>
- <requiresProject>false</requiresProject>
- <parameters>
- <parameter>
- <name>runtimeVersion</name>
- <description>Sonar version</description>
- <property>runtimeVersion</property>
- <required>true</required>
- <type>java.lang.String</type>
- <expression>${sonar.runtimeVersion}</expression>
- </parameter>
- </parameters>
- </mojo>
-
-
- <mojo>
- <goal>analyze</goal>
- <description>Analyzes projects using Sonar.</description>
- <call>analyze</call>
- <requiresProject>false</requiresProject>
- <parameters>
- <parameter>
- <name>database</name>
- <description>Database profile: [derby, mssql, mysql, oracle, postgresql].</description>
- <property>database</property>
- <required>false</required>
- <expression>${sonar.database}</expression>
- <type>java.lang.String</type>
- <defaultValue>derby</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcUrl</name>
- <description>Database URL.</description>
- <property>jdbcUrl</property>
- <required>false</required>
- <expression>${sonar.jdbc.url}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcDriver</name>
- <description>Database driver.</description>
- <property>jdbcDriver</property>
- <required>false</required>
- <expression>${sonar.jdbc.driver}</expression>
- <type>java.lang.String</type>
- </parameter>
- <parameter>
- <name>jdbcUsername</name>
- <description>Database username.</description>
- <property>jdbcUsername</property>
- <required>false</required>
- <expression>${sonar.jdbc.username}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>jdbcPassword</name>
- <description>Database password.</description>
- <property>jdbcPassword</property>
- <required>false</required>
- <expression>${sonar.jdbc.password}</expression>
- <type>java.lang.String</type>
- <defaultValue>sonar</defaultValue>
- </parameter>
- <parameter>
- <name>projectsDir</name>
- <description>Directory containing projects.</description>
- <property>projectsDir</property>
- <expression>${sonar.projectsDir}</expression>
- <required>true</required>
- <type>java.lang.File</type>
- <defaultValue>${basedir}</defaultValue>
- </parameter>
- <parameter>
- <name>mavenHome</name>
- <description>Maven home directory.</description>
- <property>mavenHome</property>
- <required>true</required>
- <expression>${sonar.mavenHome}</expression>
- <type>java.lang.File</type>
- <defaultValue>${maven.home}</defaultValue>
- </parameter>
- </parameters>
- </mojo>
-
- </mojos>
-</pluginMetadata> \ No newline at end of file
diff --git a/subprojects/sonar-dev-maven-plugin/src/test/java/org/sonar/dev/TrimMojoTest.java b/subprojects/sonar-dev-maven-plugin/src/test/java/org/sonar/dev/TrimMojoTest.java
deleted file mode 100644
index 92dd604d7ca..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/test/java/org/sonar/dev/TrimMojoTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2009 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * Sonar is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.dev;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertThat;
-import org.junit.Test;
-import static org.junit.matchers.JUnitMatchers.containsString;
-
-import java.io.File;
-import java.io.IOException;
-
-public class TrimMojoTest {
-
- @Test
- public void trimFilesFromDirectory() throws IOException, MojoFailureException, MojoExecutionException {
- File dir = newDir("trimFilesFromDirectory");
- File file1 = copyResourceToDir(1, dir);
- File file2 = copyResourceToDir(2, dir);
-
- TrimMojo mojo = new TrimMojo();
- mojo.setDirectory(dir);
- mojo.execute();
-
- assertTrimmed(file1);
- assertTrimmed(file2);
- }
-
- @Test
- public void excludeSomeFiles() throws IOException, MojoFailureException, MojoExecutionException {
- File dir = newDir("excludeSomeFiles");
- File file1 = copyResourceToDir(1, dir);
- File file2 = copyResourceToDir(2, dir);
-
- TrimMojo mojo = new TrimMojo();
- mojo.setDirectory(dir);
- mojo.setExcludes(new String[]{"**/*-1.txt"});
- mojo.execute();
-
- assertNotTrimmed(file1);
- assertTrimmed(file2);
- }
-
- @Test
- public void trimOnlySomeFiles() throws IOException, MojoFailureException, MojoExecutionException {
- File dir = newDir("trimOnlySomeFiles");
- File file1 = copyResourceToDir(1, dir);
- File file2 = copyResourceToDir(2, dir);
-
- TrimMojo mojo = new TrimMojo();
- mojo.setDirectory(dir);
- mojo.setIncludes(new String[]{"**/*-1.txt"});
- mojo.execute();
-
- assertTrimmed(file1);
- assertNotTrimmed(file2);
- }
-
- private void assertNotTrimmed(File file) throws IOException {
- String content = FileUtils.readFileToString(file);
- assertThat(content, startsWith(" "));
- assertThat(content, containsString(" "));
- }
-
- private void assertTrimmed(File file) throws IOException {
- String content = FileUtils.readFileToString(file);
- assertThat(content, startsWith("many spaces"));
- assertThat(content, not(containsString(" ")));
- assertThat(content, containsString("white spaces should be kept in the line"));
- }
-
-
- private File copyResourceToDir(int index, File dir) throws IOException {
- File file = new File(dir, "whitespace-indented-" + index + ".txt");
- FileUtils.copyURLToFile(getClass().getResource("/org/sonar/dev/TrimMojoTest/whitespace-indented.txt"), file);
- return file;
- }
-
- private File newDir(String name) throws IOException {
- File dir = new File("target/tmp/org/sonar/dev/TrimMojoTest/" + name);
- FileUtils.forceMkdir(dir);
- FileUtils.cleanDirectory(dir);
- return dir;
- }
-}
diff --git a/subprojects/sonar-dev-maven-plugin/src/test/resources/org/sonar/dev/TrimMojoTest/whitespace-indented.txt b/subprojects/sonar-dev-maven-plugin/src/test/resources/org/sonar/dev/TrimMojoTest/whitespace-indented.txt
deleted file mode 100644
index 5ee36296681..00000000000
--- a/subprojects/sonar-dev-maven-plugin/src/test/resources/org/sonar/dev/TrimMojoTest/whitespace-indented.txt
+++ /dev/null
@@ -1,9 +0,0 @@
- many spaces
- before and after
- white spaces should be kept in the line
-
-
-
-
-
- \ No newline at end of file