From ac0820a7e96b3eb90e6eb2841260aa5b0989ffa8 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Tue, 22 Jul 2014 15:31:45 +0200 Subject: Working the assembly for packaging. --- fork.sh | 2 +- .../src/main/java/org/sonar/process/Process.java | 1 + .../java/org/sonar/process/ProcessWrapper.java | 4 +++- server/sonar-search/pom.xml | 19 ---------------- .../org/sonar/server/platform/logback.xml | 2 ++ sonar-application/assembly.xml | 25 +++++++++++++++++----- sonar-application/pom.xml | 1 + .../src/main/assembly/conf/wrapper.conf | 4 +++- .../java/org/sonar/application/ForkProcesses.java | 2 ++ 9 files changed, 33 insertions(+), 27 deletions(-) diff --git a/fork.sh b/fork.sh index f2ee7459a96..e5a9237af30 100755 --- a/fork.sh +++ b/fork.sh @@ -1,6 +1,6 @@ #!/bin/sh -mvn clean install -DskipTests -Denforcer.skip=true $* +mvn clean install -DskipTests -Denforcer.skip=true -pl server/sonar-process,sonar-application if [[ "$OSTYPE" == "darwin"* ]]; then OS='macosx-universal-64' diff --git a/server/sonar-process/src/main/java/org/sonar/process/Process.java b/server/sonar-process/src/main/java/org/sonar/process/Process.java index 045a5dcd0b9..d003bf153b9 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/Process.java +++ b/server/sonar-process/src/main/java/org/sonar/process/Process.java @@ -188,6 +188,7 @@ public abstract class Process implements ProcessMXBean { } } LOGGER.trace("Process[{}]::terminate() END", name); + System.exit(1); } public final void terminate() { diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java index 0f0f8ff2fd0..d2640f827b7 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessWrapper.java @@ -157,7 +157,9 @@ public class ProcessWrapper extends Thread { private List getClassPath() { // java specification : "multiple path entries are separated by semi-colons", not by // system file separator, - return ImmutableList.of("-cp", StringUtils.join(classPath, ";")); + String separator = System.getProperty("file.separator"); + + return ImmutableList.of("-cp", StringUtils.join(classPath, ":")); } private String getPropertyFile() { diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index f9803aa76a9..d57bfd61bd6 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -53,23 +53,4 @@ test - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - - - ${pom.artifactId}-${pom.version} - - - - diff --git a/server/sonar-server/src/main/resources/org/sonar/server/platform/logback.xml b/server/sonar-server/src/main/resources/org/sonar/server/platform/logback.xml index a4a640e59b1..ddd8285d181 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/platform/logback.xml +++ b/server/sonar-server/src/main/resources/org/sonar/server/platform/logback.xml @@ -52,6 +52,8 @@ + + diff --git a/sonar-application/assembly.xml b/sonar-application/assembly.xml index 9769089b39b..bc4eed0b655 100644 --- a/sonar-application/assembly.xml +++ b/sonar-application/assembly.xml @@ -14,20 +14,35 @@ mysql:mysql-connector-java org.postgresql:postgresql net.sourceforge.jtds:jtds + tanukisoft:wrapper org.codehaus.sonar:sonar-search + org.codehaus.sonar:sonar-process org.codehaus.sonar:sonar-web org.codehaus.sonar.plugins:* org.codehaus.sonar-plugins.java:* org.codehaus.sonar:sonar-batch-maven-compat + + lib/search - true - false - - org.codehaus.sonar:sonar-search - + true + lib + true + + mysql:mysql-connector-java + org.postgresql:postgresql + net.sourceforge.jtds:jtds + tanukisoft:wrapper + org.codehaus.sonar:sonar-search + org.codehaus.sonar:sonar-process + org.codehaus.sonar:sonar-web + org.codehaus.sonar.plugins:* + org.codehaus.sonar-plugins.java:* + org.codehaus.sonar:sonar-batch-maven-compat + + lib/batch diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 465c9b5902f..85255196142 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -91,6 +91,7 @@ ${project.version} runtime + org.codehaus.sonar sonar-web diff --git a/sonar-application/src/main/assembly/conf/wrapper.conf b/sonar-application/src/main/assembly/conf/wrapper.conf index 043748ead08..0bd63d41d28 100644 --- a/sonar-application/src/main/assembly/conf/wrapper.conf +++ b/sonar-application/src/main/assembly/conf/wrapper.conf @@ -31,7 +31,9 @@ wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp # Java Classpath (include wrapper.jar) Add class path elements as # needed starting from 1 -wrapper.java.classpath.1=../../lib/*.jar +wrapper.java.classpath.1=../../lib/proc/*.jar +wrapper.java.classpath.2=../../lib/jsw/*.jar +wrapper.java.classpath.3=../../lib/*.jar # Java Library Path (location of Wrapper.DLL or libwrapper.so) diff --git a/sonar-application/src/main/java/org/sonar/application/ForkProcesses.java b/sonar-application/src/main/java/org/sonar/application/ForkProcesses.java index de46a32c8fe..9329dfffbf4 100644 --- a/sonar-application/src/main/java/org/sonar/application/ForkProcesses.java +++ b/sonar-application/src/main/java/org/sonar/application/ForkProcesses.java @@ -64,6 +64,7 @@ public class ForkProcesses { "org.sonar.search.ElasticSearch", installation.props(), "ES", + installation.starPath("lib/proc"), installation.starPath("lib/search")); monitor.registerProcess(elasticsearch); @@ -74,6 +75,7 @@ public class ForkProcesses { "org.sonar.server.app.ServerProcess", installation.props(), "SQ", + installation.starPath("lib/proc"), installation.starPath("lib")); monitor.registerProcess(server); -- cgit v1.2.3