Browse Source

Move To Gradle

tags/7.5
David Rautureau 6 years ago
parent
commit
1a17e4302e
100 changed files with 2088 additions and 5240 deletions
  1. 3
    4
      .gitignore
  2. 6
    7
      .travis.yml
  3. 296
    0
      build.gradle
  4. 1
    3
      build.sh
  5. 15
    53
      cix.sh
  6. 0
    17
      cve-false-positives.xml
  7. 0
    7
      find-classpath-conflicts.sh
  8. 0
    4
      format-headers.sh
  9. 4
    0
      gradle.properties
  10. BIN
      gradle/wrapper/gradle-wrapper.jar
  11. 5
    0
      gradle/wrapper/gradle-wrapper.properties
  12. 172
    0
      gradlew
  13. 84
    0
      gradlew.bat
  14. 3
    0
      plugins/build.gradle
  15. 44
    0
      plugins/sonar-xoo-plugin/build.gradle
  16. 0
    75
      plugins/sonar-xoo-plugin/pom.xml
  17. 0
    1554
      pom.xml
  18. 0
    44
      quick-build.sh
  19. 6
    4
      run-db-unit-tests.sh
  20. 4
    8
      run-integration-tests.sh
  21. 5
    2
      run-perf-tests.sh
  22. 4
    4
      run-upgrade-tests.sh
  23. 1
    1
      scripts/logs.sh
  24. 3
    3
      scripts/start.sh
  25. 5
    0
      server/build.gradle
  26. 0
    59
      server/pom.xml
  27. 24
    0
      server/sonar-ce/build.gradle
  28. 0
    68
      server/sonar-ce/pom.xml
  29. 3
    3
      server/sonar-ce/src/main/java/org/sonar/ce/queue/InternalCeQueueImpl.java
  30. 71
    0
      server/sonar-db-core/build.gradle
  31. 0
    197
      server/sonar-db-core/pom.xml
  32. 49
    0
      server/sonar-db-core/src/test/java/org/sonar/db/CreateDb.java
  33. 51
    0
      server/sonar-db-dao/build.gradle
  34. 0
    109
      server/sonar-db-dao/pom.xml
  35. 42
    0
      server/sonar-db-migration/build.gradle
  36. 0
    76
      server/sonar-db-migration/pom.xml
  37. 15
    0
      server/sonar-db-testing/build.gradle
  38. 0
    46
      server/sonar-db-testing/pom.xml
  39. 30
    0
      server/sonar-main/build.gradle
  40. 0
    120
      server/sonar-main/pom.xml
  41. 2
    5
      server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java
  42. 8
    8
      server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java
  43. 27
    0
      server/sonar-plugin-bridge/build.gradle
  44. 0
    29
      server/sonar-plugin-bridge/pom.xml
  45. 49
    0
      server/sonar-process/build.gradle
  46. 0
    96
      server/sonar-process/pom.xml
  47. 29
    0
      server/sonar-qa-util/build.gradle
  48. 0
    51
      server/sonar-qa-util/pom.xml
  49. 1
    1
      server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/SelenideConfig.java
  50. 96
    0
      server/sonar-server/build.gradle
  51. 0
    344
      server/sonar-server/pom.xml
  52. 1
    1
      server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java
  53. 1
    0
      server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java
  54. 1
    2
      server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java
  55. 44
    0
      server/sonar-web/build.gradle
  56. 0
    256
      server/sonar-web/pom.xml
  57. 61
    0
      settings.gradle
  58. 0
    19
      sonar-application/assembly-common.xml
  59. 0
    213
      sonar-application/assembly.xml
  60. 148
    0
      sonar-application/build.gradle
  61. 0
    271
      sonar-application/pom.xml
  62. 1
    0
      sonar-application/src/main/assembly/logs/README.txt
  63. 11
    0
      sonar-check-api/build.gradle
  64. 0
    26
      sonar-check-api/pom.xml
  65. 53
    0
      sonar-core/build.gradle
  66. 0
    166
      sonar-core/pom.xml
  67. 18
    0
      sonar-duplications/build.gradle
  68. 0
    73
      sonar-duplications/pom.xml
  69. 28
    0
      sonar-home/build.gradle
  70. 0
    52
      sonar-home/pom.xml
  71. 28
    0
      sonar-markdown/build.gradle
  72. 0
    44
      sonar-markdown/pom.xml
  73. 39
    0
      sonar-plugin-api-deps/build.gradle
  74. 0
    231
      sonar-plugin-api-deps/pom.xml
  75. 82
    0
      sonar-plugin-api/build.gradle
  76. 0
    282
      sonar-plugin-api/pom.xml
  77. 1
    1
      sonar-plugin-api/src/main/resources/sonar-api-version.txt
  78. 1
    1
      sonar-plugin-api/src/main/resources/sq-version.txt
  79. 11
    0
      sonar-scanner-engine-shaded/build.gradle
  80. 0
    65
      sonar-scanner-engine-shaded/pom.xml
  81. 63
    0
      sonar-scanner-engine/build.gradle
  82. 0
    165
      sonar-scanner-engine/pom.xml
  83. 34
    0
      sonar-scanner-protocol/build.gradle
  84. 0
    104
      sonar-scanner-protocol/pom.xml
  85. 29
    0
      sonar-testing-harness/build.gradle
  86. 0
    47
      sonar-testing-harness/pom.xml
  87. 1
    1
      sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java
  88. 23
    0
      sonar-ws-generator/build.gradle
  89. 0
    88
      sonar-ws-generator/pom.xml
  90. 6
    4
      sonar-ws-generator/run.sh
  91. 5
    4
      sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/ApiDefinitionDownloader.java
  92. 1
    1
      sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/Helper.java
  93. 39
    0
      sonar-ws/build.gradle
  94. 0
    82
      sonar-ws/pom.xml
  95. 1
    1
      stop.sh
  96. 149
    0
      tests/build.gradle
  97. 19
    0
      tests/plugins/access-secured-props-plugin/build.gradle
  98. 0
    38
      tests/plugins/access-secured-props-plugin/pom.xml
  99. 31
    0
      tests/plugins/backdating-customplugin/build.gradle
  100. 0
    0
      tests/plugins/backdating-customplugin/pom.xml

+ 3
- 4
.gitignore View File

