You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/11/23 23:01:49 UTC
[2/4] storm git commit: use maven antrun plugin to download and
unpack sigar native binaries
use maven antrun plugin to download and unpack sigar native binaries
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/c4555600
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/c4555600
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/c4555600
Branch: refs/heads/master
Commit: c4555600d7441987dfa7d81200f0058aaa38560b
Parents: 83eced3
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Thu Nov 19 15:07:14 2015 -0500
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Thu Nov 19 15:07:14 2015 -0500
----------------------------------------------------------------------
external/storm-metrics/pom.xml | 58 ++++++++++++++++++++++++-------------
1 file changed, 38 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/c4555600/external/storm-metrics/pom.xml
----------------------------------------------------------------------
diff --git a/external/storm-metrics/pom.xml b/external/storm-metrics/pom.xml
index 9ae00a1..a2fa3ec 100644
--- a/external/storm-metrics/pom.xml
+++ b/external/storm-metrics/pom.xml
@@ -30,16 +30,25 @@
<name>storm-metrics</name>
+ <properties>
+ <!-- settings for downloading the sigar native binary complete archive, which is not available in Maven central-->
+ <sigar.version>1.6.4</sigar.version>
+ <sigar.download.url>https://magelan.googlecode.com/files/hyperic-sigar-${sigar.version}.zip</sigar.download.url>
+ <sigar.SHA1>8f79d4039ca3ec6c88039d5897a80a268213e6b7</sigar.SHA1>
+ <!-- this will download the sigar ZIP to the local maven repository next to the sigar dependencies,
+ so we only download it once -->
+ <sigar.download.path>${settings.localRepository}/org/fusesource/sigar/${sigar.version}</sigar.download.path>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
</dependency>
<dependency>
- <!-- DO NOT CHANGE THE VERSION OF THIS PACKAGE WITHOUT UPDATING THE NATIVE LIBRARIES in src/main/resources/resources -->
<groupId>org.fusesource</groupId>
<artifactId>sigar</artifactId>
- <version>1.6.4</version>
+ <version>${sigar.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
@@ -48,13 +57,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.fusesource</groupId>
- <artifactId>sigar</artifactId>
- <version>1.6.4</version>
- <classifier>native</classifier>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>${project.version}</version>
@@ -66,21 +68,37 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.10</version>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
<executions>
<execution>
- <id>unpack-dependencies</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
+ <id>prepare</id>
+ <phase>validate</phase>
<configuration>
- <outputDirectory>${project.build.directory}/classes/resources/resources</outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <includes>**/*.dylib,**/*.so</includes>
+ <tasks>
+ <echo message="Downloading sigar native binaries..."/>
+ <get src="${sigar.download.url}"
+ dest="${sigar.download.path}/" skipExisting="true"/>
+ <checksum file="${sigar.download.path}/hyperic-sigar-${sigar.version}.zip" algorithm="SHA1"
+ property="${sigar.SHA1}" verifyProperty="validChecksum"/>
+ <fail message="Checksum validation failed for hyperic-sigar-${sigar.version}.zip">
+ <condition>
+ <isfalse value="${validChecksum}"/>
+ </condition>
+ </fail>
+ <unzip src="${sigar.download.path}/hyperic-sigar-${sigar.version}.zip"
+ dest="${project.build.directory}/classes/resources">
+ <patternset>
+ <include name="**/lib/libsigar-*"/>
+ <include name="**/lib/sigar-*"/>
+ </patternset>
+ <mapper type="flatten"/>
+ </unzip>
+ </tasks>
</configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
</execution>
</executions>
</plugin>