dremio distribution 模块简单说明

以下简单说明下dremio distribution,distribution 核心是进行项目的发布,这种模式经常在apache 类似项目中看到

参考项目结构

 

 

简单说明

  • jdbc-driver
    还是是对于jdbc 驱动的处理,实际上在dremio 的client/jdbc 中已经包含了jdbc 驱动了,但是为了方便使用(官方使用了shade 方式进行了处理,属于一种特别常见的玩法),同时官方为了简化pom 信息,使用了flatten-maven-plugin 插件(后边我会简单介绍下)具体的可以参考官方源码的配置
  • resources
    主要是dremio 实际运行需要的一些配置,同时还包含了官方自己包装的cli,rpm 包的一些配置信息
  • docker
    是官方docker 镜像构建的,实际上此文件,似乎自动dremio 22 之后官方就不维护了,但是可以参考学习
  • server
    此模块也是实际dremio 基于了maven-dependency-plugin以及maven-assembly-plugin 进行实际的打包处理,因为同时需要构建rpm 包
    也引用了rpm-maven-plugin ,如果了解dremio的玩法的话,同时会有一个特殊处理,就是对于社区一些插件同时包含了一个oss 的profile
    因为resource 实际上打包需要的都在resource 中,官方在打包的时候引用了resource 模块,参考使用
 
<plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>distro-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptorRefs>
                <descriptorRef>server-tarball</descriptorRef>  //引用server-tarball< ,但是server-tarball< 引用了不少其他配置,通过include 包含的(具体在resource 模块中)
              </descriptorRefs>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>${dremio.distribution.name}-${project.version}</finalName>
              <tarLongFileMode>gnu</tarLongFileMode>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.dremio.distribution</groupId>
            <artifactId>dremio-distribution-resources</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
</plugin>

说明

以上是对于dremio 软件包打包的一个简单说明,都是一般较大项目的标准打包玩法,通过dremio 的打包实际上我们也可以学到不少东西,实际的处理可以阅读源码

参考资料

https://github.com/dremio/dremio-oss
https://github.com/mojohaus/flatten-maven-plugin
https://www.mojohaus.org/flatten-maven-plugin/
https://maven.apache.org/plugins/maven-assembly-plugin/
https://github.com/apache/maven-assembly-plugin
https://www.mojohaus.org/rpm-maven-plugin/
https://github.com/mojohaus/rpm-maven-plugin

posted on 2023-01-17 19:57  荣锋亮  阅读(34)  评论(0编辑  收藏  举报

导航