diff options
author | David Rautureau <david.rautureau@sonarsource.com> | 2018-02-08 15:01:19 +0100 |
---|---|---|
committer | David Rautureau <david.rautureau@sonarsource.com> | 2018-03-09 11:33:38 +0100 |
commit | 1a17e4302e4b63de6b4ce7c049441803b9471524 (patch) | |
tree | 031bcfbf302c7909c5b45a7c31f1bbc00a2fce34 /server/sonar-server | |
parent | 21fbe3697bdb6e66016ef8d0bea49da574e02e7d (diff) | |
download | sonarqube-1a17e4302e4b63de6b4ce7c049441803b9471524.tar.gz sonarqube-1a17e4302e4b63de6b4ce7c049441803b9471524.zip |
Move To Gradle
Diffstat (limited to 'server/sonar-server')
5 files changed, 99 insertions, 347 deletions
diff --git a/server/sonar-server/build.gradle b/server/sonar-server/build.gradle new file mode 100644 index 00000000000..327e4a3ad86 --- /dev/null +++ b/server/sonar-server/build.gradle @@ -0,0 +1,96 @@ +sonarqube { + properties { + property 'sonar.projectName', "${projectTitle} :: Server" + } +} + +sourceSets { + test { + resources { + srcDirs += ['src/test/projects'] + } + } +} + +dependencies { + // please keep the list grouped by configuration and ordered by name + + compile 'ch.qos.logback:logback-access' + compile 'ch.qos.logback:logback-classic' + compile 'ch.qos.logback:logback-core' + compile 'commons-dbcp:commons-dbcp' + compile 'commons-dbutils:commons-dbutils' + compile 'com.googlecode.java-diff-utils:diffutils' + compile 'com.google.code.gson:gson' + compile 'com.google.protobuf:protobuf-java' + compile 'com.hazelcast:hazelcast-client' + compile 'io.jsonwebtoken:jjwt' + compile 'javax.xml.bind:jaxb-api' + compile 'org.apache.commons:commons-email' + compile 'org.apache.httpcomponents:httpclient' + compile 'org.apache.logging.log4j:log4j-api' + compile 'org.apache.tomcat.embed:tomcat-embed-core' + compile 'org.elasticsearch.client:transport' + compile 'org.picocontainer:picocontainer' + compile 'org.slf4j:jul-to-slf4j' + compile 'org.slf4j:slf4j-api' + compile 'org.sonarsource.update-center:sonar-update-center-common' + + compile project(':server:sonar-db-dao') + compile project(':server:sonar-db-migration') + compile project(':server:sonar-plugin-bridge') + compile project(':server:sonar-process') + compile project(':sonar-core') + compile project(':sonar-scanner-protocol') + compile(project(':sonar-markdown')) { + // already shaded with sonar-plugin-api + exclude group: 'org.codehaus.sonar', module: 'sonar-channel' + } + compile project(path: ':sonar-plugin-api', configuration: 'shadow') + compile project(':sonar-ws') + + compileOnly 'com.google.code.findbugs:jsr305' + // not a transitive dep. At runtime lib/jdbc/h2 is used + compileOnly 'com.h2database:h2' + + testCompile 'com.github.kevinsawicki:http-request' + testCompile 'com.github.tlrx:elasticsearch-test' + testCompile 'com.google.code.findbugs:jsr305' + testCompile 'com.h2database:h2' + testCompile 'com.squareup.okhttp3:mockwebserver' + testCompile 'com.tngtech.java:junit-dataprovider' + testCompile 'junit:junit' + testCompile 'org.apache.logging.log4j:log4j-api' + testCompile 'org.apache.logging.log4j:log4j-core' + testCompile 'org.assertj:assertj-core' + testCompile 'org.assertj:assertj-guava' + testCompile("org.elasticsearch.test:framework:${elasticsearchVersion}") { + // should be excluded to avoid ES go into "test mode" and require to run EsTester-based UTs with RandomizedRunner + exclude group: 'com.carrotsearch.randomizedtesting', module: 'randomizedtesting-runner' + exclude group: 'org.elasticsearch', module: 'securemock' + } + testCompile 'org.hamcrest:hamcrest-all' + testCompile 'org.mockito:mockito-core' + testCompile 'org.reflections:reflections' + testCompile 'org.subethamail:subethasmtp' + testCompile project(':server:sonar-db-testing') +} + +task testJar(type: Jar) { + classifier = 'tests' + from sourceSets.test.output +} + +artifactoryPublish.skip = false + +// Used by core plugins +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifact testJar + artifact sourcesJar + artifact javadocJar + } + } +} diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml deleted file mode 100644 index c9b9bd499fb..00000000000 --- a/server/sonar-server/pom.xml +++ /dev/null @@ -1,344 +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> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>server</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>..</relativePath> - </parent> - <artifactId>sonar-server</artifactId> - <name>SonarQube :: Server</name> - - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jul-to-slf4j</artifactId> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-access</artifactId> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-core</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-core</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-db-dao</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-db-migration</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-scanner-protocol</artifactId> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-markdown</artifactId> - <exclusions> - <exclusion> - <!-- already shaded with sonar-plugin-api --> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-channel</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-process</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${project.version}</version> - <exclusions> - <exclusion> - <!-- not used at runtime --> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-dependency-tree</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-common-artifact-filters</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-ws</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-plugin-bridge</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.sonarsource.update-center</groupId> - <artifactId>sonar-update-center-common</artifactId> - </dependency> - <dependency> - <groupId>commons-dbutils</groupId> - <artifactId>commons-dbutils</artifactId> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-email</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.googlecode.java-diff-utils</groupId> - <artifactId>diffutils</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>org.picocontainer</groupId> - <artifactId>picocontainer</artifactId> - </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.5.2</version> - </dependency> - <dependency> - <groupId>org.elasticsearch.client</groupId> - <artifactId>transport</artifactId> - <version>${elasticsearch.version}</version> - </dependency> - <dependency> - <groupId>org.elasticsearch.test</groupId> - <artifactId>framework</artifactId> - <version>${elasticsearch.version}</version> - <scope>test</scope> - <exclusions> - <!--should be excluded to avoid ES go into "test mode" and require to run EsTester-based UTs with RandomizedRunner--> - <exclusion> - <groupId>com.carrotsearch.randomizedtesting</groupId> - <artifactId>randomizedtesting-runner</artifactId> - </exclusion> - <exclusion> - <groupId>org.elasticsearch</groupId> - <artifactId>securemock</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.hazelcast</groupId> - <artifactId>hazelcast-client</artifactId> - </dependency> - <dependency> - <groupId>com.google.protobuf</groupId> - <artifactId>protobuf-java</artifactId> - </dependency> - <dependency> - <groupId>javax.xml.bind</groupId> - <artifactId>jaxb-api</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>io.jsonwebtoken</groupId> - <artifactId>jjwt</artifactId> - </dependency> - - <!-- unit tests --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-guava</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <!-- TODO to be removed --> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-all</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>sonar-db-testing</artifactId> - <type>pom</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.github.tlrx</groupId> - <artifactId>elasticsearch-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.tngtech.java</groupId> - <artifactId>junit-dataprovider</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.github.kevinsawicki</groupId> - <artifactId>http-request</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.reflections</groupId> - <artifactId>reflections</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.subethamail</groupId> - <artifactId>subethasmtp</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>mockwebserver</artifactId> - <scope>test</scope> - </dependency> - - </dependencies> - - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - <includes> - <include>build.properties</include> - </includes> - </resource> - <resource> - <directory>src/main/resources</directory> - <filtering>false</filtering> - <excludes> - <exclude>build.properties</exclude> - </excludes> - </resource> - </resources> - <testResources> - <testResource> - <directory>src/test/resources</directory> - <filtering>false</filtering> - </testResource> - <testResource> - <directory>src/test/projects</directory> - <filtering>false</filtering> - </testResource> - </testResources> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - <configuration> - <excludes> - <exclude>logback-test.xml</exclude> - </excludes> - </configuration> - </execution> - </executions> - <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>org.sonar.server.app.App</mainClass> - </manifest> - </archive> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <!--see https://discuss.elastic.co/t/migrate-elasticsearch-java-api-to-version-5-in-spring-io-platform-application/72661--> - <classpathDependencyExcludes> - <classpathDependencyExcludes>org.apache.logging.log4j:log4j-to-slf4j</classpathDependencyExcludes> - </classpathDependencyExcludes> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java b/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java index f9408af6976..b6569cdaf91 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java @@ -19,7 +19,7 @@ */ package org.sonar.ce.log; -import org.apache.log4j.MDC; +import org.slf4j.MDC; import org.sonar.ce.queue.CeTask; public class CeLogging { diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java b/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java index 4992c82be62..0d53ec3bb5b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java @@ -61,6 +61,7 @@ class EmbeddedTomcat { tomcat.start(); new TomcatStartupLogs(Loggers.get(getClass())).log(tomcat); } catch (LifecycleException e) { + Loggers.get(EmbeddedTomcat.class).error("Fail to start web server", e); Throwables.propagate(e); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java b/server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java index ff85a78bac9..319bb38f0bf 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java @@ -32,7 +32,6 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.index.reindex.ReindexPlugin; import org.elasticsearch.join.ParentJoinPlugin; import org.elasticsearch.percolator.PercolatorPlugin; import org.elasticsearch.transport.Netty4Plugin; @@ -103,7 +102,7 @@ public class EsClientProvider extends ProviderAdapter { static class MinimalTransportClient extends TransportClient { MinimalTransportClient(Settings settings) { - super(settings, unmodifiableList(Arrays.asList(Netty4Plugin.class, ReindexPlugin.class, PercolatorPlugin.class, ParentJoinPlugin.class))); + super(settings, unmodifiableList(Arrays.asList(Netty4Plugin.class, PercolatorPlugin.class, ParentJoinPlugin.class))); } @Override |