@@ -7,14 +7,13 @@ server/sonar-web/src/main/webapp/WEB-INF/log/
server/sonar-web/src/main/webapp/deploy/*.jar
server/sonar-web/src/main/webapp/deploy/jdbc-driver.txt

# ---- Gradle
build/
.gradle/

# ---- Javadoc
docs.tar

# ---- Maven
target/
dependency-reduced-pom.xml

# ---- IntelliJ IDEA
*.iws
*.iml

+ 6
- 7
.travis.yml View File

@@ -14,17 +14,16 @@ matrix:

cache:
directories:
- $HOME/.m2/repository
- $HOME/.sonar
- server/sonar-web/node
- server/sonar-web/node_modules
- $HOME/jvm
- $HOME/maven
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

before_cache:
# remove all the artifacts (JAR, ZIP) that are installed in local repo because of mvn deploy
- rm -rf $HOME/.m2/repository/org/sonarsource/sonarqube
- find $HOME/.m2 -name resolver-status.properties -exec rm {} \;
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -fr $HOME/.gradle/caches/*/fileHashes/
- rm -fr $HOME/.gradle/caches/*/scripts/

notifications:
email: false

+ 296
- 0
build.gradle View File

@@ -0,0 +1,296 @@
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
// check updates with https://plugins.gradle.org/
// Ordered alphabeticly to avoid duplication
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.4'
classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0'
classpath 'io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.6.2'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2'
}
}

// Analyze SonarQube with SonarQube!
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property 'sonar.projectName', projectTitle
}
}

allprojects {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'

// Replaces the version defined in sources, usually x.y-SNAPSHOT, by a version identifying the build.
def buildNumber = System.getProperty("buildNumber")
if (version.endsWith('-SNAPSHOT') && buildNumber != null) {
version = version.replace('-SNAPSHOT', ".0.$buildNumber")
}

ext {
release = project.hasProperty('release') && project.getProperty('release')
}

repositories {
def repository = project.hasProperty('cix') ? 'sonarsource-qa' : 'sonarsource'
maven {
url "https://repox.sonarsource.com/${repository}"
def artifactoryUsername = System.env.'ARTIFACTORY_PRIVATE_USERNAME'
def artifactoryPassword = System.env.'ARTIFACTORY_PRIVATE_PASSWORD'
if (artifactoryUsername && artifactoryPassword) {
credentials {
username artifactoryUsername
password artifactoryPassword
}
}
}
}
}

subprojects {
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
// protobuf must be applied after java
apply plugin: 'com.google.protobuf'
apply plugin: "jacoco"
apply plugin: 'idea'

// do not deploy to Artifactory by default
artifactoryPublish.skip = true

ext {
elasticsearchVersion = '5.6.3'
protobufVersion = '3.5.1'
}

sonarqube {
properties {
property 'sonar.moduleKey', project.group + ':' + project.name
}
}

// Central place for definition dependency versions and exclusions.
dependencyManagement {
dependencies {
// please keep this list alphabetically ordered
dependencySet(group: 'ch.qos.logback', version: '1.2.3') {
entry 'logback-access'
entry 'logback-classic'
entry 'logback-core'
}
dependency('commons-beanutils:commons-beanutils:1.8.3') {
exclude 'commons-logging:commons-logging'
}
dependency 'commons-codec:commons-codec:1.8'
dependency 'commons-dbcp:commons-dbcp:1.4'
dependency 'commons-dbutils:commons-dbutils:1.5'
dependency 'commons-io:commons-io:2.4'
dependency 'commons-lang:commons-lang:2.6'
dependencySet(group: 'com.fasterxml.jackson.core', version: '2.6.6') {
entry 'jackson-core'
entry 'jackson-databind'
entry 'jackson-annotations'
}
dependency 'com.github.kevinsawicki:http-request:5.4.1'
dependency 'com.github.tlrx:elasticsearch-test:1.2.1'
dependency 'com.googlecode.java-diff-utils:diffutils:1.2'
dependency('com.googlecode.json-simple:json-simple:1.1.1') {
exclude 'junit:junit'
}
dependency 'com.google.code.findbugs:jsr305:3.0.2'
dependency 'com.google.code.gson:gson:2.3.1'
dependency 'com.google.guava:guava:18.0'
dependency "com.google.protobuf:protobuf-java:${protobufVersion}"
dependency 'com.h2database:h2:1.3.176'
dependencySet(group: 'com.hazelcast', version: '3.8.6') {
entry 'hazelcast'
entry 'hazelcast-client'
}
dependency 'com.ibm.icu:icu4j:3.4.4'
dependency 'com.microsoft.sqlserver:mssql-jdbc:6.2.2.jre8'
dependency 'com.oracle.jdbc:ojdbc8:12.2.0.1.0'
dependencySet(group: 'com.squareup.okhttp3', version: '3.7.0') {
entry 'okhttp'
entry 'mockwebserver'
}
dependency 'com.tngtech.java:junit-dataprovider:1.9.2'
dependency 'io.jsonwebtoken:jjwt:0.9.0'
dependency 'javax.servlet:javax.servlet-api:3.0.1'
dependency 'javax.xml.bind:jaxb-api:2.3.0'
dependency 'junit:junit:4.12'
dependency 'mysql:mysql-connector-java:5.1.42'
dependency 'net.jpountz.lz4:lz4:1.3.0'
dependency 'org.apache.commons:commons-csv:1.4'
dependency 'org.apache.commons:commons-email:1.5'
dependency('org.apache.httpcomponents:httpclient:4.5.2'){
exclude 'commons-logging:commons-logging'
}
// Be aware that Log4j is used by Elasticsearch client
dependencySet(group: 'org.apache.logging.log4j', version: '2.8.2') {
entry 'log4j-api'
entry 'log4j-to-slf4j'
entry 'log4j-core'
}
dependencySet(group: 'org.apache.tomcat.embed', version: '8.5.23') {
entry 'tomcat-embed-core'
entry('tomcat-embed-jasper') {
exclude 'org.eclipse.jdt.core.compiler:ecj'
}
}
dependency 'org.assertj:assertj-core:3.9.0'
dependency 'org.assertj:assertj-guava:3.1.0'
dependency('org.codehaus.sonar:sonar-channel:4.1') {
exclude 'org.slf4j:slf4j-api'
}
dependency 'org.codehaus.sonar:sonar-classloader:1.0'
dependency('org.codehaus.woodstox:woodstox-core-lgpl:4.4.0') {
exclude 'javax.xml.stream:stax-api'
}
dependency 'org.codehaus.sonar.runner:sonar-runner-api:2.4'
dependency('org.codehaus.sonar:sonar-squid:4.1') {
exclude 'org.codehaus.sonar:sonar-check-api'
}
dependency('org.codehaus.staxmate:staxmate:2.0.1') {
exclude 'org.codehaus.woodstox:stax2-api'
exclude 'stax:stax-api'
exclude 'org.codehaus.woodstox:woodstox-core-asl'
}
dependency('org.codehaus.woodstox:stax2-api:3.1.4') {
exclude 'stax:stax-api'
}
dependency('org.dbunit:dbunit:2.4.5') {
exclude 'commons-lang:commons-lang'
exclude 'xerces:xmlParserAPIs'
exclude 'xerces:xercesImpl'
}
dependency 'org.eclipse.jetty:jetty-server:8.1.12.v20130726'
dependency 'org.eclipse.jetty:test-jetty-servlet:8.1.12.v20130726'
dependency("org.elasticsearch.client:transport:${elasticsearchVersion}") {
exclude 'org.elasticsearch.plugin:lang-mustache-client'
exclude 'org.elasticsearch.plugin:transport-netty3-client'
exclude 'commons-logging:commons-logging'
exclude 'org.elasticsearch.plugin:reindex-client'
}
dependency 'org.freemarker:freemarker:2.3.20'
dependency 'org.hamcrest:hamcrest-all:1.3'
dependency('org.mockito:mockito-core:2.13.0') {
exclude 'org.hamcrest:hamcrest-core'
}
dependency 'org.mybatis:mybatis:3.4.4'
dependency 'org.nanohttpd:nanohttpd:2.3.0'
dependency 'org.picocontainer:picocontainer:2.15'
dependencySet(group: 'org.slf4j', version: '1.7.25') {
entry 'slf4j-api'
entry 'jul-to-slf4j'
entry 'log4j-over-slf4j'
}
dependency 'org.postgresql:postgresql:42.2.1'
dependency 'org.reflections:reflections:0.9.9'
dependency 'org.simpleframework:simple:4.1.21'
dependency 'org.sonarsource.orchestrator:sonar-orchestrator:3.16.1.1446'
dependency('org.sonarsource:sonar-persistit:3.3.2') {
exclude 'commons-logging:commons-logging'
}
dependency 'org.sonarsource.update-center:sonar-update-center-common:1.18.0.487'
dependency 'org.subethamail:subethasmtp:3.1.7'
dependency 'xml-apis:xml-apis:1.4.01'

// please keep this list alphabetically ordered
}
}

sourceCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

test {
systemProperty 'java.awt.headless', true
jacoco.enabled = project.hasProperty('jacocoEnabled')
testLogging {
exceptionFormat 'full' // log the full stack trace (default is the 1st line of the stack trace)
events "skipped", "failed" // verbose log for failed and skipped tests (by default the name of the tests are not logged)
}
}

def protoMainSrc = 'src/main/protobuf'
def protoTestSrc = 'src/test/protobuf'
if (file(protoMainSrc).exists() || file(protoTestSrc).exists()) {
sourceSets.main.proto.srcDir protoMainSrc // in addition to the default 'src/main/proto'
sourceSets.test.proto.srcDir protoTestSrc // in addition to the default 'src/test/proto'
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
}
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
testSourceDirs += file("${protobuf.generatedFilesBaseDir}/test/java")
}
}
}

if (release) {
jar {
// do not break incremental build on non-release versions
manifest {
attributes(
'Version': "${version}",
'Implementation-Build': 'git rev-parse HEAD'.execute().text.trim(),
'Build-Time': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
}
}
}

artifactory {
clientConfig.setIncludeEnvVars(true)
clientConfig.setEnvVarsExcludePatterns('*password*,*PASSWORD*,*secret*,*MAVEN_CMD_LINE_ARGS*,sun.java.command,*token*,*TOKEN*,*LOGIN*,*login*')
contextUrl = System.getenv('ARTIFACTORY_URL')
publish {
repository {
repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO')
username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME')
password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD')
}
defaults {
properties = [
'vcs.revision': System.getenv('GIT_COMMIT'),
'vcs.branch': System.getenv('GIT_BRANCH'),
'build.name': 'sonarqube',
'build.number': (System.getenv('BUILD_ID') ?: System.getenv('BUILD_NUMBER'))
]
publications('mavenJava')
publishPom = true
publishIvy = false
}
}
clientConfig.info.setBuildNumber(System.getenv('BUILD_NUMBER'))
// Define the artifacts to be deployed to https://sonarsource.bintray.com on releases
clientConfig.info.addEnvironmentProperty('ARTIFACTS_TO_PUBLISH', "${project.group}:sonar-application:zip")
// The name of this variable is important because it's used by the delivery process when extracting version from Artifactory build info.
clientConfig.info.addEnvironmentProperty('PROJECT_VERSION', "${version}")
}

+ 1
- 3
build.sh View File

@@ -2,6 +2,4 @@

./stop.sh

# Parallel executions of maven modules and tests.
# Half of CPU core are used in to keep other half for OS and other programs.
mvn clean install -e -B -T0.5C -DforkCount=0.5C $*
./gradlew build $*

+ 15
- 53
cix.sh View File

@@ -3,16 +3,20 @@

set -euo pipefail

REPOX_ARGS="-Dorchestrator.artifactory.apiKey=$REPOX_API_KEY -Dorchestrator.artifactory.repositories=sonarsource-qa"
TEST_ARGS="-Pcix=true -DbuildNumber=$CI_BUILD_NUMBER $REPOX_ARGS"

case "$RUN_ACTIVITY" in

run-db-unit-tests-*)
DB_ENGINE=$(sed "s/run-db-unit-tests-//g" <<< $RUN_ACTIVITY)
./run-db-unit-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties"
./run-db-unit-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties" \
${TEST_ARGS}
;;

run-db-integration-tests-*)
DB_ENGINE=$(sed "s/run-db-integration-tests-//g" <<< $RUN_ACTIVITY | cut -d \- -f 1)
CATEGORY_GROUP=$(sed "s/run-db-integration-tests-//g" <<< $RUN_ACTIVITY | cut -d \- -f 2)
CATEGORY=$(sed "s/run-db-integration-tests-//g" <<< $RUN_ACTIVITY | cut -d \- -f 2)

if [[ "$GITHUB_BRANCH" != "PULLREQUEST-"* ]] && [[ "$GITHUB_BRANCH" != "master" ]] && [[ "$GITHUB_BRANCH" != "branch-"* ]] && [[ "$GITHUB_BRANCH" != "dogfood-on-next" ]]; then
# do not execute QA tests on feature branch outside pull request
@@ -27,70 +31,28 @@ case "$RUN_ACTIVITY" in
exit 0

else
mvn clean package -B -e -V -f tests/plugins/pom.xml

case "$CATEGORY_GROUP" in
Category1)
CATEGORY="Category1|authorization|measure|qualityGate|source"
;;

Category2)
CATEGORY="issue|test|qualityModel"
;;

Category3)
CATEGORY="Category3|component|project"
;;

Category4)
CATEGORY="Category4|duplication|user|webhook"
;;

Category5)
CATEGORY="Category5"
;;

Category6)
CATEGORY="Category6|organization"
;;

*)
echo "unknown CATEGORY_GROUP: $CATEGORY_GROUP"
exit 1
;;
esac

mvn verify \
-f tests/pom.xml \
./gradlew --no-daemon --console plain -i \
:tests:integrationTest \
-Dcategory="$CATEGORY" \
-Dorchestrator.configUrl="http://infra.internal.sonarsource.com/jenkins/orch-$DB_ENGINE.properties" \
-Pwith-db-drivers \
-B -e -V
${TEST_ARGS}
fi
;;

run-it-released-plugins)
./run-integration-tests.sh "Plugins" "http://infra.internal.sonarsource.com/jenkins/orch-h2.properties"
./run-integration-tests.sh "Plugins" "http://infra.internal.sonarsource.com/jenkins/orch-h2.properties" \
${TEST_ARGS}
;;

run-perf-tests)
if [[ "$GITHUB_BRANCH" == "PULLREQUEST-"* ]]; then
# do not execute Perf tests on feature branch outside pull request
exit 0
else
./run-perf-tests.sh
fi
./run-perf-tests.sh \
${TEST_ARGS}
;;

run-upgrade-tests-*)
DB_ENGINE=$(sed "s/run-upgrade-tests-//g" <<< $RUN_ACTIVITY)
if [[ "$GITHUB_BRANCH" != "master" ]] && [[ "$GITHUB_BRANCH" != "branch-"* ]] && [[ "$DB_ENGINE" != "postgresql93" ]]; then
# restrict upgrade tests to PostgreSQL on feature branches and dogfood
exit 0

else
./run-upgrade-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties"
fi
./run-upgrade-tests.sh "http://infra.internal.sonarsource.com/jenkins/orch-${DB_ENGINE}.properties" \
${TEST_ARGS}
;;

*)

+ 0
- 17
cve-false-positives.xml View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://www.owasp.org/index.php/OWASP_Dependency_Check_Suppression">
<suppress>
<notes><![CDATA[
file name: gson-2.3.1.jar
]]></notes>
<sha1>ECB6E1F8E4B0E84C4B886C2F14A1500CAF309757</sha1>
<cpe>cpe:/a:google:v8:2.3.1</cpe>
</suppress>
<suppress>
<notes><![CDATA[
file name: geronimo-spec-jta-1.0-M1.jar
]]></notes>
<sha1>1F01F94B5B83C33950E22CDE224868407FDF8B99</sha1>
<cpe>cpe:/a:apache:geronimo:1.0.m1</cpe>
</suppress>
</suppressions>

+ 0
- 7
find-classpath-conflicts.sh View File

@@ -1,7 +0,0 @@
#!/bin/sh

# Search for duplication of classes in classpath
# This check can not be automated in build yet as current
# conflicts must be fixed.

mvn org.basepom.maven:duplicate-finder-maven-plugin:check

+ 0
- 4
format-headers.sh View File

@@ -1,4 +0,0 @@
#!/bin/bash
# Set correct copyright headers

mvn license:format -Ptests

+ 4
- 0
gradle.properties View File

@@ -0,0 +1,4 @@
group = org.sonarsource.sonarqube
version = 7.1-SNAPSHOT
description = 'Open source platform for continuous inspection of code quality'
projectTitle = SonarQube

BIN
gradle/wrapper/gradle-wrapper.jar View File


+ 5
- 0
gradle/wrapper/gradle-wrapper.properties View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip

+ 172
- 0
gradlew View File

@@ -0,0 +1,172 @@
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"

+ 84
- 0
gradlew.bat View File

@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

+ 3
- 0
plugins/build.gradle View File

@@ -0,0 +1,3 @@
sonarqube {
skipProject = true
}

+ 44
- 0
plugins/sonar-xoo-plugin/build.gradle View File

@@ -0,0 +1,44 @@
configurations {
testCompile.extendsFrom(compileOnly)
}

dependencies {
compile 'com.google.guava:guava'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compileOnly 'com.google.code.findbugs:jsr305'
compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow')

testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
}

jar {
manifest {
attributes(
'Plugin-Key': 'xoo',
'Plugin-Version': project.version,
'Plugin-Class': 'org.sonar.xoo.XooPlugin',
'Plugin-ChildFirstClassLoader': 'false',
'Sonar-Version': project.version,
'SonarLint-Supported': 'true',
'Plugin-Name': 'Xoo'
)
}
into('META-INF/lib') {
from configurations.compile
}
}

artifactoryPublish.skip = false

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 75
plugins/sonar-xoo-plugin/pom.xml View File

@@ -1,75 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>sonar-xoo-plugin</artifactId>
<name>SonarQube :: Plugins :: Xoo</name>
<packaging>sonar-plugin</packaging>
<description>Sample of plugin to document and test available APIs</description>

<properties>
<sonar.skip>true</sonar.skip>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</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.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- unit testing -->
<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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<configuration>
<pluginKey>xoo</pluginKey>
<pluginName>Xoo</pluginName>
<pluginClass>org.sonar.xoo.XooPlugin</pluginClass>
<sonarLintSupported>true</sonarLintSupported>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 0
- 1554
pom.xml
File diff suppressed because it is too large
View File


+ 0
- 44
quick-build.sh View File

@@ -1,44 +0,0 @@
#!/bin/sh

#export MAVEN_OPTS='-Xmx256m'

cat << 'EOF'


uuuuuuu
uu$$$$$$$$$$$uu
uu$$$$$$$$$$$$$$$$$uu
u$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$$$$$$$$$$$$$$$$$$$$u
u$$$$$$" "$$$" "$$$$$$u
"$$$$" u$u $$$$"
$$$u u$u u$$$
$$$u u$$$u u$$$
"$$$$uu$$$ $$$uu$$$$"
"$$$$$$$" "$$$$$$$"
u$$$$$$$u$$$$$$$u
u$"$"$"$"$"$"$u
uuu $$u$ $ $ $ $u$$ uuu
u$$$$ $$$$$u$u$u$$$ u$$$$
$$$$$uu "$$$$$$$$$" uu$$$$$$
u$$$$$$$$$$$uu """"" uuuu$$$$$$$$$$
$$$$"""$$$$$$$$$$uuu uu$$$$$$$$$"""$$$"
""" ""$$$$$$$$$$$uu ""$"""
uuuu ""$$$$$$$$$$uuu
u$$$uuu$$$$$$$$$uu ""$$$$$$$$$$$uuu$$$
$$$$$$$$$$"""" ""$$$$$$$$$$$"
"$$$$$" ""$$$$""
$$$" $$$$"


TESTS ARE DISABLED
ARE U CRAZY ?



EOF

./stop.sh
mvn clean install -B -e -V -DskipTests=true -Dmaven.source.skip=true -Pdev,skipSanityChecks $*

+ 6
- 4
run-db-unit-tests.sh View File

@@ -4,8 +4,10 @@ set -euo pipefail
ORCHESTRATOR_CONFIG_URL=$1
shift

mvn verify \
-pl :sonar-db-core,:sonar-db-migration,:sonar-db-dao \
./gradlew --no-daemon \
:server:sonar-db-core:createDB \
:server:sonar-db-core:test \
:server:sonar-db-migration:test \
:server:sonar-db-dao:test \
-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL \
-Dwith-db-drivers \
-B -e -V $*
$*

+ 4
- 8
run-integration-tests.sh View File

@@ -16,12 +16,8 @@ CATEGORY=$1
ORCHESTRATOR_CONFIG_URL=$2
shift 2

cd tests/plugins
mvn clean package -B -e -V

cd ..
mvn verify \
./gradlew --no-daemon --console plain -i \
:tests:integrationTest \
-Dcategory="$CATEGORY" \
-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL \
-Pwith-db-drivers \
-B -e -V $*
-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL \
$*

+ 5
- 2
run-perf-tests.sh View File

@@ -2,5 +2,8 @@
set -euo pipefail

echo 'Run performance tests'
cd tests
mvn verify -B -e -V -Dcategory=ServerPerformance $*

./gradlew --no-daemon --console plain -i \
:tests:integrationTest \
-Dcategory=ServerPerformance \
$*

+ 4
- 4
run-upgrade-tests.sh View File

@@ -13,8 +13,8 @@ set -euo pipefail
ORCHESTRATOR_CONFIG_URL=$1
shift 1

cd tests
mvn verify \
-Pwith-db-drivers \
./gradlew --no-daemon --console plain -i \
:tests:integrationTest \
-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL \
-Dcategory=Upgrade -B -e -V $*
-Dcategory=Upgrade \
$*

+ 1
- 1
scripts/logs.sh View File

@@ -78,7 +78,7 @@ if [ "$script_name" == "logs.sh" ]; then
checkLogArgument "$LOG"

ROOT=$(pwd)
cd sonar-application/target/sonarqube-*
cd sonar-application/build/distributions/sonarqube-*
SQ_HOME=$(pwd)
cd "$ROOT"


+ 3
- 3
scripts/start.sh View File

@@ -36,15 +36,15 @@ else
OS='linux-x86-64'
fi

if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
if ! ls sonar-application/build/distributions/sonar-application-*.zip &> /dev/null; then
echo 'Sources are not built'
"$ROOT"/build.sh
fi

cd sonar-application/target/
cd sonar-application/build/distributions/
if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
echo "Unzipping SQ..."
unzip -qq sonarqube-*.zip
unzip -qq sonar-application-*.zip
fi
cd $(find sonarqube-* -type d | head -1)


+ 5
- 0
server/build.gradle View File

@@ -0,0 +1,5 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Server :: Parent"
}
}

+ 0
- 59
server/pom.xml View File

@@ -1,59 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>
<artifactId>server</artifactId>
<packaging>pom</packaging>
<name>SonarQube :: Server :: Parent</name>

<modules>
<module>sonar-process</module>
<module>sonar-main</module>
<module>sonar-db-core</module>
<module>sonar-db-migration</module>
<module>sonar-db-dao</module>
<module>sonar-db-testing</module>
<module>sonar-server</module>
<module>sonar-ce</module>
<module>sonar-plugin-bridge</module>
<module>sonar-web</module>
<module>sonar-qa-util</module>
</modules>

<profiles>

<profile>
<!-- SonarSource internal use -->
<id>with-db-drivers</id>
<activation>
<property>
<name>with-db-drivers</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>

+ 24
- 0
server/sonar-ce/build.gradle View File

@@ -0,0 +1,24 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Compute Engine"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'com.google.protobuf:protobuf-java'
compile 'org.nanohttpd:nanohttpd'
compile project(':server:sonar-server')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.h2database:h2'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.assertj:assertj-guava'
testCompile 'org.mockito:mockito-core'
testCompile project(':server:sonar-db-testing')
}

+ 0
- 68
server/sonar-ce/pom.xml View File

@@ -1,68 +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-ce</artifactId>
<name>SonarQube :: Compute Engine</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-server</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<!-- unit tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</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>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-testing</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>

</project>

+ 3
- 3
server/sonar-ce/src/main/java/org/sonar/ce/queue/InternalCeQueueImpl.java View File

@@ -28,9 +28,9 @@ import java.util.Optional;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.log4j.Logger;
import org.sonar.api.ce.ComputeEngineSide;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.ce.container.ComputeEngineStatus;
import org.sonar.ce.monitoring.CEQueueStatus;
@@ -50,7 +50,7 @@ import static java.util.Objects.requireNonNull;

@ComputeEngineSide
public class InternalCeQueueImpl extends CeQueueImpl implements InternalCeQueue {
private static final org.sonar.api.utils.log.Logger LOG = Loggers.get(InternalCeQueueImpl.class);
private static final Logger LOG = Loggers.get(InternalCeQueueImpl.class);

private static final int MAX_EXECUTION_COUNT = 1;

@@ -145,7 +145,7 @@ public class InternalCeQueueImpl extends CeQueueImpl implements InternalCeQueue
printStream.flush();
return out.toString();
} catch (IOException e) {
Logger.getLogger(InternalCeQueueImpl.class).debug("Failed to getStacktrace out of error", e);
LOG.debug("Failed to getStacktrace out of error", e);
return null;
}
}

+ 71
- 0
server/sonar-db-core/build.gradle View File

@@ -0,0 +1,71 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Database Core"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'ch.qos.logback:logback-classic'
compile 'ch.qos.logback:logback-core'
compile 'commons-codec:commons-codec'
compile 'commons-dbcp:commons-dbcp'
compile 'commons-dbutils:commons-dbutils'
compile 'net.jpountz.lz4:lz4'
compile 'org.apache.commons:commons-csv'
compile 'org.mybatis:mybatis'
compile 'org.slf4j:slf4j-api'
compile project(':server:sonar-process')
compile project(':sonar-core')
compile project(':sonar-scanner-protocol')
compile project(path: ':sonar-plugin-api', configuration: 'shadow')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.h2database:h2'
testCompile 'com.microsoft.sqlserver:mssql-jdbc'
testCompile 'com.oracle.jdbc:ojdbc8'
testCompile 'junit:junit'
testCompile 'mysql:mysql-connector-java'
testCompile 'org.assertj:assertj-core'
testCompile 'org.dbunit:dbunit'
testCompile 'org.mockito:mockito-core'
testCompile 'org.postgresql:postgresql'
testCompile 'org.sonarsource.orchestrator:sonar-orchestrator'
testCompile project(':sonar-testing-harness')
}

task createDB(type:JavaExec) {
main = 'org.sonar.db.CreateDb'
classpath = sourceSets.test.runtimeClasspath
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
systemProperty 'sonar.runtimeVersion', version
systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey')
systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories')
}

test {
if (System.hasProperty('orchestrator.configUrl'))
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
}

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
}
}
}

+ 0
- 197
server/sonar-db-core/pom.xml View File

@@ -1,197 +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>
</parent>

<artifactId>sonar-db-core</artifactId>

<name>SonarQube :: Database Core</name>
<description>Core Database support</description>
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-scanner-protocol</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
</dependency>
<dependency>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
</dependency>

<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</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>${project.groupId}</groupId>
<artifactId>sonar-process</artifactId>
<version>${project.version}</version>
</dependency>

<!-- 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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>


<!--
JDBC drivers for MyBatis integration tests.
They can't be moved to the profile run-mybatis-its because
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<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>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>create-db</id>
<activation>
<property>
<name>env.SONARSOURCE_QA</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>download-sq</id>
<goals>
<goal>get</goal>
</goals>
<phase>generate-test-resources</phase>
<configuration>
<artifact>${project.groupId}:sonar-application:${project.version}:zip</artifact>
<transitive>false</transitive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>orchestrator-maven-plugin</artifactId>
<version>${orchestrator.version}</version>
<executions>
<execution>
<id>create-db</id>
<goals>
<goal>create-db</goal>
</goals>
<phase>generate-test-resources</phase>
<configuration>
<sqVersion>${project.version}</sqVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

+ 49
- 0
server/sonar-db-core/src/test/java/org/sonar/db/CreateDb.java View File

@@ -0,0 +1,49 @@
/*
* SonarQube
* Copyright (C) 2009-2018 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.db;

import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.OrchestratorBuilder;
import com.sonar.orchestrator.locator.FileLocation;
import org.apache.commons.lang.StringUtils;

import java.io.File;

public class CreateDb {

public static void main(String[] args) {
OrchestratorBuilder builder = Orchestrator.builderEnv();
String version = System.getProperty("sonar.runtimeVersion");
if (StringUtils.isEmpty(version)) {
File zip = FileLocation.byWildcardMavenFilename(new File("../../sonar-application/build/distributions"), "sonar-application-*.zip").getFile();
builder.setZipFile(zip);
} else {
builder.setSonarVersion(version);
}
builder.setOrchestratorProperty("orchestrator.workspaceDir", "build/it");

Orchestrator orchestrator = builder.build();
try {
orchestrator.start();
} finally {
orchestrator.stop();
}
}
}

+ 51
- 0
server/sonar-db-dao/build.gradle View File

@@ -0,0 +1,51 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: DAO"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile project(':server:sonar-db-core')
compile project(':server:sonar-db-migration')
compile project(':sonar-core')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.h2database:h2'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.assertj:assertj-guava'
testCompile 'org.dbunit:dbunit'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
testCompile project(':server:sonar-db-core').sourceSets.test.output

testCompileOnly 'com.google.code.findbugs:jsr305'
}

test {
if (System.hasProperty('orchestrator.configUrl'))
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
}

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
}
}
}

+ 0
- 109
server/sonar-db-dao/pom.xml View File

@@ -1,109 +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>
</parent>

<artifactId>sonar-db-dao</artifactId>

<name>SonarQube :: DAO</name>
<description>DAO layer for SonarQube</description>
<dependencies>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-db-core</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-db-migration</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<!-- 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>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<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>
</plugin>
</plugins>
</build>

<profiles>
</profiles>
</project>

+ 42
- 0
server/sonar-db-migration/build.gradle View File

@@ -0,0 +1,42 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Database Migration"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile project(':server:sonar-db-core')
compile project(':sonar-core')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.h2database:h2'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.dbunit:dbunit'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
testCompile project(':server:sonar-db-core').sourceSets.test.output
}

test {
if (System.hasProperty('orchestrator.configUrl'))
systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
}

artifactoryPublish.skip = false

// Used by core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 76
server/sonar-db-migration/pom.xml View File

@@ -1,76 +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>
</parent>

<artifactId>sonar-db-migration</artifactId>

<name>SonarQube :: Database Migration</name>
<description>Create SonarQube schema</description>
<dependencies>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-db-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<!-- 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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>

+ 15
- 0
server/sonar-db-testing/build.gradle View File

@@ -0,0 +1,15 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: DB testing"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'org.dbunit:dbunit'

compile project(':server:sonar-db-core').sourceSets.test.output
compile project(':server:sonar-db-dao').sourceSets.test.output
compile project(':sonar-testing-harness')
}

+ 0
- 46
server/sonar-db-testing/pom.xml View File

@@ -1,46 +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>
</parent>

<artifactId>sonar-db-testing</artifactId>
<packaging>pom</packaging>

<name>SonarQube :: DB testing</name>
<description>DB testing for SonarQube</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-db-dao</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
</dependency>

</dependencies>

<build>
</build>

<profiles>
</profiles>
</project>

+ 30
- 0
server/sonar-main/build.gradle View File

@@ -0,0 +1,30 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Main Process"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'ch.qos.logback:logback-classic'
// Required by our usage of Guava for clustering : CeWorkerFactoryImpl.getClusteredWorkerUUIDs()
compile 'com.google.guava:guava'
compile 'com.hazelcast:hazelcast'
compile 'com.hazelcast:hazelcast-client'
compile 'org.apache.logging.log4j:log4j-to-slf4j'
compile 'org.apache.logging.log4j:log4j-api'
compile 'org.elasticsearch.client:transport'
compile 'org.slf4j:slf4j-api'
compile 'org.yaml:snakeyaml'
compile project(':server:sonar-process')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
}

+ 0
- 120
server/sonar-main/pom.xml View File

@@ -1,120 +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-main</artifactId>
<name>SonarQube :: Main Process</name>
<description>Server process used to bootstrap Elasticsearch, Web Server and
Compute Engine processes. Could be merged with sonar-application.</description>

<properties>
<!--
version as stored in JAR and displayed in webapp. It is
overridden on Travis when replacing SNAPSHOT version by
build unique version, for instance "6.3.0.12345".
-->
<buildVersion>${project.version}</buildVersion>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-process</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-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-classic</artifactId>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-client</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!--
Required by our usage of Guava for clustering : CeWorkerFactoryImpl.getClusteredWorkerUUIDs()
-->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<resources>
<resource>
<!-- Used to resolve variables in file sonarqube-version.txt -->
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>

+ 2
- 5
server/sonar-main/src/main/java/org/sonar/application/command/CommandFactoryImpl.java View File

@@ -152,8 +152,7 @@ public class CommandFactoryImpl implements CommandFactory {
.setEnvVariable(PATH_LOGS.getKey(), props.nonNullValue(PATH_LOGS.getKey()))
.setArgument("sonar.cluster.web.startupLeader", Boolean.toString(leader))
.setClassName("org.sonar.server.app.WebServer")
.addClasspath("./lib/common/*")
.addClasspath("./lib/server/*");
.addClasspath("./lib/common/*");
String driverPath = props.value(JDBC_DRIVER_PATH.getKey());
if (driverPath != null) {
command.addClasspath(driverPath);
@@ -176,9 +175,7 @@ public class CommandFactoryImpl implements CommandFactory {
.setArguments(props.rawProperties())
.setJvmOptions(jvmOptions)
.setClassName("org.sonar.ce.app.CeServer")
.addClasspath("./lib/common/*")
.addClasspath("./lib/server/*")
.addClasspath("./lib/ce/*");
.addClasspath("./lib/common/*");
String driverPath = props.value(JDBC_DRIVER_PATH.getKey());
if (driverPath != null) {
command.addClasspath(driverPath);

+ 8
- 8
server/sonar-main/src/test/java/org/sonar/application/command/CommandFactoryImplTest.java View File

@@ -96,7 +96,7 @@ public class CommandFactoryImplTest {
}

@Test
public void createEsCommand_throws_ISE_if_es_binary_is_not_found() throws Exception {
public void createEsCommand_throws_ISE_if_es_binary_is_not_found() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("Cannot find elasticsearch binary");

@@ -194,13 +194,13 @@ public class CommandFactoryImplTest {
}

@Test
public void createWebCommand_returns_command_for_default_settings() throws Exception {
public void createWebCommand_returns_command_for_default_settings() {
JavaCommand command = newFactory(new Properties()).createWebCommand(true);

assertThat(command.getClassName()).isEqualTo("org.sonar.server.app.WebServer");
assertThat(command.getWorkDir().getAbsolutePath()).isEqualTo(homeDir.getAbsolutePath());
assertThat(command.getClasspath())
.containsExactlyInAnyOrder("./lib/common/*", "./lib/server/*");
.containsExactly("./lib/common/*");
assertThat(command.getJvmOptions().getAll())
// enforced values
.contains("-Djava.awt.headless=true", "-Dfile.encoding=UTF-8")
@@ -219,13 +219,13 @@ public class CommandFactoryImplTest {
}

@Test
public void createCeCommand_returns_command_for_default_settings() throws Exception {
public void createCeCommand_returns_command_for_default_settings() {
JavaCommand command = newFactory(new Properties()).createCeCommand();

assertThat(command.getClassName()).isEqualTo("org.sonar.ce.app.CeServer");
assertThat(command.getWorkDir().getAbsolutePath()).isEqualTo(homeDir.getAbsolutePath());
assertThat(command.getClasspath())
.containsExactlyInAnyOrder("./lib/common/*", "./lib/server/*", "./lib/ce/*");
.containsExactly("./lib/common/*");
assertThat(command.getJvmOptions().getAll())
// enforced values
.contains("-Djava.awt.headless=true", "-Dfile.encoding=UTF-8")
@@ -244,7 +244,7 @@ public class CommandFactoryImplTest {
}

@Test
public void createWebCommand_configures_command_with_overridden_settings() throws Exception {
public void createWebCommand_configures_command_with_overridden_settings() {
Properties props = new Properties();
props.setProperty("sonar.web.port", "1234");
props.setProperty("sonar.web.javaOpts", "-Xmx10G");
@@ -275,7 +275,7 @@ public class CommandFactoryImplTest {
JavaCommand command = newFactory(props).createWebCommand(true);

assertThat(command.getClasspath())
.containsExactlyInAnyOrder("./lib/common/*", "./lib/server/*", driverFile.getAbsolutePath());
.containsExactlyInAnyOrder("./lib/common/*", driverFile.getAbsolutePath());
}

private void prepareEsFileSystem() throws IOException {
@@ -283,7 +283,7 @@ public class CommandFactoryImplTest {
FileUtils.touch(new File(homeDir, "elasticsearch/bin/elasticsearch.bat"));
}

private CommandFactoryImpl newFactory(Properties userProps) throws IOException {
private CommandFactoryImpl newFactory(Properties userProps) {
return newFactory(userProps, System2.INSTANCE);
}


+ 27
- 0
server/sonar-plugin-bridge/build.gradle View File

@@ -0,0 +1,27 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Priviledged Plugin Bridge"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile project(path: ':sonar-plugin-api', configuration: 'shadow')
compile project(':sonar-core')

compileOnly 'com.google.code.findbugs:jsr305'
}

artifactoryPublish.skip = false

// Used by core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 29
server/sonar-plugin-bridge/pom.xml View File

@@ -1,29 +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-plugin-bridge</artifactId>
<name>SonarQube :: Priviledged Plugin Bridge</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>

+ 49
- 0
server/sonar-process/build.gradle View File

@@ -0,0 +1,49 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Process"
}
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'ch.qos.logback:logback-classic'
compile 'commons-codec:commons-codec'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compile 'com.google.guava:guava'
compile 'com.hazelcast:hazelcast'
compile 'org.slf4j:jul-to-slf4j'
compile 'org.slf4j:slf4j-api'

compileOnly 'com.google.code.findbugs:jsr305'
compileOnly 'com.google.protobuf:protobuf-java'
compileOnly 'org.nanohttpd:nanohttpd'

testCompile 'com.google.code.findbugs:jsr305'
testCompile 'com.google.protobuf:protobuf-java'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
// Workaround to resolve dependencies of eclipse specific packaging: https://issues.gradle.org/browse/GRADLE-2076
testCompile module('org.eclipse.jetty:jetty-server') {
dependencies(
"org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016@jar",
"org.eclipse.jetty:jetty-continuation:8.1.2.v20120308",
"org.eclipse.jetty:jetty-http:8.1.2.v20120308"
)
}
}

artifactoryPublish.skip = false

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 96
server/sonar-process/pom.xml View File

@@ -1,96 +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-process</artifactId>
<name>SonarQube :: Process</name>
<description>Library shared by all kinds of server processes: main, web and compute engine</description>

<properties>
<sonar.exclusions>target/generated-sources/**/*</sonar.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</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.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<!-- only if org.sonar.process.systeminfo HTTP server is being used -->
<groupId>org.nanohttpd</groupId>
<artifactId>nanohttpd</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<!-- only if org.sonar.process.systeminfo.protobuf classes are used -->
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 29
- 0
server/sonar-qa-util/build.gradle View File

