TT Bigdata TT Bigdata
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop-官方组件
    • 专区—Bigtop-扩展组件
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 核心代码

    • 各组件代码
    • 通用代码模板
  • 国产化&其他系统

    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 支持&共建

    • 蓝图愿景
    • 技术支持
    • 合作共建
登陆
GitHub (opens new window)

JaneTTR

数据酿造智慧,每一滴都是沉淀!
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop-官方组件
    • 专区—Bigtop-扩展组件
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 核心代码

    • 各组件代码
    • 通用代码模板
  • 国产化&其他系统

    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 支持&共建

    • 蓝图愿景
    • 技术支持
    • 合作共建
登陆
GitHub (opens new window)
  • Sqoop编译

    • version-1.4.7

      • Sqoop_1.4.7编译
      • [O]Sqoop版本适配改造(一)
      • [B] Sqoop 版本适配改造(一)
      • [B] Sqoop 版本适配改造(二)
        • 第二步:增加 patch3-SQOOP-COMPILE-FAST.diff 文件
          • 核心 diff 内容解析
        • 实战操作步骤
        • 完整的 diff 文件如下
      • [B] Sqoop 版本适配改造(三)
  • Ranger编译

  • Phoenix编译

  • Dolphinscheduler编译

  • Doris编译

  • Cloudbeaver编译

  • Atlas编译

  • Superset编译

  • Celeborn编译

  • Ozone编译

  • Impala编译

  • Trino编译

  • Paimon编译

  • Hudi编译

  • 组件编译-Bigtop-增强
  • Sqoop编译
  • version-1.4.7
JaneTTR
2025-05-06
目录

[B] Sqoop 版本适配改造(二)

# 第二步:增加 patch3-SQOOP-COMPILE-FAST.diff 文件

在实际的 Sqoop 适配中,为进一步加快编译速度,推荐增加 patch3-SQOOP-COMPILE-FAST.diff 补丁。此 patch 主要优化了依赖管理逻辑和 Ivy 配置,让整体构建流程显著提速。

image-20250621154531114

提示

如上图,补丁文件一般存放于 bigtop/package/src/sqoop/patches/ 目录,命名清晰便于维护。 patch3-SQOOP-COMPILE-FAST.diff 的主要目的是精简 ivy.xml 依赖声明和优化 ivysettings.xml 仓库配置,减少外网请求、关闭 checksum 校验,有效提升离线/内网编译成功率。

# 核心 diff 内容解析

下面是本补丁的主要内容及改动亮点:

diff --git a/ivy.xml b/ivy.xml
index 5d8ccf7..ffc22ed 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -20,7 +20,7 @@ under the License.
 <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
-  <info organisation="com.cloudera.sqoop" module="${name}">
+  <info organisation="com.cloudera.sqoop" module="${name}" revision="1.4.7">
...
+    <dependency org="javax.activation" name="javax.activation-api" rev="1.2.0"/>
...
+      <exclude org="javax.activation" module="javax.activation-api"/>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  • 新增 javax.activation 明确版本,规避潜在冲突
  • 精准排除无关依赖,让编译更清爽
diff --git a/ivy/ivysettings.xml b/ivysettings.xml
@@ -1,110 +1,78 @@
+    <checksums algorithm=""/>
+    <credentials host="${repo.maven.org}" username="${repo.user}" passwd="${repo.pass}"/>
...
+    <property name="repo.dir" value="${basedir}/ivy/repository"/>
+    <property name="ivy.cache.dir" value="${basedir}/ivy/cache"/>
...
+        <chain name="default" dual="true" checkmodified="false" changingPattern=".*SNAPSHOT">
+            <resolver ref="fs2"/>
+            <resolver ref="fs"/>
+            <resolver ref="maven2"/>
+        </chain>
1
2
3
4
5
6
7
8
9
10
11
12
13
依赖提速
  • 关闭校验算法与远程拉取,加快本地仓库依赖解析速度
  • 优化 resolver 顺序,避免网络波动导致的编译卡死或失败

# 实战操作步骤

  1. 将补丁文件放入 patches 目录,与主 spec/gradle 文件统一管理。
  2. 确保 RPM spec 或 build.gradle 增加 patch 步骤,自动应用每次构建流程。
  3. 编译时关注依赖拉取与 patch 生效情况,如遇 jar 缺失优先检查本地仓库或 tarball 包。

注意

如果 patch 应用后仍遇到依赖异常或拉取超时,建议:

  • 复查 patch 内容是否与环境实际需求一致
  • 本地仓库提前准备所有 jar,确保离线编译链路无死角

