From 5db7e781e4961132d02909ddb47beace7c561ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E7=A5=A5?= <1366971433@qq.com> Date: Thu, 30 May 2019 11:30:23 +0800 Subject: [PATCH] =?UTF-8?q?Storm=E4=B8=89=E7=A7=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=AF=B9=E6=AF=94=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/Storm三种打包方式对比分析.md | 45 ++------------------ 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/notes/Storm三种打包方式对比分析.md b/notes/Storm三种打包方式对比分析.md index 4e42eea..fc12ce2 100644 --- a/notes/Storm三种打包方式对比分析.md +++ b/notes/Storm三种打包方式对比分析.md @@ -55,8 +55,6 @@ HDPRepo^http://repo.hortonworks.com/content/groups/public/" ## 三、maven-assembly-plugin插件 -### 3.1 官方文档说明 - maven-assembly-plugin是官方文档中介绍的打包方法,来源于官方文档:[Running Topologies on a Production Cluster](http://storm.apache.org/releases/2.0.0-SNAPSHOT/Running-topologies-on-a-production-cluster.html) > If you're using Maven, the [Maven Assembly Plugin](http://maven.apache.org/plugins/maven-assembly-plugin/) can do the packaging for you. Just add this to your pom.xml: @@ -84,46 +82,9 @@ maven-assembly-plugin是官方文档中介绍的打包方法,来源于官方 - maven-assembly-plugin会把所有的依赖一并打包到最后的JAR中; - 需要排除掉Storm集群环境中已经提供的Storm jars。 -maven-assembly-plugin的使用非常简单,只需要在POM.xml中引入即可,并且在\标签指定打包格式为`jar-with-dependencies`。`jar-with-dependencies`是Maven官方内置的一种打包格式,在Maven官方文档[Pre-defined Descriptor Files](http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html)中有所说明。 +所以采用maven-assembly-plugin进行打包时候,配置应该如下: -
- -按照文档要求你还要排除集群环境中已经提供的Storm jars,主要是`storm-core`,此时可以使用`excludes`标签进行排除: - -```xml - - - jar-with-dependencies - - - - jar - - - false - - - / - true - true - runtime - - - org.apache.storm:storm-core - - - - -``` - -### 3.2 最终配置 - -所以采用maven-assembly-plugin进行打包时候,最终的配置应该如下: - -#### 1. 引入插件 +### 1. 引入插件 在POM.xml中引入插件,并指定打包格式的配置文件`assembly.xml`(名称可自定义): @@ -180,7 +141,7 @@ assembly.xml文件内容如下: >在配置文件中不仅可以排除依赖,还可以排除指定的文件,更多的配置规则可以参考官方文档:[Descriptor Format](http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#) -#### 2. 打包命令 +### 2. 打包命令 采用maven-assembly-plugin进行打包时命令如下: