xmlsectool 依赖缺失问题解析
# 一、问题背景
在基于 Bigtop 编译 Apache Knox 2.1.0 的过程中,整体构建已经进入后半段,大量模块显示为 SKIPPED,但在处理安全相关模块时构建突然中断。
从构建路径和模块名称可以判断,此阶段已经进入 Knox 的 Provider / Security 相关实现,一旦失败,后续 Knox 组件将全部无法继续。
笔记
这类问题在 Bigtop + 内网 Nexus 的环境下非常常见, 并不属于代码问题,而是典型的 第三方 Maven 依赖缺失。
# 二、报错信息与日志定位
核心报错信息如下:
NFO] gateway-service-session 2.1.0 ...................... SKIPPED
[INFO] gateway-release 2.1.0 .............................. SKIPPED
[INFO] gateway-service-vault 2.1.0 ........................ SKIPPED
[INFO] gateway-test-release-utils 2.1.0 ................... SKIPPED
[INFO] gateway-test 2.1.0 ................................. SKIPPED
[INFO] gateway-test-release 2.1.0 ......................... SKIPPED
[INFO] webhdfs-kerb-test 2.1.0 ............................ SKIPPED
[INFO] webhdfs-test 2.1.0 ................................. SKIPPED
[INFO] gateway-shell-release 2.1.0 ........................ SKIPPED
[INFO] gateway-docker 2.1.0 ............................... SKIPPED
[INFO] gateway-release-common 2.1.0 ....................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:13 min
[INFO] Finished at: 2025-12-11T02:52:38Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project gateway-provider-security-pac4j: Could not resolve dependencies for project org.apache.knox:gateway-provider-security-pac4j:jar:2.1.0: Could not find artifact net.shibboleth.tool:xmlsectool:jar:2.0.0 in nexus (http://172.20.0.2:8081/repository/maven-public/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :gateway-provider-security-pac4j
(base) [root@kylin10 knox-2.1.0-RC2]#
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
同时可以看到构建最终状态:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:13 min
[INFO] Finished at: 2025-12-11T02:52:38Z
2
3
4
5
从日志中可以提取几个关键信息点:
| 项目 | 内容 |
|---|---|
| 失败模块 | gateway-provider-security-pac4j |
| 缺失依赖 | net.shibboleth.tool:xmlsectool:2.0.0 |
| Maven 仓库 | 内部 Nexus(maven-public) |
| 错误类型 | DependencyResolutionException |
# 三、问题根因分析
# 1. xmlsectool 并不在 Maven Central
xmlsectool 属于 Shibboleth 项目体系,其官方 Maven 仓库地址为:
https://build.shibboleth.net/maven/releases/
该依赖 默认不发布在 Maven Central,因此:
- 本地 Maven
- 企业 Nexus
- Bigtop 默认构建链路
都无法自动拉取该依赖
# 2. 内部 Nexus 未代理 Shibboleth 仓库
当前构建使用的仓库为:
http://172.20.0.2:8081/repository/maven-public/
如果该 group 中未包含 shibboleth-releases,那么 Maven 在解析依赖时必然失败。
注意
这个问题 和 Knox 版本无关,和 Bigtop 无关, 本质是 仓库覆盖不完整。
# 四、解决方案
针对 xmlsectool 依赖缺失的问题,本质上只有一个目标:
让 Maven 能解析到 net.shibboleth.tool:xmlsectool:2.0.0
根据环境不同,可以采用两种方式。
# 方案一:通过 Nexus 统一托管 xmlsectool 依赖(推荐)
该方案适用于:
- 企业内网
- 多人协作
- 多次重复编译 Bigtop / Ambari / Knox
# 1. 添加 Shibboleth Releases 仓库
在 Nexus 中新增一个 Maven Proxy Repository:
- Name:
shibboleth-releases - Remote URL:
https://build.shibboleth.net/maven/releases/

# 2. 加入 maven-public Group
将 shibboleth-releases 添加到 maven-public 组仓库中,确保构建时可以被统一解析。

# 3. 恢复构建
mvn compile -rf :gateway-provider-security-pac4j
提示
-rf(resume from)是 Bigtop / Knox 编译中非常常用的参数,
可以避免从头全量重编。
# 4. 一键脚本方式(推荐)
如果不想手工配置 Nexus,可以直接使用我们整理的一键脚本:
https://github.com/TtBigdata/ambari-env/blob/master/scripts/system/after/nexus/setup_mvn_proxy.sh
该脚本会自动补齐:
- Shibboleth
- Apache Snapshots
- 其他常见第三方 Maven 仓库

# 方案二:直接下载并安装到本地 Maven 仓库
该方案适用于:
- 无法修改 Nexus
- 临时编译
- 单机调试环境
# 1. 下载 xmlsectool 依赖
官方目录地址:
https://build.shibboleth.net/maven/releases/net/shibboleth/tool/xmlsectool/

# 2. 安装到本地仓库
mvn install:install-file \
-DgroupId=net.shibboleth.tool \
-DartifactId=xmlsectool \
-Dversion=2.0.0 \
-Dpackaging=jar \
-Dfile=xmlsectool-2.0.0.jar
2
3
4
5
6
注意
该方式只对当前机器生效, 不适合企业级、可复现构建环境。
- 01
- webhdfs-test 依赖收敛冲突问题处理12-24
- 02
- Invalid keystore format 问题处理12-24
- 03
- X-Forwarded-For 406 错误的原因与处理12-24