]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SQSCANNER-38 self-contained distributions for Linux, Windows and Mac OS X (#26)
authorJanos Gyerik <janos.gyerik@sonarsource.com>
Mon, 13 Mar 2017 16:22:57 +0000 (17:22 +0100)
committerGitHub <noreply@github.com>
Mon, 13 Mar 2017 16:22:57 +0000 (17:22 +0100)
15 files changed:
assembly.xml [deleted file]
it/pom.xml
it/src/test/java/com/sonar/runner/it/DistributionTest.java [new file with mode: 0644]
it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java
pom.xml
src/main/assembly/bin/sonar-runner
src/main/assembly/bin/sonar-scanner
src/main/assembly/bin/sonar-scanner.bat
src/main/assembly/dist-linux.xml [new file with mode: 0644]
src/main/assembly/dist-macosx.xml [new file with mode: 0644]
src/main/assembly/dist-windows.xml [new file with mode: 0644]
src/main/assembly/filter-dist.properties [new file with mode: 0644]
src/main/assembly/filter-noarch.properties [new file with mode: 0644]
src/main/assembly/noarch.xml [new file with mode: 0644]
travis.sh

diff --git a/assembly.xml b/assembly.xml
deleted file mode 100644 (file)
index cce6955..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-  <id>bin</id>
-  <formats>
-    <format>zip</format>
-  </formats>
-  <includeBaseDirectory>true</includeBaseDirectory>
-  <fileSets>
-    <fileSet>
-      <directory>src/main/assembly/bin</directory>
-      <outputDirectory>bin</outputDirectory>
-      <includes>
-        <include>sonar-runner.bat</include>
-        <include>sonar-scanner.bat</include>
-        <include>sonar-scanner-debug.bat</include>
-      </includes>
-      <lineEnding>dos</lineEnding>
-      <filtered>true</filtered>
-    </fileSet>
-    <fileSet>
-      <directory>src/main/assembly/bin</directory>
-      <outputDirectory>bin</outputDirectory>
-      <includes>
-        <include>sonar-runner</include>
-        <include>sonar-scanner</include>
-        <include>sonar-scanner-debug</include>
-      </includes>
-      <lineEnding>unix</lineEnding>
-      <fileMode>0755</fileMode>
-      <filtered>true</filtered>
-    </fileSet>
-    <fileSet>
-      <directory>src/main/assembly/conf</directory>
-      <outputDirectory>conf</outputDirectory>
-      <fileMode>0644</fileMode>
-      <lineEnding>dos</lineEnding>
-    </fileSet>
-    <fileSet>
-      <directory>${project.build.directory}</directory>
-      <outputDirectory>lib</outputDirectory>
-      <includes>
-        <include>${project.build.finalName}.jar</include>
-      </includes>
-    </fileSet>
-  </fileSets>
-</assembly>
index e5e66aa29a8e99632660d9e1e44c20d5d1d21e23..f84b78c5dcb9794fbba1161f5d02316905b8d14c 100644 (file)
@@ -31,7 +31,7 @@
     <dependency>
       <groupId>org.sonarsource.orchestrator</groupId>
       <artifactId>sonar-orchestrator</artifactId>
-      <version>3.13</version>
+      <version>3.15.0.974</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>
               </execution>
             </executions>
           </plugin>
+
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
                   <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip</artifact>
                 </configuration>
               </execution>
+              <execution>
+                <id>get-linux-scanner</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>get</goal>
+                </goals>
+                <configuration>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:linux</artifact>
+                </configuration>
+              </execution>
+              <execution>
+                <id>get-windows-scanner</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>get</goal>
+                </goals>
+                <configuration>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:windows</artifact>
+                </configuration>
+              </execution>
+              <execution>
+                <id>get-macosx-scanner</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>get</goal>
+                </goals>
+                <configuration>
+                  <artifact>org.sonarsource.scanner.cli:sonar-scanner-cli:${scanner.version}:zip:macosx</artifact>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
         </plugins>
diff --git a/it/src/test/java/com/sonar/runner/it/DistributionTest.java b/it/src/test/java/com/sonar/runner/it/DistributionTest.java
new file mode 100644 (file)
index 0000000..c38a1fa
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * SonarSource :: IT :: SonarQube Scanner
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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 com.sonar.runner.it;
+
+import com.sonar.orchestrator.build.BuildFailureException;
+import com.sonar.orchestrator.build.SonarScanner;
+import com.sonar.orchestrator.locator.ResourceLocation;
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import org.junit.After;
+import org.junit.Test;
+import org.sonarqube.ws.WsMeasures.Measure;
+
+import static java.lang.Integer.parseInt;
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DistributionTest extends ScannerTestCase {
+
+  @After
+  public void cleanup() {
+    orchestrator.resetData();
+  }
+
+  @Test
+  public void should_succeed_with_self_contained_jre_despite_rubbish_java_home() throws IOException, InterruptedException {
+    String projectKey = "java:basedir-with-source";
+    orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml"));
+    orchestrator.getServer().provisionProject(projectKey, "Basedir with source");
+    orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way");
+
+    File projectDir = new File("projects/basedir-with-source");
+    SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey)
+      .setEnvironmentVariable("JAVA_HOME", "nonexistent")
+      .useNative();
+    orchestrator.executeBuild(build, true);
+
+    Map<String, Measure> projectMeasures = getMeasures(projectKey, "files", "ncloc");
+    assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(1);
+    assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1);
+  }
+
+  @Test(expected = BuildFailureException.class)
+  public void should_fail_without_self_contained_jre_when_rubbish_java_home() throws IOException, InterruptedException {
+    String projectKey = "java:basedir-with-source";
+    orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml"));
+    orchestrator.getServer().provisionProject(projectKey, "Basedir with source");
+    orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way");
+
+    File projectDir = new File("projects/basedir-with-source");
+    SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey)
+      .setEnvironmentVariable("JAVA_HOME", "nonexistent");
+    orchestrator.executeBuild(build, true);
+  }
+}
index 890fe17b6f98719b9aafc5e6fe82e16b5f6ae938..c43446f1929b3f66256f121440481531143aa03d 100644 (file)
@@ -26,7 +26,7 @@ import org.junit.runners.Suite;
 import org.junit.runners.Suite.SuiteClasses;
 
 @RunWith(Suite.class)