@@ -0,0 +1,29 @@
sonarqube {
skipProject = true
}

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'com.codeborne:selenide:4.8'
// required version 23.0 for selenide
compile 'com.google.guava:guava:23.0'
compile 'org.assertj:assertj-core'
compile 'org.sonarsource.orchestrator:sonar-orchestrator'
compile project(':sonar-ws')

compileOnly 'com.google.code.findbugs:jsr305'
}

artifactoryPublish.skip = false

// Required for core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 51
server/sonar-qa-util/pom.xml View File

@@ -1,51 +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-qa-util</artifactId>
<name>SonarQube :: Utilities for QA Tests</name>

<properties>
<sonar.coverage.exclusions>src/main/java/**/*</sonar.coverage.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-ws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>4.8</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- required for selenide -->
<version>23.0</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator</artifactId>
<version>${orchestrator.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>

+ 1
- 1
server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/SelenideConfig.java View File

@@ -57,7 +57,7 @@ public class SelenideConfig {
Configuration.browser = browser.name();
Configuration.baseUrl = orchestrator.getServer().getUrl();
Configuration.timeout = 8_000;
Configuration.reportsFolder = "target/screenshots";
Configuration.reportsFolder = "build/screenshots";
Configuration.screenshots = true;
Configuration.captureJavascriptErrors = true;
Configuration.savePageSource = true;

+ 96
- 0
server/sonar-server/build.gradle View File

@@ -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
}
}
}

