diff options
Diffstat (limited to 'sonar-application')
-rw-r--r-- | sonar-application/assembly-common.xml | 19 | ||||
-rw-r--r-- | sonar-application/assembly.xml | 213 | ||||
-rw-r--r-- | sonar-application/build.gradle | 148 | ||||
-rw-r--r-- | sonar-application/pom.xml | 271 | ||||
-rw-r--r-- | sonar-application/src/main/assembly/logs/README.txt | 1 |
5 files changed, 149 insertions, 503 deletions
diff --git a/sonar-application/assembly-common.xml b/sonar-application/assembly-common.xml deleted file mode 100644 index 8d85b77149b..00000000000 --- a/sonar-application/assembly-common.xml +++ /dev/null @@ -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> diff --git a/sonar-application/assembly.xml b/sonar-application/assembly.xml deleted file mode 100644 index ccbf0a97315..00000000000 --- a/sonar-application/assembly.xml +++ /dev/null @@ -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> diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle new file mode 100644 index 00000000000..bb8b58b74dc --- /dev/null +++ b/sonar-application/build.gradle @@ -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 + } + } +} diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml deleted file mode 100644 index f599fb98c6a..00000000000 --- a/sonar-application/pom.xml +++ /dev/null @@ -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> diff --git a/sonar-application/src/main/assembly/logs/README.txt b/sonar-application/src/main/assembly/logs/README.txt new file mode 100644 index 00000000000..5608b3348d8 --- /dev/null +++ b/sonar-application/src/main/assembly/logs/README.txt @@ -0,0 +1 @@ +This directory contains log files. See advanced configuration in conf/sonar.properties. |