aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-application
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-23 16:29:16 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-23 16:29:26 +0200
commit7287de7b4b608170ed6f30b4fe1527ca0af95cbe (patch)
tree0fef238e3c4f442af523179eef79d30cec9f382e /sonar-application
parentef7ea907fb15566ca22d716a5afaa400ffafbaea (diff)
downloadsonarqube-7287de7b4b608170ed6f30b4fe1527ca0af95cbe.tar.gz
sonarqube-7287de7b4b608170ed6f30b4fe1527ca0af95cbe.zip
SONAR-4898 - Shaded sonar-application. Now app can run with "java -jar lib/sonar*.jar
Diffstat (limited to 'sonar-application')
-rw-r--r--sonar-application/assembly.xml19
-rw-r--r--sonar-application/pom.xml77
-rw-r--r--sonar-application/src/main/assembly/lib/jsw/wrapper.conf5
3 files changed, 70 insertions, 31 deletions
diff --git a/sonar-application/assembly.xml b/sonar-application/assembly.xml
index e0166150ec8..2304815d061 100644
--- a/sonar-application/assembly.xml
+++ b/sonar-application/assembly.xml
@@ -25,6 +25,7 @@
<includes>
<include>tanukisoft:wrapper</include>
</includes>
+ <scope>provided</scope>
</dependencySet>
@@ -37,13 +38,15 @@
<exclude>org.postgresql:postgresql</exclude>
<exclude>net.sourceforge.jtds:jtds</exclude>
<exclude>tanukisoft:wrapper</exclude>
+ <exclude>tanukisoft:wrapper</exclude>
<exclude>org.codehaus.sonar:sonar-server-app</exclude>
<exclude>org.codehaus.sonar:sonar-web</exclude>
<exclude>org.codehaus.sonar:sonar-search</exclude>
<exclude>org.codehaus.sonar.plugins:*</exclude>
<exclude>org.codehaus.sonar-plugins.java:*</exclude>
- <exclude>org.codehaus.sonar:sonar-batch-maven-compat</exclude>
+ <exclude>org.sonatype.jsw-binaries:jsw-binaries</exclude>
</excludes>
+ <scope>runtime</scope>
</dependencySet>
@@ -55,7 +58,7 @@
<includes>
<include>org.codehaus.sonar:sonar-search</include>
</includes>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependencySet>
<dependencySet>
@@ -65,7 +68,7 @@
<includes>
<include>org.codehaus.sonar:sonar-server-app</include>
</includes>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependencySet>
@@ -76,6 +79,7 @@
<includes>
<include>org.codehaus.sonar:sonar-batch-maven-compat</include>
</includes>
+ <scope>provided</scope>
</dependencySet>
<!-- Plugins -->
<dependencySet>
@@ -84,6 +88,7 @@
<includes>
<include>org.codehaus.sonar.plugins:*</include>
</includes>
+ <scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>lib/bundled-plugins</outputDirectory>
@@ -91,6 +96,7 @@
<includes>
<include>org.codehaus.sonar-plugins.*:sonar-*-plugin</include>
</includes>
+ <scope>provided</scope>
</dependencySet>
<!-- Server -->
<dependencySet>
@@ -99,6 +105,7 @@
<include>org.codehaus.sonar:sonar-web</include>
</includes>
<unpack>true</unpack>
+ <scope>provided</scope>
</dependencySet>
<!-- JDBC drivers -->
<dependencySet>
@@ -107,7 +114,7 @@
<include>mysql:mysql-connector-java</include>
</includes>
<unpack>false</unpack>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>extensions/jdbc-driver/postgresql/</outputDirectory>
@@ -115,7 +122,7 @@
<include>org.postgresql:postgresql</include>
</includes>
<unpack>false</unpack>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependencySet>
<dependencySet>
<outputDirectory>extensions/jdbc-driver/mssql/</outputDirectory>
@@ -123,7 +130,7 @@
<include>net.sourceforge.jtds:jtds</include>
</includes>
<unpack>false</unpack>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependencySet>
<!-- Java Service Wrapper -->
<dependencySet>
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml
index 14d129a9dfc..7bdaba42b25 100644
--- a/sonar-application/pom.xml
+++ b/sonar-application/pom.xml
@@ -22,6 +22,7 @@
<artifactId>sonar-process</artifactId>
<version>${project.version}</version>
</dependency>
+
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@@ -32,42 +33,42 @@
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-server-app</artifactId>
<version>${project.version}</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-search</artifactId>
<version>${project.version}</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-batch-maven-compat</artifactId>
<version>${project.version}</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-web</artifactId>
<version>${project.version}</version>
<type>war</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<!-- core plugins -->
@@ -76,76 +77,76 @@
<artifactId>sonar-core-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-design-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-findbugs-plugin</artifactId>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-dbcleaner-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-squid-java-plugin</artifactId>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-surefire-plugin</artifactId>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-cpd-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-l10n-en-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-email-notifications-plugin</artifactId>
<version>${project.version}</version>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-jacoco-plugin</artifactId>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar-plugins.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
<type>sonar-plugin</type>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.sonatype.jsw-binaries</groupId>
- <artifactId>jsw-binaries</artifactId>
+ <groupId>org.sonatype.jsw-binaries</groupId>
+ <artifactId>jsw-binaries</artifactId>
<version>3.2.3.6</version>
<type>tar.gz</type>
<scope>provided</scope>
@@ -155,7 +156,7 @@
<groupId>tanukisoft</groupId>
<artifactId>wrapper</artifactId>
<version>3.2.3</version>
- <scope>runtime</scope>
+ <scope>provided</scope>
</dependency>
<!-- unit tests -->
@@ -189,6 +190,39 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <archive>
+ <index>true</index>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ <mainClass>org.sonar.application.StartServer</mainClass>
+ </manifest>
+ <manifestEntries>
+ <mode>distribution</mode>
+ <url>${project.url}</url>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
@@ -250,7 +284,6 @@
</plugin>
</plugins>
</build>
-
<profiles>
<profile>
<id>release</id>
diff --git a/sonar-application/src/main/assembly/lib/jsw/wrapper.conf b/sonar-application/src/main/assembly/lib/jsw/wrapper.conf
index 922f9afec75..c4bb513a8a3 100644
--- a/sonar-application/src/main/assembly/lib/jsw/wrapper.conf
+++ b/sonar-application/src/main/assembly/lib/jsw/wrapper.conf
@@ -20,9 +20,8 @@ wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
-wrapper.java.classpath.1=../../lib/common/*.jar
-wrapper.java.classpath.2=../../lib/jsw/*.jar
-wrapper.java.classpath.3=../../lib/*.jar
+wrapper.java.classpath.1=../../lib/jsw/*.jar
+wrapper.java.classpath.2=../../lib/*.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=./lib