+ 0
- 344
server/sonar-server/pom.xml View File

@@ -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>

+ 1
- 1
server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java View File

@@ -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 {

+ 1
- 0
server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java View File

@@ -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);
}
}

+ 1
- 2
server/sonar-server/src/main/java/org/sonar/server/es/EsClientProvider.java View File

@@ -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

+ 44
- 0
server/sonar-web/build.gradle View File

@@ -0,0 +1,44 @@
sonarqube {
properties {
property "sonar.projectName", "${projectTitle} :: Web"
property "sonar.sources", "src/main/js"
property "sonar.tests", "src/main/js"
property "sonar.test.inclusions", "src/main/js/**/__tests__/**"
property "sonar.exclusions", "src/main/js/libs/third-party/**/*,src/main/js/libs/require.js,src/main/js/**/__tests__/**"
}
}

apply plugin: 'com.moowork.node'
apply plugin: 'war'

configurations {
branding
}
dependencies {
branding 'com.sonarsource:sonarsource-branding:1.3.0.307@war'
}
task unzipBranding(type: Copy) {
into projectDir
from { zipTree(configurations.branding.singleFile) }
include '**/*.js'
include '**/*.svg'
includeEmptyDirs = false
}

node {
version = '8.5.0'
yarnVersion = '1.1.0'
download = true
}

yarn_run {
if (release) { dependsOn unzipBranding }
inputs.dir('scripts')
inputs.dir('src/main/js')
inputs.file('build.gradle')
outputs.dir('src/main/webapp')

args = ['build']
}