# 完整的 diff 文件如下

diff --git a/ivy.xml b/ivy.xml
index 5d8ccf7..ffc22ed 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -20,7 +20,7 @@ under the License.
 <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
-  <info organisation="com.cloudera.sqoop" module="${name}">
+  <info organisation="com.cloudera.sqoop" module="${name}" revision="1.4.7">
     <license name="Apache 2.0"/>
     <ivyauthor name="Sqoop Team" url="http://github.com/cloudera/sqoop" />
     <description>
@@ -189,6 +189,7 @@ under the License.
       <exclude org="org.apache.thrift" module="thrift"/>
       <exclude org="log4j" module="log4j"/>
     </dependency>
+    <dependency org="javax.activation" name="javax.activation-api" rev="1.2.0"/>
     <dependency org="org.apache.hbase" name="hbase-hadoop2-compat" rev="${hbase.version}" conf="common->default">
       <artifact name="hbase-hadoop2-compat" type="jar"/>
       <artifact name="hbase-hadoop2-compat" type="test-jar" ext="jar" m:classifier="tests"/>
@@ -198,6 +199,7 @@ under the License.
       <exclude org="org.apache.thrift" module="thrift"/>
       <exclude org="log4j" module="log4j"/>
       <exclude org="org.apache.avro" module="avro" />
+      <exclude org="javax.activation" module="javax.activation-api"/>
     </dependency>

     <dependency org="org.apache.hive.hcatalog" name="hive-hcatalog-core"
diff --git a/ivy/ivysettings.xml b/ivy/ivysettings.xml
index 62b0348..d7fddb7 100644
--- a/ivy/ivysettings.xml
+++ b/ivy/ivysettings.xml
@@ -1,110 +1,78 @@
 <ivysettings>

