apache-incubator-disclaimer-resource-bundle 缺失
# 📌 报错背景说明
在使用 Bigtop 编译构建 Livy 组件时,执行 :livy-rpm
或 :livy-clean-rpm
任务时,可能会遇到如下构建异常:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (process-resource-bundles) on project livy-main: Resources archive cannot be found.: org.apache.apache.resources:apache-incubator-disclaimer-resource-bundle:jar:1.2-SNAPSHOT was not found in http://172.20.0.2:8081/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.apache.apache.resources -DartifactId=apache-incubator-disclaimer-resource-bundle -Dversion=1.2-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.apache.apache.resources -DartifactId=apache-incubator-disclaimer-resource-bundle -Dversion=1.2-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] org.apache.apache.resources:apache-incubator-disclaimer-resource-bundle:jar:1.2-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus (http://172.20.0.2:8081/repository/maven-public/, releases=true, snapshots=true)
[ERROR] -> [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/MojoExecutionException
error: Bad exit status from /var/tmp/rpm-tmp.gUWy8Y (%build)
Bad exit status from /var/tmp/rpm-tmp.gUWy8Y (%build)
RPM build errors:
> Task :livy-rpm FAILED
FAILURE: Build failed with an exception.
* Where:
Script '/opt/modules/bigtop/packages.gradle' line: 529
* What went wrong:
Execution failed for task ':livy-rpm'.
> Process 'command 'rpmbuild'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 15s
75 actionable tasks: 75 executed
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
# 🧩 这是个什么依赖?
这是 Apache 的一份元资源包,主要用于在构建阶段注入:
LICENSE.txt
NOTICE.txt
- Apache 项目合规文件
它由 maven-remote-resources-plugin
自动下载使用。
# 🖼️ 仓库地址参考
如下截图所示,该 jar 可通过 Release 仓库地址获取:
https://repository.apache.org/service/local/repositories/releases/content/org/apache/apache/resources/apache-incubator-disclaimer-resource-bundle/1.7/apache-incubator-disclaimer-resource-bundle-1.7.jar
注意:这并不是 1.2-SNAPSHOT,而是 1.7 版本,我们将通过私服手动代理该链接。关键提示
# ✅ 推荐方案:通过 Nexus 私服代理 Release 仓库解决
你可以直接将上述链接所在仓库(Apache Releases)配置为 Nexus 私有仓库源,并让 maven-public
聚合进去。
# 🛠️ 操作步骤
登录 Nexus 后台
添加新仓库:
类型:
proxy
远程仓库地址:
https://repository.apache.org/content/repositories/snapshots/
1
命名为
apache-snapshot1
,加入maven-public
仓库组中
- 缓存下来的效果
构建依赖拉取链路
本地构建请求 → maven-public
→ 聚合路由到 apache-snapshot1
→ 获取目标 jar
此方式可保持一致性、可靠性,尤其适合企业构建链路稳定性要求高的场景。
这是最稳定、最可维护的解决方式。推荐做法
# 🚑 备用方案一:手动安装到本地仓库
若没有私服权限,也可以临时下载并安装 jar:
🔗 点击下载 Release 版本 JAR 包 (opens new window)
mvn install:install-file \
-DgroupId=org.apache.apache.resources \
-DartifactId=apache-incubator-disclaimer-resource-bundle \
-Dversion=1.2-SNAPSHOT \
-Dpackaging=jar \
-Dfile=apache-incubator-disclaimer-resource-bundle-1.7.jar
2
3
4
5
6
不推荐长期使用
虽然手动安装可以立即解决构建问题,但不适合 CI/CD 场景,也不具备团队协作一致性。
# 🔧 备用方案二:拉取 SNAPSHOT 版本
如果你确实需要 1.2-SNAPSHOT,可以配置 Apache Snapshots 仓库:
<repositories>
<repository>
<id>apache-snapshots</id>
<url>https://repository.apache.org/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
2
3
4
5
6
7
8
9
10
11
12
13
强制刷新依赖:
mvn clean install -U
Maven 会缓存拉取失败状态,-U
选项必须加。注意
# 🧪 验证步骤
检查项 | 说明 |
---|---|
本地仓库缓存 | ~/.m2/repository/org/apache/apache/resources/... 是否生成 jar |
Nexus 仓代理情况 | 检查代理仓是否抓取到目标 jar |
构建输出日志 | 是否跳过了 maven-remote-resources-plugin 报错 |
Livy 构建是否继续推进 | 若构建失败信息已变化,则说明此问题已解决 |
# 🧱 构建建议与脚本参考
建议在构建 Livy 前执行以下命令以保证依赖干净:
cd bigtop
./gradlew clean
./gradlew livy-rpm -PskipSigning=true --refresh-dependencies
2
3
如构建系统为离线环境,推荐将 maven-public
中依赖预拉取到 .m2/repository
,提升可靠性。