war.dependsOn yarn_run

+ 0
- 256
server/sonar-web/pom.xml View File

@@ -1,256 +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-web</artifactId>
<packaging>war</packaging>
<name>SonarQube :: Web</name>

<properties>
<!-- self-analysis -->
<sonar.sources>src/main/js</sonar.sources>
<sonar.tests>src/main/js</sonar.tests>
<sonar.test.inclusions>src/main/js/**/__tests__/**</sonar.test.inclusions>
<sonar.exclusions>src/main/js/libs/third-party/**/*,src/main/js/libs/require.js,src/main/js/**/__tests__/**</sonar.exclusions>
<yarn.script>build</yarn.script>
</properties>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/src/main/webapp/deploy</directory>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>readme.txt</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/webapp</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-generated-webapp</id>
<!-- must be after the execution of grunt -->
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>src/main/webapp/build</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>v8.5.0</nodeVersion>
<yarnVersion>v1.1.0</yarnVersion>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
</execution>
<execution>
<phase>generate-resources</phase>
<id>yarn run script</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>run ${yarn.script}</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>
**/*.log,*.iml,WEB-INF/script/,WEB-INF/test/,javascripts/*-min.js,stylesheets/*-min.css,javascripts/tests/**/*,
build/**,templates/**
</packagingExcludes>
<warSourceExcludes>
js/**,css/**
</warSourceExcludes>
<archive>
<manifestEntries>
<Version>${project.version}</Version>
<!-- ${buildNumber} is the Git revision. It's generated by the buildnumber-maven-plugin -->
<Implementation-Build>${buildNumber}</Implementation-Build>
<Build-Time>${timestamp}</Build-Time>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>src/main/webapp/**/*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/node</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
<fileset>
<directory>${basedir}/node_modules</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
<fileset>
<directory>${basedir}/src/main/webapp/deploy</directory>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>readme.txt</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-branding</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.sonarsource</groupId>
<artifactId>sonarsource-branding</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}</outputDirectory>
<includes>**/*.js,**/*.svg</includes>
</artifactItem>
</artifactItems>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
</configuration>
</execution>
<execution>
<id>empty-sources-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sonarsource</groupId>
<artifactId>sonarsource-branding</artifactId>
<version>1.3.0.307</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>dev</id>
<properties>
<yarn.script>build-fast</yarn.script>
</properties>
</profile>
</profiles>

</project>

+ 61
- 0
settings.gradle View File

@@ -0,0 +1,61 @@
rootProject.name = 'sonarqube'

include 'plugins:sonar-xoo-plugin'

include 'server:sonar-ce'
include 'server:sonar-db-testing'
include 'server:sonar-db-core'
include 'server:sonar-db-dao'
include 'server:sonar-db-migration'
include 'server:sonar-main'
include 'server:sonar-plugin-bridge'
include 'server:sonar-process'
include 'server:sonar-qa-util'
include 'server:sonar-server'
include 'server:sonar-web'

include 'sonar-application'
include 'sonar-check-api'
include 'sonar-core'
include 'sonar-duplications'
include 'sonar-home'
include 'sonar-markdown'
include 'sonar-plugin-api'
include 'sonar-plugin-api-deps'
include 'sonar-scanner-engine'
include 'sonar-scanner-engine-shaded'
include 'sonar-scanner-protocol'
include 'sonar-testing-harness'
include 'sonar-ws'
include 'sonar-ws-generator'

include 'tests:plugins:access-secured-props-plugin'
include 'tests:plugins:backdating-customplugin'
include 'tests:plugins:backdating-plugin-v1'
include 'tests:plugins:backdating-plugin-v2'
include 'tests:plugins:base-auth-plugin'
include 'tests:plugins:batch-plugin'
include 'tests:plugins:extension-lifecycle-plugin'
include 'tests:plugins:fake-billing-plugin'
include 'tests:plugins:fake-governance-plugin'
include 'tests:plugins:foo-plugin-v1'
include 'tests:plugins:foo-plugin-v2'
include 'tests:plugins:global-property-change-plugin'
include 'tests:plugins:issue-filter-plugin'
include 'tests:plugins:l10n-fr-pack'
include 'tests:plugins:license-plugin'
include 'tests:plugins:oauth2-auth-plugin'
include 'tests:plugins:posttask-plugin'
include 'tests:plugins:project-builder-plugin'
include 'tests:plugins:property-relocation-plugin'
include 'tests:plugins:property-sets-plugin'
include 'tests:plugins:security-plugin'
include 'tests:plugins:server-plugin'
include 'tests:plugins:settings-encryption-plugin'
include 'tests:plugins:settings-plugin'
include 'tests:plugins:sonar-fake-plugin'
include 'tests:plugins:sonar-subcategories-plugin'
include 'tests:plugins:ui-extensions-plugin'
include 'tests:plugins:wait-at-platform-level4-plugin'
include 'tests:plugins:ws-plugin'
include 'tests'

+ 0
- 19
sonar-application/assembly-common.xml View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>common-lib-dir</id>
<formats>
<format>dir</format>
</formats>
<baseDirectory>/</baseDirectory>
<dependencySets>

<dependencySet>
<outputDirectory>/</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>

</dependencySets>

</assembly>

+ 0
- 213
sonar-application/assembly.xml View File

@@ -1,213 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>distribution</id>
<formats>
<format>${assembly.format}</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<dependencySets>
<!-- Libraries -->
<dependencySet>
<outputDirectory>lib</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<useTransitiveFiltering>false</useTransitiveFiltering>
<useProjectArtifact>true</useProjectArtifact>
<includes>
<include>org.sonarsource.sonarqube:sonar-application</include>
</includes>
</dependencySet>

<dependencySet>
<outputDirectory>lib/jsw</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<useTransitiveFiltering>false</useTransitiveFiltering>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>tanukisoft:wrapper</include>
</includes>
<scope>provided</scope>
</dependencySet>

<dependencySet>
<outputDirectory>lib/server</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<useTransitiveFiltering>true</useTransitiveFiltering>
<includes>
<include>org.sonarsource.sonarqube:sonar-server</include>
</includes>
<scope>provided</scope>
</dependencySet>

<dependencySet>
<outputDirectory>lib/ce</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<useTransitiveFiltering>true</useTransitiveFiltering>
<includes>
<include>org.sonarsource.sonarqube:sonar-ce</include>
</includes>
<scope>provided</scope>
</dependencySet>

<!-- Scanner Engine that is returned by batch/index WS -->
<dependencySet>
<outputDirectory>lib/scanner</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
<include>org.sonarsource.sonarqube:sonar-scanner-engine-shaded</include>
</includes>
<scope>provided</scope>
</dependencySet>
<!-- Plugins -->
<dependencySet>
<outputDirectory>lib/bundled-plugins</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
<include>org.sonarsource.*:sonar-*-plugin</include>
</includes>
<scope>provided</scope>
</dependencySet>
<!-- Server -->
<dependencySet>
<outputDirectory>web</outputDirectory>
<includes>
<include>org.sonarsource.sonarqube:sonar-web</include>
</includes>
<unpack>true</unpack>
<scope>provided</scope>
</dependencySet>
<!-- JDBC drivers -->
<dependencySet>
<outputDirectory>lib/jdbc/mssql/</outputDirectory>
<includes>
<include>com.microsoft.sqlserver:mssql-jdbc</include>
</includes>
<unpack>false</unpack>
<scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>lib/jdbc/mysql/</outputDirectory>
<includes>
<include>mysql:mysql-connector-java</include>
</includes>
<unpack>false</unpack>
<scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>lib/jdbc/postgresql/</outputDirectory>
<includes>
<include>org.postgresql:postgresql</include>
</includes>
<unpack>false</unpack>
<scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>lib/jdbc/h2/</outputDirectory>
<includes>
<include>com.h2database:h2</include>
</includes>
<unpack>false</unpack>
<scope>provided</scope>
</dependencySet>
</dependencySets>

<fileSets>
<!-- common directory -->
<fileSet>
<directory>target/common</directory>
<outputDirectory>lib/common</outputDirectory>
</fileSet>
<!-- wrapper binaries -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory></outputDirectory>
<includes>
<include>bin/*/lib/*.so</include>
<include>bin/*/lib/*.jnilib</include>
<include>bin/*/lib/*.dll</include>
<include>bin/*/wrapper</include>
<include>bin/*/wrapper.exe</include>
<include>elasticsearch/bin/elasticsearch</include>
<include>elasticsearch/bin/elasticsearch.bat</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
<!-- Configuration Files -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory></outputDirectory>
<includes>
<include>conf/**</include>
</includes>
<!-- See SONAR-2580 - for better readability of configuration files on Windows: -->
<lineEnding>dos</lineEnding>
<fileMode>0644</fileMode>
</fileSet>
<!-- Windows Scripts -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/*.bat</include>
<include>**/*.cmd</include>
</includes>
<lineEnding>dos</lineEnding>
<fileMode>0644</fileMode>
</fileSet>
<!-- Linux Scripts -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/*.sh</include>
<include>**/ant</include>
<include>**/antRun</include>
</includes>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
<!-- Other stuff -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory></outputDirectory>
<excludes>
<exclude>conf/**</exclude>
<exclude>**/*.bat</exclude>
<exclude>**/*.cmd</exclude>
<exclude>**/*.sh</exclude>
<exclude>**/ant</exclude>
<exclude>**/antRun</exclude>
<!--exclude ES modules by default in the distribution that we don't use-->
<exclude>elasticsearch/modules/lang-expression/</exclude>
<exclude>elasticsearch/modules/lang-groovy/</exclude>
<exclude>elasticsearch/modules/lang-mustache/</exclude>
<exclude>elasticsearch/modules/lang-painless/</exclude>
<exclude>elasticsearch/modules/transport-netty3/</exclude>
</excludes>
<fileMode>0644</fileMode>
</fileSet>
<!-- Empty directories -->
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory>extensions/jdbc-driver/oracle/</outputDirectory>
<excludes>
<exclude>**/*</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory>logs/</outputDirectory>
<excludes>
<exclude>**/*</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>src/main/assembly</directory>
<outputDirectory>elasticsearch/plugins</outputDirectory>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>

+ 148
- 0
sonar-application/build.gradle View File

@@ -0,0 +1,148 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Application"
}
}

configurations {
ce
jsw
scanner
server
webapp
jdbc_mssql {
transitive = false
}
jdbc_mysql {
transitive = false
}
jdbc_postgresql {
transitive = false
}
jdbc_h2 {
transitive = false
}
bundledPlugin {
transitive = false
}
}

dependencies {
compile 'org.elasticsearch.client:transport'
compile project(':server:sonar-main')
compile project(':server:sonar-process')

compileOnly 'com.google.code.findbugs:jsr305'

ce project(':server:sonar-ce')
jsw 'tanukisoft:wrapper:3.2.3'
scanner project(path: ':sonar-scanner-engine-shaded', configuration: 'shadow')
server project(':server:sonar-server')
webapp project(path: ':server:sonar-web', configuration: 'archives')

jdbc_mssql 'com.microsoft.sqlserver:mssql-jdbc'
jdbc_mysql 'mysql:mysql-connector-java'
jdbc_postgresql 'org.postgresql:postgresql'
jdbc_h2 'com.h2database:h2'

bundledPlugin 'org.sonarsource.java:sonar-java-plugin:5.1.0.13090@jar'
bundledPlugin 'org.sonarsource.javascript:sonar-javascript-plugin:4.0.0.5862@jar'
bundledPlugin 'org.sonarsource.dotnet:sonar-csharp-plugin:6.7.1.4347@jar'
bundledPlugin 'org.sonarsource.scm.git:sonar-scm-git-plugin:1.4.0.1037@jar'
bundledPlugin 'org.sonarsource.scm.svn:sonar-scm-svn-plugin:1.7.0.1017@jar'
bundledPlugin 'org.sonarsource.php:sonar-php-plugin:2.12.1.3018@jar'
bundledPlugin 'org.sonarsource.python:sonar-python-plugin:1.9.0.2010@jar'
bundledPlugin 'org.sonarsource.flex:sonar-flex-plugin:2.3@jar'
bundledPlugin 'org.sonarsource.xml:sonar-xml-plugin:1.4.3.1027@jar'
bundledPlugin 'org.sonarsource.typescript:sonar-typescript-plugin:1.5.0.2122@jar'

testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'

}

jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { "common/${it.getName()}" }.join(' '),
'Main-Class': 'org.sonar.application.App'
)
}
}

task zip(type: Zip) {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
def archiveDir = "sonarqube-$version"
into("${archiveDir}/") {
from file('src/main/assembly')
exclude 'elasticsearch/modules/lang-expression/**'
exclude 'elasticsearch/modules/lang-groovy/**'
exclude 'elasticsearch/modules/lang-mustache/**'
exclude 'elasticsearch/modules/lang-painless/**'
exclude 'elasticsearch/modules/transport-netty3/**'
}
// Create the empty dir (plugins) required by elasticsearch
into("${archiveDir}/elasticsearch/") {
from "$buildDir/elasticsearch"
}
into("${archiveDir}/lib/") {
from jar
}
into("${archiveDir}/lib/bundled-plugins/") {
from configurations.bundledPlugin
}
into("${archiveDir}/lib/jsw/") {
from configurations.jsw
}
into("${archiveDir}/lib/scanner/") {
from configurations.scanner
}
into("${archiveDir}/lib/common/") {
from configurations.ce + configurations.server + configurations.compile
}
dependsOn configurations.webapp
into("${archiveDir}/web/") {
from {
configurations.webapp.files.collect { zipTree(it) }
}
}
into("${archiveDir}/lib/jdbc/mssql/") {
from configurations.jdbc_mssql
}
into("${archiveDir}/lib/jdbc/mysql/") {
from configurations.jdbc_mysql
}
into("${archiveDir}/lib/jdbc/postgresql/") {
from configurations.jdbc_postgresql
}
into("${archiveDir}/lib/jdbc/h2/") {
from configurations.jdbc_h2
}
}
// Create the empty dir required by elasticsearch
zip.doFirst {
new File(buildDir, 'elasticsearch/plugins').mkdirs()
}
// Check the size of the archive
zip.doLast {
def minLength = 155000000
def maxLength = 170000000
def length = new File(distsDir, archiveName).length()
if (length < minLength)
throw new GradleException("$archiveName size ($length) too small. Min is $minLength")
if (length > maxLength)
throw new GradleException("$distsDir/$archiveName size ($length) too large. Max is $maxLength")
}

assemble.dependsOn zip

artifactoryPublish.skip = false

publishing {
publications {
mavenJava(MavenPublication) {
artifact zip
}
}
}

+ 0
- 271
sonar-application/pom.xml View File

@@ -1,271 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-application</artifactId>
<packaging>jar</packaging>
<name>SonarQube :: Application</name>
<description>Package the standalone distribution</description>

<properties>
<assembly.recompressZippedFiles>true</assembly.recompressZippedFiles>
<assembly.format>zip</assembly.format>
<checksum.failOnError>true</checksum.failOnError>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-process</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-main</artifactId>
<version>${project.version}</version>
</dependency>
<!--must declare this dependency of sonar-process-monitor here, again,-->
<!--to allow copying it and its dependencies into lib/common-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-server</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-ce</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-scanner-engine-shaded</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-web</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>provided</scope>
</dependency>

<!-- default plugins -->
<dependency>
<groupId>org.sonarsource.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.javascript</groupId>
<artifactId>sonar-javascript-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.dotnet</groupId>
<artifactId>sonar-csharp-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.flex</groupId>
<artifactId>sonar-flex-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.scm.git</groupId>
<artifactId>sonar-scm-git-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.scm.svn</groupId>
<artifactId>sonar-scm-svn-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.php</groupId>
<artifactId>sonar-php-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.python</groupId>
<artifactId>sonar-python-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.typescript</groupId>
<artifactId>sonar-typescript-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.xml</groupId>
<artifactId>sonar-xml-plugin</artifactId>
<type>sonar-plugin</type>
<scope>provided</scope>
</dependency>
<dependency>
<!-- do not upgrade because of licensing change -->
<groupId>tanukisoft</groupId>
<artifactId>wrapper</artifactId>
<version>3.2.3</version>
<scope>provided</scope>
</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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>common</classpathPrefix>
<mainClass>org.sonar.application.App</mainClass>
</manifest>
<manifestEntries>
<mode>distribution</mode>
<url>${project.url}</url>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-common-lib-dir</id>
<phase>prepare-package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>common</finalName>
<descriptors>
<descriptor>assembly-common.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>assemble-distribution-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>sonarqube-${project.version}</finalName>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<recompressZippedFiles>${assembly.recompressZippedFiles}</recompressZippedFiles>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-distribution-size</id>
<goals>
<goal>enforce</goal>
</goals>
<phase>verify</phase>
<configuration>
<rules>
<requireFilesSize>
<minsize>155000000</minsize>
<maxsize>170000000</maxsize>
<files>
<file>${project.build.directory}/sonarqube-${project.version}.zip</file>
</files>
</requireFilesSize>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<properties>
<assembly.recompressZippedFiles>false</assembly.recompressZippedFiles>
</properties>
</profile>
</profiles>

</project>

+ 1
- 0
sonar-application/src/main/assembly/logs/README.txt View File

@@ -0,0 +1 @@
This directory contains log files. See advanced configuration in conf/sonar.properties.

+ 11
- 0
sonar-check-api/build.gradle View File

@@ -0,0 +1,11 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Check API"
}
}

dependencies {
compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'junit:junit'
}

+ 0
- 26
sonar-check-api/pom.xml View File

@@ -1,26 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>sonar-check-api</artifactId>
<name>SonarQube :: Check API</name>
<description>Check API</description>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 53
- 0
sonar-core/build.gradle View File

@@ -0,0 +1,53 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Core"
}
}

configurations {
includeInResources
}

dependencies {
compileOnly 'com.google.code.findbugs:jsr305'
compile 'commons-codec:commons-codec'
compile 'org.apache.commons:commons-csv'
compile 'org.picocontainer:picocontainer'
compile 'com.google.protobuf:protobuf-java'
compile 'org.codehaus.sonar:sonar-classloader'
compile project(path: ':sonar-plugin-api', configuration: 'shadow')
compile 'org.sonarsource.update-center:sonar-update-center-common'
compile 'org.slf4j:slf4j-api'
compile 'ch.qos.logback:logback-classic'
compile 'ch.qos.logback:logback-core'

includeInResources project(path: ':sonar-plugin-api-deps', configuration: 'shadow')

testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
testCompile 'org.simpleframework:simple'
testCompileOnly 'com.google.code.findbugs:jsr305'
}

// sonar-plugin-api.jar is copied into target JAR file
processResources {
into('/') {
from configurations.includeInResources
rename '(.*)-' + project.version + '-all.jar', '$1.jar'
}
}

// Used by sonar-db-core to run DB Unit Tests
artifactoryPublish.skip = false
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 166
sonar-core/pom.xml View File

@@ -1,166 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-core</artifactId>

<name>SonarQube :: Core</name>
<description>Library shared by analyzer and server</description>

<properties>
<sonar.exclusions>target/generated-sources/**/*,target/generated-test-sources/**/*</sonar.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
</dependency>
<dependency>
<groupId>org.picocontainer</groupId>
<artifactId>picocontainer</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-classloader</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.update-center</groupId>
<artifactId>sonar-update-center-common</artifactId>
</dependency>

<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</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.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>

<dependency>
<!-- sonar-api-deps.jar is copied into target JAR file -->
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api-deps</artifactId>
<version>${project.version}</version>
<optional>true</optional>
<scope>runtime</scope>
</dependency>


<!-- 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>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple</artifactId>
<version>4.1.21</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<configuration>
<ignoredDependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api-deps</artifactId>
</dependency>
</ignoredDependencies>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-deprecated-api-deps</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api-deps</artifactId>
<destFileName>sonar-plugin-api-deps.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 18
- 0
sonar-duplications/build.gradle View File

@@ -0,0 +1,18 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Duplications"
}
}

dependencies {
compile 'org.codehaus.sonar:sonar-channel'

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'ch.qos.logback:logback-classic'
testCompile 'commons-io:commons-io'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile 'pmd:pmd:4.3'
}

+ 0
- 73
sonar-duplications/pom.xml View File

@@ -1,73 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-duplications</artifactId>

<name>SonarQube :: Duplications</name>
<description>Detect duplicated code</description>

<properties>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-channel</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pmd</groupId>
<artifactId>pmd</artifactId>
<version>4.3</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 28
- 0
sonar-home/build.gradle View File

@@ -0,0 +1,28 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Home"
}
}

dependencies {
compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'commons-codec:commons-codec'
testCompile 'commons-io:commons-io'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
}

artifactoryPublish.skip = false

// Used by core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 52
sonar-home/pom.xml View File

@@ -1,52 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-home</artifactId>

<name>SonarQube :: Home</name>
<description>Access the user home directory that contains cache of files</description>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- used to compare results -->
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>

+ 28
- 0
sonar-markdown/build.gradle View File

@@ -0,0 +1,28 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Markdown"
}
}

dependencies {
compile 'commons-lang:commons-lang'
compile 'org.codehaus.sonar:sonar-channel'
compile 'org.slf4j:slf4j-api'

testCompile 'ch.qos.logback:logback-classic'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
}

artifactoryPublish.skip = false

// Used by core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 44
sonar-markdown/pom.xml View File

@@ -1,44 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>sonar-markdown</artifactId>
<name>SonarQube :: Markdown</name>

<dependencies>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-channel</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 39
- 0
sonar-plugin-api-deps/build.gradle View File

@@ -0,0 +1,39 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Plugin API Dependencies"
}
}

apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
// Versions must not be changed and overridden from root build.gradle (see dependencyManagement section).
// These are the versions defined in SQ 5.1
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.google.guava:guava:10.0.1'
compile 'commons-beanutils:commons-beanutils:1.9.3'
compile 'commons-codec:commons-codec:1.8'
compile 'commons-collections:commons-collections:3.2.2'
compile 'org.apache.commons:commons-email:1.3.2'
compile 'commons-io:commons-io:2.4'
compile 'commons-lang:commons-lang:2.6'
compile('dom4j:dom4j:1.6.1') {
exclude group: 'xml-apis'
}
compile 'org.picocontainer:picocontainer:2.14.3'
compile 'org.slf4j:slf4j-api:1.7.10'
compile 'ch.qos.logback:logback-classic:1.1.2'
compile 'ch.qos.logback:logback-core:1.1.2'
compile('org.apache.maven:maven-core:3.0.5') {
exclude group: 'classworlds', module: 'classworlds'
exclude group: 'org.sonatype.sisu', module: 'sisu-guava'
}
compile 'org.apache.maven:maven-artifact:3.0.5'
compile('org.codehaus.sonar:sonar-squid:4.1') {
exclude group: 'org.codehaus.sonar', module: 'sonar-check-api'
}
compile('org.codehaus.sonar:sonar-java-api:5.1') {
exclude group: 'org.codehaus.sonar', module: 'sonar-deprecated'
exclude group: 'org.codehaus.sonar', module: 'sonar-plugin-api'
}
}

+ 0
- 231
sonar-plugin-api-deps/pom.xml View File

@@ -1,231 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-plugin-api-deps</artifactId>

<name>SonarQube :: Plugin API Dependencies</name>
<description>Deprecated transitive dependencies of sonar-plugin-api</description>

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>

<!--
Versions must not be changed and overridden from parent pom. These are
the versions defined in SQ 5.1
-->

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>org.picocontainer</groupId>
<artifactId>picocontainer</artifactId>
<version>2.14.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<!-- Needed by old versions of Java plugin (JavaClasspath) -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.0.5</version>
<exclusions>
<exclusion>
<!-- See SONAR-2455 -->
<groupId>classworlds</groupId>
<artifactId>classworlds</artifactId>
</exclusion>
<exclusion>
<!-- this fork conflicts with google's guava -->
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-squid</artifactId>
<version>4.1</version>
<exclusions>
<exclusion>
<!--
Provided at runtime by sonar-plugin-api.
Do not use transitive version 4.1 but the current version.
-->
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-check-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-java-api</artifactId>
<version>5.1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-deprecated</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-plugin-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
</configuration>
</execution>
<execution>
<id>empty-sources-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!--
This module contains deprecated dependencies (containing vulnerability issues) for plugins built for SonarQube < 5.2
It will be removed for 7.0
-->
<profile>
<!--
check if maven dependencies have vulnerabilities listed in CVE
Standalone command: mvn org.owasp:dependency-check-maven:check
See http://jeremylong.github.io/DependencyCheck
-->
<id>securityCheck</id>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