- <!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
- <!--
-  see http://www.jayasoft.org/ivy/doc/configuration
-  -->
-  <!-- you can override this property to use mirrors
-          https://repo1.maven.org/maven2/
-          http://mirrors.dotsrc.org/maven2
-          http://ftp.ggi-project.org/pub/packages/maven2
-          http://mirrors.sunsite.dk/maven2
-          http://public.planetmirror.com/pub/maven2
-          http://ibiblio.lsu.edu/main/pub/packages/maven2
-          http://www.ibiblio.net/pub/packages/maven2
-  -->
-  <property name="repo.maven.org" value="https://repo1.maven.org/maven2/"
-      override="false"/>
-  <property name="snapshot.apache.org"
-      value="https://repository.apache.org/content/repositories/snapshots/"
-      override="false"/>
-  <property name="staging.cloudera.com"
-      value="https://repository.cloudera.com/content/repositories/staging/"
-      override="false"/>
-  <property name="releases.cloudera.com"
-      value="https://repository.cloudera.com/content/repositories/releases/"
-      override="false"/>
-  <property name="www.datanucleus.org"
-      value="http://www.datanucleus.org/downloads/maven2/"
-      override="false"/>
-  <property name="maven2.pattern"
-      value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])"/>
-  <property name="repo.dir" value="${user.home}/.m2/repository"/>
-  <property name="ivy.cache.dir" value="${user.home}/.ivy2/cache"/>
-  <property name="maven2.pattern.ext"  value="${maven2.pattern}.[ext]"/>
-  <property name="resolvers" value="default" override="false"/>
-  <settings defaultResolver="${resolvers}"/>
-
-  <resolvers>
-    <ibiblio name="maven2" root="${repo.maven.org}"
-        pattern="${maven2.pattern.ext}" m2compatible="true"/>
-    <ibiblio name="datanucleus" root="${www.datanucleus.org}"
-        pattern="${maven2.pattern.ext}" m2compatible="true"/>
-    <ibiblio name="cloudera-releases" root="${releases.cloudera.com}"
-        pattern="${maven2.pattern.ext}" m2compatible="true"/>
-    <ibiblio name="apache-snapshot" root="${snapshot.apache.org}"
-        m2compatible="true" checkmodified="true" changingPattern=".*SNAPSHOT"/>
-    <ibiblio name="cloudera-staging" root="${staging.cloudera.com}"
-        m2compatible="true" checkmodified="true" changingPattern=".*SNAPSHOT"/>
-     <!--Conjars had to be added due to hive's dependency on calcite, which depends on pentaho-aggdesigner-algorithm;5.1.5-jhyde, which is only available in conjars and spring plugins repo -->
-     <ibiblio name="conjars" m2compatible="true" root="http://conjars.org/repo/"/>
-    <filesystem name="fs" m2compatible="true">
-       <artifact pattern="${repo.dir}/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"/>
-       <ivy pattern="${repo.dir}/[organisation]/[module]/[revision]/[module]-[revision].pom"/>
-    </filesystem>
-
-    <filesystem name="fs2">
-       <artifact pattern="${ivy.cache.dir}/[organisation]/[module]/jars/[module]-[revision](-[classifier]).[ext]"/>
-       <ivy pattern="${ivy.cache.dir}/[organisation]/[module]/ivy-[revision].xml"/>
-    </filesystem>
-
-    <chain name="default" dual="true" checkmodified="true"
-        changingPattern=".*SNAPSHOT">
-      <resolver ref="fs2"/>
-      <resolver ref="fs"/>
-      <resolver ref="apache-snapshot"/>
-      <resolver ref="datanucleus"/>
-      <resolver ref="cloudera-releases"/>
-      <resolver ref="cloudera-staging"/>
-      <resolver ref="maven2"/>
-      <resolver ref="conjars"/>
-    </chain>
-
-    <chain name="internal" dual="true">
-      <resolver ref="fs2"/>
-      <resolver ref="fs"/>
-      <resolver ref="apache-snapshot"/>
-      <resolver ref="datanucleus"/>
-      <resolver ref="cloudera-staging"/>
-      <resolver ref="maven2"/>
-      <resolver ref="conjars"/>
-    </chain>
-
-    <chain name="external">
-      <resolver ref="maven2"/>
-      <resolver ref="conjars"/>
-    </chain>
-
-  </resolvers>
-  <modules>
-     <module organisation="org.apache.hadoop" name="hadoop-*" resolver="${resolvers}"/>
-  </modules>
+    <!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+   -->
+
+    <!--
+     see http://www.jayasoft.org/ivy/doc/configuration
+     -->
+
+    <checksums algorithm=""/>
+    <credentials host="${repo.maven.org}" username="${repo.user}" passwd="${repo.pass}"/>
+    <property name="repo.maven.org" value="${repo.maven.org}"
+              override="true"/>
+
+    <property name="maven2.pattern"
+              value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])"/>
+
+    <property name="repo.dir" value="${basedir}/ivy/repository"/>
+    <property name="ivy.cache.dir" value="${basedir}/ivy/cache"/>
+
+    <property name="maven2.pattern.ext" value="${maven2.pattern}.[ext]"/>
+    <property name="resolvers" value="default" override="false"/>
+
+
+    <settings defaultResolver="${resolvers}"/>
+
+    <resolvers>
+        <ibiblio name="maven2" root="${repo.maven.org}"
+                 pattern="${maven2.pattern.ext}" m2compatible="true"/>
+        <filesystem name="fs" m2compatible="true">
+            <artifact
+                    pattern="${repo.dir}/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"/>
+            <ivy pattern="${repo.dir}/[organisation]/[module]/[revision]/[module]-[revision].pom"/>
+        </filesystem>
+
+        <filesystem name="fs2">
+            <artifact pattern="${ivy.cache.dir}/[organisation]/[module]/jars/[module]-[revision](-[classifier]).[ext]"/>
+            <ivy pattern="${ivy.cache.dir}/[organisation]/[module]/ivy-[revision].xml"/>
+        </filesystem>
+
+        <chain name="default" dual="true" checkmodified="false"
+               changingPattern=".*SNAPSHOT">
+            <resolver ref="fs2"/>
+            <resolver ref="fs"/>
+            <resolver ref="maven2"/>
+        </chain>
+
+        <chain name="internal" dual="true">
+            <resolver ref="fs2"/>
+            <resolver ref="fs"/>
+            <resolver ref="maven2"/>
+        </chain>
+
+        <chain name="external">
+            <resolver ref="maven2"/>
+        </chain>
+
+    </resolvers>
+    <modules>
+        <module organisation="org.apache.hadoop" name="hadoop-*" resolver="${resolvers}"/>
+    </modules>
 </ivysettings>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#Sqoop#Bigtop#RPM#版本适配
[B] Sqoop 版本适配改造(一)
[B] Sqoop 版本适配改造(三)

← [B] Sqoop 版本适配改造(一) [B] Sqoop 版本适配改造(三)→

最近更新
01
bigtop-select 打包缺 compat 报错修复 deb
07-16
02
bigtop-select 打包缺 control 文件报错修复 deb
07-16
03
首次编译-环境初始化 必装
07-16
更多文章>
Theme by Vdoing | Copyright © 2017-2025 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式