-@SuiteClasses({JavaTest.class, MultimoduleTest.class})
+@SuiteClasses({JavaTest.class, MultimoduleTest.class, DistributionTest.class})
 public class SonarScannerTestSuite {
 
   @ClassRule
diff --git a/pom.xml b/pom.xml
index 4ca465a2f98e6e33e0575ceaf49ab8a702a48a95..31ce39ded4035287fdfed4bd3356061143de4d42 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
     <!-- used for deployment to SonarSource Artifactory -->
     <gitRepositoryName>sonar-scanner-cli</gitRepositoryName>
+
+    <!-- configuration for assembly of distributions -->
+    <unpack.dir>${project.build.directory}/unpack</unpack.dir>
+    <scanner.jar>${project.build.finalName}.jar</scanner.jar>
+    <jre.version>8u121</jre.version>
+    <jre.dirname.linux>jre1.8.0_121</jre.dirname.linux>
+    <jre.dirname.windows>jre1.8.0_121</jre.dirname.windows>
+    <jre.dirname.macosx>jre1.8.0_121.jre/Contents/Home</jre.dirname.macosx>
   </properties>
 
   <dependencies>
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <id>cli</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
               <appendAssemblyId>false</appendAssemblyId>
               <escapeString>\</escapeString>
               <descriptors>
-                <descriptor>${project.basedir}/assembly.xml</descriptor>
+                <descriptor>src/main/assembly/noarch.xml</descriptor>
               </descriptors>
+              <filters>
+                <filter>src/main/assembly/filter-noarch.properties</filter>
+              </filters>
             </configuration>
           </execution>
         </executions>
         <module>it</module>
       </modules>
     </profile>
+
+    <profile>
+      <id>dist-linux</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>3.0.0</version>
+            <executions>
+              <execution>
+                <id>unpack-linux</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>com.oracle</groupId>
+                      <artifactId>jre</artifactId>
+                      <version>${jre.version}</version>
+                      <classifier>linux-x64</classifier>
+                      <type>tar.gz</type>
+                      <overWrite>true</overWrite>
+                    </artifactItem>
+                  </artifactItems>
+                  <outputDirectory>${unpack.dir}/linux</outputDirectory>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>assemble-linux</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>sonar-scanner-${project.version}</finalName>
+                  <escapeString>\</escapeString>
+                  <descriptors>
+                    <descriptor>src/main/assembly/dist-linux.xml</descriptor>
+                  </descriptors>
+                  <filters>
+                    <filter>src/main/assembly/filter-dist.properties</filter>
+                  </filters>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <profile>
+      <id>dist-windows</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>3.0.0</version>
+            <executions>
+              <execution>
+                <id>unpack-windows</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>com.oracle</groupId>
+                      <artifactId>jre</artifactId>
+                      <version>${jre.version}</version>
+                      <classifier>windows-x64</classifier>
+                      <type>tar.gz</type>
+                      <overWrite>true</overWrite>
+                    </artifactItem>
+                  </artifactItems>
+                  <outputDirectory>${unpack.dir}/windows</outputDirectory>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>assemble-windows</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>sonar-scanner-${project.version}</finalName>
+                  <escapeString>\</escapeString>
+                  <descriptors>
+                    <descriptor>src/main/assembly/dist-windows.xml</descriptor>
+                  </descriptors>
+                  <filters>
+                    <filter>src/main/assembly/filter-dist.properties</filter>
+                  </filters>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <profile>
+      <id>dist-macosx</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>3.0.0</version>
+            <executions>
+              <execution>
+                <id>unpack-macosx</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <artifactItems>
+                <artifactItem>
+                  <groupId>com.oracle</groupId>
+                  <artifactId>jre</artifactId>
+                  <version>${jre.version}</version>
+                  <classifier>macosx-x64</classifier>
+                  <type>tar.gz</type>
+                  <overWrite>true</overWrite>
+                </artifactItem>
+              </artifactItems>
+              <outputDirectory>${unpack.dir}/macosx</outputDirectory>
+            </configuration>
+          </plugin>
+
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>assemble-macosx</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <finalName>sonar-scanner-${project.version}</finalName>
+                  <escapeString>\</escapeString>
+                  <descriptors>
+                    <descriptor>src/main/assembly/dist-macosx.xml</descriptor>
+                  </descriptors>
+                  <filters>
+                    <filter>src/main/assembly/filter-dist.properties</filter>
+                  </filters>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
+
 </project>
index 14e3a58dcbb87124524a09aa2a1b7575fcb137f2..a116ea443448afac200cfa6277be19a71d4a9820 100755 (executable)
@@ -36,9 +36,12 @@ sonar_runner_home=$(dirname "$script_path")/..
 # make it fully qualified
 sonar_runner_home=$(cd "$sonar_runner_home" && pwd)
 
-# check that the sonar_runner_home has been correctly set
-if [ ! -f "$sonar_runner_home/lib/sonar-scanner-cli-${project.version}.jar" ] ; then
-  echo '$sonar_runner_home' does not point to a valid installation directory: $sonar_runner_home
+jar_file=$sonar_runner_home/lib/sonar-scanner-cli-${project.version}.jar
+
+# check that sonar_runner_home has been correctly set
+if [ ! -f "$jar_file" ] ; then
+  echo "File does not exist: $jar_file"
+  echo "'$sonar_runner_home' does not point to a valid installation directory: $sonar_runner_home"
   exit 1
 fi
 
@@ -57,7 +60,6 @@ then
   fi
 fi
 
-jar_file=${sonar_runner_home}/lib/sonar-scanner-cli-${project.version}.jar
 project_home=$(pwd)
 
 #echo "Info: Using sonar-runner at $sonar_runner_home"
index 38f009520ac28d7468c395eeff03552329579b06..b0c19f36bd4e0f435940a9e65ec25e570432237d 100755 (executable)
@@ -35,12 +35,20 @@ sonar_scanner_home=$(dirname "$script_path")/..
 # make it fully qualified
 sonar_scanner_home=$(cd "$sonar_scanner_home" && pwd -P)
 
+jar_file=$sonar_scanner_home/lib/sonar-scanner-cli-${project.version}.jar
+
 # check that sonar_scanner_home has been correctly set
-if [ ! -f "$sonar_scanner_home/lib/sonar-scanner-cli-${project.version}.jar" ] ; then
-  echo '$sonar_scanner_home' does not point to a valid installation directory: $sonar_scanner_home
+if [ ! -f "$jar_file" ] ; then
+  echo "File does not exist: $jar_file"
+  echo "'$sonar_scanner_home' does not point to a valid installation directory: $sonar_scanner_home"
   exit 1
 fi
 
+use_embedded_jre=${use_embedded_jre}
+if [ "$use_embedded_jre" = true ]; then
+  export JAVA_HOME=$sonar_scanner_home/lib/jre
+fi
+
 if [ -n "$JAVA_HOME" ]
 then
   java_cmd="$JAVA_HOME/bin/java"
@@ -48,7 +56,6 @@ else
   java_cmd="$(which java)"
 fi
 
-jar_file=${sonar_scanner_home}/lib/sonar-scanner-cli-${project.version}.jar
 project_home=$(pwd)
 
 #echo "Info: Using sonar-scanner at $sonar_scanner_home"
index bd4c9207a841b926b3e5bde7edffe609bdeeddf7..833dcbb83365afd7e62fc57eb0e754ab3543bca4 100644 (file)
@@ -13,8 +13,16 @@ set ERROR_CODE=0
 @REM set local scope for the variables with windows NT shell
 @setlocal
 
+set SONAR_SCANNER_HOME=%~dp0..
+
 @REM ==== START VALIDATION ====
 @REM *** JAVA EXEC VALIDATION ***
+
+set use_embedded_jre=${use_embedded_jre}
+if "%use_embedded_jre%" == "true" (
+  set JAVA_HOME=%SONAR_SCANNER_HOME%\lib\jre
+)
+
 if not "%JAVA_HOME%" == "" goto foundJavaHome
 
 for %%i in (java.exe) do set JAVA_EXEC=%%~$PATH:i
@@ -47,7 +55,6 @@ goto error
 set JAVA_EXEC="%JAVA_HOME%\bin\java.exe"
 
 :OkJava
-set SONAR_SCANNER_HOME=%~dp0..
 goto run
 
 
diff --git a/src/main/assembly/dist-linux.xml b/src/main/assembly/dist-linux.xml
new file mode 100644 (file)
index 0000000..d4d1923
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+  <id>linux</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+
+    <!-- jre basic, except bin/ -->
+    <fileSet>
+      <directory>${unpack.dir}/linux/${jre.dirname.linux}</directory>
+      <outputDirectory>lib/jre</outputDirectory>
+      <excludes>
+        <exclude>bin/**</exclude>
+        <exclude>man/**</exclude>
+        <exclude>plugin/**</exclude>
+      </excludes>
+    </fileSet>
+
+    <!-- jre bin/java -->
+    <fileSet>
+      <directory>${unpack.dir}/linux/${jre.dirname.linux}/bin</directory>
+      <outputDirectory>lib/jre/bin</outputDirectory>
+      <includes>
+        <include>java</include>
+      </includes>
+      <fileMode>0755</fileMode>
+    </fileSet>
+
+    <!-- scanner files -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>lib</outputDirectory>
+      <fileMode>0644</fileMode>
+      <includes>
+        <include>${scanner.jar}</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+      <fileMode>0644</fileMode>
+      <lineEnding>unix</lineEnding>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <fileMode>0755</fileMode>
+      <lineEnding>unix</lineEnding>
+      <filtered>true</filtered>
+      <includes>
+        <include>sonar-scanner</include>
+        <include>sonar-scanner-debug</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/src/main/assembly/dist-macosx.xml b/src/main/assembly/dist-macosx.xml
new file mode 100644 (file)
index 0000000..65ad78e
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+  <id>macosx</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+
+    <!-- jre basic, except bin/ -->
+    <fileSet>
+      <directory>${unpack.dir}/macosx/${jre.dirname.macosx}</directory>
+      <outputDirectory>lib/jre</outputDirectory>
+      <excludes>
+        <exclude>bin/**</exclude>
+        <exclude>man/**</exclude>
+      </excludes>
+    </fileSet>
+
+    <!-- jre bin/java -->
+    <fileSet>
+      <directory>${unpack.dir}/macosx/${jre.dirname.macosx}/bin</directory>
+      <outputDirectory>lib/jre/bin</outputDirectory>
+      <includes>
+        <include>java</include>
+      </includes>
+      <fileMode>0755</fileMode>
+    </fileSet>
+
+    <!-- scanner files -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>lib</outputDirectory>
+      <fileMode>0644</fileMode>
+      <includes>
+        <include>${scanner.jar}</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+      <fileMode>0644</fileMode>
+      <lineEnding>unix</lineEnding>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <fileMode>0755</fileMode>
+      <lineEnding>unix</lineEnding>
+      <filtered>true</filtered>
+      <includes>
+        <include>sonar-scanner</include>
+        <include>sonar-scanner-debug</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/src/main/assembly/dist-windows.xml b/src/main/assembly/dist-windows.xml
new file mode 100644 (file)
index 0000000..132859b
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+  <id>windows</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+
+    <!-- jre basic, except bin/ -->
+    <fileSet>
+      <directory>${unpack.dir}/windows/${jre.dirname.windows}</directory>
+      <outputDirectory>lib/jre</outputDirectory>
+      <excludes>
+        <exclude>bin/**</exclude>
+        <exclude>man/**</exclude>
+        <exclude>plugin/**</exclude>
+      </excludes>
+    </fileSet>
+
+    <!-- jre bin -->
+    <fileSet>
+      <directory>${unpack.dir}/windows/${jre.dirname.windows}/bin</directory>
+      <outputDirectory>lib/jre/bin</outputDirectory>
+      <fileMode>0755</fileMode>
+    </fileSet>
+
+    <!-- scanner files -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>lib</outputDirectory>
+      <fileMode>0644</fileMode>
+      <includes>
+        <include>${scanner.jar}</include>
+      </includes>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+      <fileMode>0644</fileMode>
+      <lineEnding>unix</lineEnding>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <fileMode>0755</fileMode>
+      <lineEnding>dos</lineEnding>
+      <filtered>true</filtered>
+      <includes>
+        <include>sonar-scanner.bat</include>
+        <include>sonar-scanner-debug.bat</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/src/main/assembly/filter-dist.properties b/src/main/assembly/filter-dist.properties
new file mode 100644 (file)
index 0000000..b7bbc34
--- /dev/null
@@ -0,0 +1 @@
+use_embedded_jre=true
diff --git a/src/main/assembly/filter-noarch.properties b/src/main/assembly/filter-noarch.properties
new file mode 100644 (file)
index 0000000..b1c9e92
--- /dev/null
@@ -0,0 +1 @@
+use_embedded_jre=false
diff --git a/src/main/assembly/noarch.xml b/src/main/assembly/noarch.xml
new file mode 100644 (file)
index 0000000..cce6955
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>bin</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>src/main/assembly/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <includes>
+        <include>sonar-runner.bat</include>
+        <include>sonar-scanner.bat</include>
+        <include>sonar-scanner-debug.bat</include>
+      </includes>
+      <lineEnding>dos</lineEnding>
+      <filtered>true</filtered>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <includes>
+        <include>sonar-runner</include>
+        <include>sonar-scanner</include>
+        <include>sonar-scanner-debug</include>
+      </includes>
+      <lineEnding>unix</lineEnding>
+      <fileMode>0755</fileMode>
+      <filtered>true</filtered>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/assembly/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+      <fileMode>0644</fileMode>
+      <lineEnding>dos</lineEnding>
+    </fileSet>
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>${project.build.finalName}.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>
index 1920484f111911cfd862e0f409484f63a2707037..81cd7580eb33fdddbecb57316057f4d42a31e645 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -11,5 +11,5 @@ configureTravis
 
 export DEPLOY_PULL_REQUEST=true
 
-regular_mvn_build_deploy_analyze
+regular_mvn_build_deploy_analyze -Pdist-linux,dist-windows,dist-macosx