+ 82
- 0
sonar-plugin-api/build.gradle View File

@@ -0,0 +1,82 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Plugin API"
}
}

apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
// please keep the list grouped by configuration and ordered by name

compile 'commons-codec:commons-codec'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compile 'com.google.code.gson:gson'
compile 'com.google.guava:guava'

// shaded, but not relocated
compile project(':sonar-check-api')
compile(project(':sonar-duplications')) {
exclude group: 'org.slf4', module: 'slf4j-api'
}

shadow 'org.codehaus.staxmate:staxmate'
shadow 'org.codehaus.woodstox:stax2-api'
shadow 'org.codehaus.woodstox:woodstox-core-lgpl'

compileOnly 'ch.qos.logback:logback-classic'
compileOnly 'ch.qos.logback:logback-core'
compileOnly 'com.google.code.findbugs:jsr305'
compileOnly 'javax.servlet:javax.servlet-api'
compileOnly 'junit:junit'
compileOnly 'org.slf4j:slf4j-api'

testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
}

sourceSets {
// Make the compileOnly dependencies available when compiling/running tests
test.compileClasspath += configurations.compileOnly + configurations.shadow
test.runtimeClasspath += configurations.compileOnly + configurations.shadow
}

def on3Digits(version) {
def projectversion3digits = version - ~/-\w+/
projectversion3digits = projectversion3digits.tokenize('.').plus(0).take(3).join('.')
}

import org.apache.tools.ant.filters.ReplaceTokens
processResources {
filter ReplaceTokens, tokens: [
// The build version is composed of 4 fields, including the semantic version and the build number provided by Travis.
'project.buildVersion': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version) + '.' + System.getProperty("buildNumber"),
'project.version.3digits': project.version.endsWith('SNAPSHOT') ? project.version : on3Digits(project.version)
]
}

shadowJar {
configurations = [project.configurations.default]
relocate('com.google', 'org.sonar.api.internal.google')
relocate('org.apache.commons', 'org.sonar.api.internal.apachecommons')
dependencies {
exclude(dependency('org.codehaus.woodstox:woodstox-core-lgpl'))
exclude(dependency('org.codehaus.woodstox:stax2-api'))
exclude(dependency('org.codehaus.staxmate:staxmate'))
}
}

artifactoryPublish.skip = false

publishing {
publications {
mavenJava(MavenPublication) {
artifact source: shadowJar, classifier: null
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 282
sonar-plugin-api/pom.xml View File

@@ -1,282 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-plugin-api</artifactId>
<packaging>jar</packaging>

<name>SonarQube :: Plugin API</name>

<properties>
<!--
version as stored in JAR and displayed in webapp. It is
overridden on Travis when replacing SNAPSHOT version by
build unique version, for instance "6.3.0.12345".
-->
<buildVersion>${project.version}</buildVersion>

<!--
a truncated version on three fields is kept for backward-compatibility
with scanners
-->
<buildVersionOnThreeFields>${buildVersion}</buildVersionOnThreeFields>
</properties>

<dependencies>

<!--
The following artifacts are shaded and relocated in an internal package.
They are not visible by plugins
-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>

<!--
The following artifacts are shaded but not relocated. They
are provided at runtime, so plugins can use them but
can not change their version.
Long-term target is to remove them from API. They should be
embedded by plugins.
-->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-check-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-duplications</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<!--
Transitive dependencies available at runtime. They are not shaded with API
as they are not managed by SonarSource. Versions should not be
overridden by plugins though.
-->
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-lgpl</artifactId>
<exclusions>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.staxmate</groupId>
<artifactId>staxmate</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<!-- unit tests -->
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<excludes>
<exclude>org.codehaus.woodstox:woodstox-core-lgpl</exclude>
<exclude>org.codehaus.woodstox:stax2-api</exclude>
<exclude>org.codehaus.staxmate:staxmate</exclude>
</excludes>
</artifactSet>
<filters>
<!-- The following deps are used transitively, so make sure they are not minimized -->
<filter>
<artifact>${project.groupId}:sonar-duplications</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>org.codehaus.sonar:sonar-channel</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>org.sonarsource.sonarqube:sonar-check-api</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>com.google</pattern>
<shadedPattern>org.sonar.api.internal.google</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>org.sonar.api.internal.apachecommons</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<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>
</plugin>
<plugin>
<groupId>com.github.genthaler</groupId>
<artifactId>beanshell-maven-plugin</artifactId>
<executions>
<execution>
<id>compute-version-on-three-fields</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>
<![CDATA[
if (! "${buildVersion}".endsWith("-SNAPSHOT")) {
// example: "6.3.0.1234". To be backward-compatible with scanners, only "6.3.0" must be kept
fields = "${buildVersion}".split("\\.");
sj = new StringJoiner(".");
i = 0;
for (String field : fields) {
if (i == 3) {
break;
}
sj.add(field);
++i;
}
project.getProperties().setProperty("buildVersionOnThreeFields", sj.toString());
}
]]>
</script>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<!-- Used to resolve variables in files sq-version.txt and sonar-api-version.txt -->
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

</project>

+ 1
- 1
sonar-plugin-api/src/main/resources/sonar-api-version.txt View File

@@ -1 +1 @@
${buildVersion}
@project.buildVersion@

+ 1
- 1
sonar-plugin-api/src/main/resources/sq-version.txt View File

@@ -1 +1 @@
${buildVersionOnThreeFields}
@project.version.3digits@

+ 11
- 0
sonar-scanner-engine-shaded/build.gradle View File

@@ -0,0 +1,11 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Scanner Engine Shaded"
}
}

apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
compile project(':sonar-scanner-engine')
}

+ 0
- 65
sonar-scanner-engine-shaded/pom.xml View File

@@ -1,65 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-scanner-engine-shaded</artifactId>
<name>SonarQube :: Scanner Engine Shaded</name>
<description>All Scanner Engine dependencies in a single jar</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-scanner-engine</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
</configuration>
</execution>
<execution>
<id>empty-sources-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 63
- 0
sonar-scanner-engine/build.gradle View File

@@ -0,0 +1,63 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Scanner Engine"
}
}

// Excluding scanner files in order to benefit of incremental build support
sourceSets.test.resources {
exclude '**/.sonar/**'
}

configurations {
testCompile.extendsFrom(compileOnly)
}

dependencies {
compile 'commons-codec:commons-codec'
compile 'commons-lang:commons-lang'
compile 'com.google.code.gson:gson'
compile 'com.google.guava:guava'
compile 'org.freemarker:freemarker'
compile 'org.slf4j:jul-to-slf4j'
compile 'org.slf4j:log4j-over-slf4j'
compile 'org.slf4j:slf4j-api'
compile 'org.sonarsource:sonar-persistit'
compile project(':sonar-core')
compile project(':sonar-scanner-protocol')
compile project(':sonar-ws')
compile project(':sonar-home')
compile project(path: ':sonar-plugin-api', configuration: 'shadow')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.tngtech.java:junit-dataprovider'
testCompile 'javax.servlet:javax.servlet-api'
testCompile 'junit:junit'
// Workaround to resolve dependencies of eclipse specific packaging: https://issues.gradle.org/browse/GRADLE-2076
testCompile module('org.eclipse.jetty:jetty-server') {
dependencies(
"org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016@jar",
"org.eclipse.jetty:jetty-continuation:8.1.2.v20120308",
"org.eclipse.jetty:jetty-http:8.1.2.v20120308"
)
}
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile 'net.javacrumbs.json-unit:json-unit-assertj:0.0.15'
testCompile project(':plugins:sonar-xoo-plugin')
testCompile project(':sonar-plugin-api').sourceSets.test.output
}

artifactoryPublish.skip = false

// Used by core plugins
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 165
sonar-scanner-engine/pom.xml View File

@@ -1,165 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-scanner-engine</artifactId>
<name>SonarQube :: Scanner Engine</name>
<properties>
<enableBenchmarkAssertions>false</enableBenchmarkAssertions>
</properties>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource</groupId>
<artifactId>sonar-persistit</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-core</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-scanner-protocol</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-ws</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-home</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
</dependency>
<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>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- For HTML Report -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>

<!-- unit tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>junit-dataprovider</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
<version>0.0.15</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-xoo-plugin</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>runBenchmarks</id>
<activation>
<property>
<name>runBenchmarks</name>
</property>
</activation>
<properties>
<enableBenchmarkAssertions>true</enableBenchmarkAssertions>
</properties>
</profile>
</profiles>
</project>

+ 34
- 0
sonar-scanner-protocol/build.gradle View File

@@ -0,0 +1,34 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Scanner :: Protocol"
property 'sonar.exclusions', 'src/main/java/org/sonar/scanner/protocol/viewer/**'
}
}

dependencies {
compile 'commons-io:commons-io'
compile 'com.google.code.gson:gson'
compile 'com.google.protobuf:protobuf-java'
compile 'net.jpountz.lz4:lz4'
compile project(':sonar-core')

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'com.google.guava:guava'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile 'net.javacrumbs.json-unit:json-unit-assertj:0.0.15'
}

// Used by sonar-db-core to run DB Unit Tests
artifactoryPublish.skip = false
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 104
sonar-scanner-protocol/pom.xml View File

@@ -1,104 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-scanner-protocol</artifactId>
<name>SonarQube :: Scanner :: Protocol</name>

<description>Classes used for communication between scanner and server</description>

<properties>
<!-- Viewer is for our internal use. This is not production code and mostly generated with Eclipse GUI builder -->
<sonar.exclusions>target/generated-sources/**/*,src/main/java/org/sonar/scanner/protocol/viewer/**</sonar.exclusions>
<sonar.test.exclusions>target/generated-test-sources/**/*</sonar.test.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-core</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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
<version>0.0.15</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>scanner-report-viewer-${project.version}</finalName>
<archive>
<manifest>
<mainClass>org.sonar.scanner.protocol.viewer.ScannerReportViewerApp</mainClass>
</manifest>
</archive>
<descriptors>
<descriptor>src/main/assembly/viewer.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 29
- 0
sonar-testing-harness/build.gradle View File

@@ -0,0 +1,29 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Testing Harness"
}
}

dependencies {
compile 'commons-io:commons-io'
compile 'com.googlecode.json-simple:json-simple'
compile 'com.google.code.gson:gson'
compile 'junit:junit'
compile 'org.hamcrest:hamcrest-core'

compileOnly 'com.google.code.findbugs:jsr305'

testCompile 'org.assertj:assertj-core'
}

// Used by sonar-db-core to run DB Unit Tests
artifactoryPublish.skip = false
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 47
sonar-testing-harness/pom.xml View File

@@ -1,47 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>
<artifactId>sonar-testing-harness</artifactId>
<packaging>jar</packaging>
<name>SonarQube :: Testing Harness</name>

<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 1
- 1
sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java View File

@@ -83,7 +83,7 @@ public class BundleSynchronizedMatcher extends BaseMatcher<String> {
@Override
public void describeTo(Description description) {
// report file
File dumpFile = new File("target/l10n/" + bundleName + ".report.txt");
File dumpFile = new File("build/l10n/" + bundleName + ".report.txt");

// prepare message
StringBuilder details = prepareDetailsMessage(dumpFile);

+ 23
- 0
sonar-ws-generator/build.gradle View File

@@ -0,0 +1,23 @@
sonarqube {
skipProject = true
}

dependencies {
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.google.guava:guava'
compile 'org.apache.velocity:velocity:1.7'
compile 'org.slf4j:log4j-over-slf4j'
compile 'org.sonarsource.orchestrator:sonar-orchestrator'
compile project(':sonar-ws')

compileOnly 'com.google.code.findbugs:jsr305'
}

task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'org.sonarqube.wsgenerator.Generator'
}
classifier = 'jar-with-dependencies'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}

+ 0
- 88
sonar-ws-generator/pom.xml View File

@@ -1,88 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-ws-generator</artifactId>
<name>SonarQube :: Web Service :: Generator</name>
<description>Generate source files of sonar-ws</description>

<properties>
<sonar.exclusions>src/**/*</sonar.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-ws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>run-ws-generator</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.sonarqube.wsgenerator.Generator</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

+ 6
- 4
sonar-ws-generator/run.sh View File

@@ -3,7 +3,9 @@ set -euo pipefail

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

cd $SCRIPTPATH
mvn clean package -Prun-ws-generator
java -jar target/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar
cp -R target/generated-sources/results/org/sonarqube/ws/client/* ../sonar-ws/src/main/java/org/sonarqube/ws/client
pushd $SCRIPTPATH/..
pwd
./gradlew :sonar-ws-generator:build :sonar-ws-generator:fatJar
popd
java -jar build/libs/sonar-ws-generator-*-SNAPSHOT-jar-with-dependencies.jar
cp -R build/generated-sources/results/org/sonarqube/ws/client/* ../sonar-ws/src/main/java/org/sonarqube/ws/client

+ 5
- 4
sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/ApiDefinitionDownloader.java View File

@@ -20,6 +20,7 @@
package org.sonarqube.wsgenerator;

import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.OrchestratorBuilder;
import com.sonar.orchestrator.http.HttpCall;
import com.sonar.orchestrator.http.HttpResponse;
import com.sonar.orchestrator.locator.FileLocation;
@@ -32,10 +33,10 @@ public class ApiDefinitionDownloader {
}

public static String downloadApiDefinition() {
Orchestrator orchestrator = Orchestrator
.builderEnv()
.setZipFile(FileLocation.byWildcardMavenFilename(new File("../sonar-application/target"), "sonarqube-*.zip").getFile())
.build();
OrchestratorBuilder builder = Orchestrator.builderEnv();
builder.setZipFile(FileLocation.byWildcardMavenFilename(new File("../sonar-application/build/distributions"), "sonar-application-*.zip").getFile())
.setOrchestratorProperty("orchestrator.workspaceDir", "build");
Orchestrator orchestrator = builder.build();

orchestrator.start();
try {

+ 1
- 1
sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/Helper.java View File

@@ -37,7 +37,7 @@ import static java.util.Arrays.asList;
public class Helper {

static final Set<String> PATH_EXCLUSIONS = new HashSet<>(asList("api/orchestrator"));
private static final String OUTPUT_DIR = "target/generated-sources/results";
private static final String OUTPUT_DIR = "build/generated-sources/results";
private final Map<String, List<String[]>> responseTypes;

public Helper() {

+ 39
- 0
sonar-ws/build.gradle View File

@@ -0,0 +1,39 @@
sonarqube {
properties {
property 'sonar.projectName', "${projectTitle} :: Web Service"
property 'sonar.exclusions', 'src/main/java/org/sonarqube/ws/client/*/*.java'
}
}

configurations {
testCompile.extendsFrom(compileOnly)
}

dependencies {
compile 'commons-io:commons-io'
compile 'com.google.guava:guava'
compile 'com.google.protobuf:protobuf-java'
compile 'com.squareup.okhttp3:okhttp'

compileOnly 'com.google.code.findbugs:jsr305'
compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow')

testCompile 'commons-lang:commons-lang'
testCompile 'com.squareup.okhttp3:mockwebserver'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile project(':sonar-testing-harness')
}

artifactoryPublish.skip = false

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

+ 0
- 82
sonar-ws/pom.xml View File

@@ -1,82 +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>sonarqube</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>sonar-ws</artifactId>
<name>SonarQube :: Web Service</name>
<description>Protocol Buffers specification of Web Services</description>

<properties>
<sonar.exclusions>target/generated-sources/**/*,src/main/java/org/sonarqube/ws/client/*/*.java</sonar.exclusions>
<sonar.test.exclusions>target/generated-test-sources/**/*,src/test/java/org/sonarqube/ws/client/*/*.java</sonar.test.exclusions>
</properties>

<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<!-- 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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-testing-harness</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

+ 1
- 1
stop.sh View File

@@ -8,7 +8,7 @@ else
OS='linux-x86-64'
fi

SONAR_SH=sonar-application/target/sonarqube-*/bin/$OS/sonar.sh
SONAR_SH=sonar-application/build/distributions/sonarqube-*/bin/$OS/sonar.sh
if [ -f $SONAR_SH ]; then
sh $SONAR_SH stop
fi

+ 149
- 0
tests/build.gradle View File

@@ -0,0 +1,149 @@
ext {
jettyVersion = '9.3.11.v20160721'
bytemanVersion = '3.0.10'
}

configurations {
sqZip
includeInTestResources
}

def pluginsForITs = [
':plugins:sonar-xoo-plugin',
':tests:plugins:access-secured-props-plugin',
':tests:plugins:base-auth-plugin',
':tests:plugins:batch-plugin',
':tests:plugins:extension-lifecycle-plugin',
':tests:plugins:fake-billing-plugin',
':tests:plugins:fake-governance-plugin',
':tests:plugins:foo-plugin-v1',
':tests:plugins:foo-plugin-v2',
':tests:plugins:global-property-change-plugin',
':tests:plugins:issue-filter-plugin',
':tests:plugins:l10n-fr-pack',
':tests:plugins:license-plugin',
':tests:plugins:oauth2-auth-plugin',
':tests:plugins:project-builder-plugin',
':tests:plugins:property-relocation-plugin',
':tests:plugins:property-sets-plugin',
':tests:plugins:security-plugin',
':tests:plugins:server-plugin',
':tests:plugins:settings-encryption-plugin',
':tests:plugins:settings-plugin',
':tests:plugins:sonar-fake-plugin',
':tests:plugins:sonar-subcategories-plugin',
':tests:plugins:ui-extensions-plugin',
':tests:plugins:posttask-plugin',
':tests:plugins:wait-at-platform-level4-plugin',
':tests:plugins:ws-plugin',
':tests:plugins:backdating-plugin-v1',
':tests:plugins:backdating-plugin-v2',
':tests:plugins:backdating-customplugin'
]

dependencies {
testCompile 'org.sonarsource.orchestrator:sonar-orchestrator'
testCompile project(':server:sonar-qa-util')
testCompile project(':sonar-ws')
// required version 23.0 for selenide
testCompile 'com.google.guava:guava:23.0'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.assertj:assertj-guava'
testCompile 'com.googlecode.json-simple:json-simple'
testCompile 'org.skyscreamer:jsonassert:1.2.0'
testCompile 'com.squareup.okhttp3:mockwebserver'
testCompile 'org.subethamail:subethasmtp'
testCompile "org.eclipse.jetty:jetty-server:${jettyVersion}"
testCompile "org.eclipse.jetty:jetty-servlet:${jettyVersion}"
testCompile "org.eclipse.jetty:jetty-proxy:${jettyVersion}"
testCompile "org.jboss.byteman:byteman-submit:${bytemanVersion}"
testCompile 'com.microsoft.sqlserver:mssql-jdbc'
testCompile 'mysql:mysql-connector-java'
testCompile 'org.postgresql:postgresql'
testCompile 'com.oracle.jdbc:ojdbc8'

includeInTestResources "org.jboss.byteman:byteman:${bytemanVersion}"
}

sonarqube {
skipProject = true
}

//UT are excluding in order for ITs to only run when needed
test{
exclude '*'
}

task integrationTest(type: Test) {
description = 'Runs integration tests'

for (plugin in pluginsForITs) {
dependsOn project(plugin).assemble
}

jacoco.enabled = false

systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl')
systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey')
systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories')
if (project.hasProperty('cix')) {
systemProperty 'sonar.runtimeVersion', version
}

def category = System.getProperty('category')
filter {
switch (category) {
case 'Lite':
includeTestsMatching 'org.sonarqube.tests.lite.*Suite'
break
case 'Category1':
includeTestsMatching 'org.sonarqube.tests.Category1Suite'
includeTestsMatching 'org.sonarqube.tests.authorization.*Suite'
includeTestsMatching 'org.sonarqube.tests.measure.*Suite'
includeTestsMatching 'org.sonarqube.tests.qualityGate.*Suite'
includeTestsMatching 'org.sonarqube.tests.source.*Suite'
break
case 'Category2':
includeTestsMatching 'org.sonarqube.tests.issue.*Suite'
includeTestsMatching 'org.sonarqube.tests.test.*Suite'
includeTestsMatching 'org.sonarqube.tests.qualityModel.*Suite'
break
case 'Category3':
includeTestsMatching 'org.sonarqube.tests.Category3Suite'
includeTestsMatching 'org.sonarqube.tests.component.*Suite'
includeTestsMatching 'org.sonarqube.tests.project.*Suite'
break
case 'Category4':
includeTestsMatching 'org.sonarqube.tests.Category4Suite'
includeTestsMatching 'org.sonarqube.tests.duplication.*Suite'
includeTestsMatching 'org.sonarqube.tests.user.*Suite'
includeTestsMatching 'org.sonarqube.tests.webhook.*Suite'
break
case 'Category5':
includeTestsMatching 'org.sonarqube.tests.Category5Suite'
break
case 'Category6':
includeTestsMatching 'org.sonarqube.tests.Category6Suite'
includeTestsMatching 'org.sonarqube.tests.organization.*Suite'
break
case 'Plugins':
includeTestsMatching 'org.sonarqube.tests.plugins.PluginsSuite'
break
case 'Upgrade':
includeTestsMatching 'org.sonarqube.tests.upgrade.UpgradeSuite'
break
case 'ServerPerformance':
includeTestsMatching 'org.sonarqube.tests.performance.server.ServerPerformanceSuite'
break
}
}
}

processTestResources() {
into('/') {
from configurations.includeInTestResources
// TODO cache not invalidated when pattern changes?
rename '(.*)-' + bytemanVersion + '.jar', '$1.jar'
}
}

+ 19
- 0
tests/plugins/access-secured-props-plugin/build.gradle View File

@@ -0,0 +1,19 @@
dependencies {
compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow')
}

jar {
manifest {
attributes(
'Plugin-Key': 'AccessSecuredPropsPlugin',
'Plugin-Version': '1.0.2.42',
'Plugin-Display-Version': '1.0.2 (build 42)',
'Plugin-Class': 'AccessSecuredPropsPlugin',
'Plugin-ChildFirstClassLoader': 'false',
'Sonar-Version': '7.1-SNAPSHOT',
'SonarLint-Supported': 'false',
'Plugin-Name': 'Plugins :: Access Secured PropertiesFoo',
'Plugin-License': 'GNU LGPL 3'
)
}
}

+ 0
- 38
tests/plugins/access-secured-props-plugin/pom.xml View File

@@ -1,38 +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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonarsource.sonarqube.tests</groupId>
<artifactId>plugins</artifactId>
<version>7.1-SNAPSHOT</version>
</parent>

<artifactId>access-secured-props-plugin</artifactId>
<packaging>sonar-plugin</packaging>
<name>Plugins :: Access Secured Properties</name>
<version>1.0.2.42</version>
<description>Access .secured properties</description>

<dependencies>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>${apiVersion}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.18.0.372</version>
<extensions>true</extensions>
<configuration>
<pluginClass>AccessSecuredPropsPlugin</pluginClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

+ 31
- 0
tests/plugins/backdating-customplugin/build.gradle View File

@@ -0,0 +1,31 @@
sonarqube {
skipProject = true
}

dependencies {
compile 'com.google.guava:guava'
compile 'commons-io:commons-io'
compile 'commons-lang:commons-lang'
compileOnly 'com.google.code.findbugs:jsr305'
compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow')
compileOnly project(':tests:plugins:backdating-plugin-v1')
}

jar {
manifest {
attributes(
'Plugin-Key': 'custombackdating',
'Plugin-Version': version,
'Plugin-Class': 'org.sonar.backdating.custom.BackdatingPlugin',
'Plugin-ChildFirstClassLoader': 'false',
'Sonar-Version': '7.1-SNAPSHOT',
'SonarLint-Supported': 'false',
'Plugin-Name': 'Custom',
'Plugin-License': 'GNU LGPL 3',
'Plugin-Base': 'backdating'
)
}
into('META-INF/lib') {
from configurations.compile
}
}

+ 0
- 0
tests/plugins/backdating-customplugin/pom.xml View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save