cloudera-manager-api-swaggerjar7.0.3 not found
快捷导航
在开始解决问题之前,大家可以通过下面的导航快速找到相关资源啦!💡👇
快捷导航 | 链接地址 | 备注 |
---|---|---|
相关文档 | - | |
ambari+bigtop自定义组件集成 | https://blog.csdn.net/TTBIGDATA/article/details/142150086 | CSDN地址 |
编译、开发、部署、集成解决方案 | https://t.zsxq.com/0PVcI | 知识星球 |
源代码 | - | |
Ambari-env | https://github.com/TtBigdata/ambari-env | GitHub |
Ambari-env | https://gitee.com/tt-bigdata/ambari-env | Gitee |
Ambari-2.8.0魔改版 | https://gitee.com/tt-bigdata/ambari-2.8.0 | Gitee |
编译包 | - | |
蓝奏云-1.0.2 | https://www.ilanzou.com/s/4mfyXMq9?code=6655 | |
阿里云盘-1.0.2 | https://www.alipan.com/s/q3TqL1mdPBp | 提取码:01no |
联系方式 | - | |
QQ:1群 | https://qm.qq.com/q/3DrsCY5b7a |
正题:如何解决 cloudera-manager-api-swagger:jar:7.0.3 not found
错误问题 🤔
当我遇到 cloudera-manager-api-swagger:jar:7.0.3 not found
这个报错时,确实有点头疼 😅。经过分析,问题出在 Maven 无法找到指定的依赖。在这种情况下,依赖下载失败并且被缓存到了本地仓库,直到更新周期结束或手动强制更新前,它不会再次尝试下载。
1️⃣ 错误分析
下述完整报错日志:
bash
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ranger 2.4.0:
[INFO]
[INFO] ranger ............................................. SUCCESS [ 1.136 s]
[INFO] Jdbc SQL Connector ................................. SUCCESS [ 1.232 s]
[INFO] Credential Support ................................. SUCCESS [ 2.079 s]
[INFO] Audit Component .................................... SUCCESS [ 4.561 s]
[INFO] ranger-plugin-classloader .......................... SUCCESS [ 0.817 s]
[INFO] Common library for Plugins ......................... SUCCESS [ 6.002 s]
[INFO] ranger-intg ........................................ SUCCESS [ 2.355 s]
[INFO] Installer Support Component ........................ SUCCESS [ 0.823 s]
[INFO] Credential Builder ................................. SUCCESS [ 1.542 s]
[INFO] Embedded Web Server Invoker ........................ SUCCESS [ 2.801 s]
[INFO] Key Management Service ............................. SUCCESS [ 6.083 s]
[INFO] HBase Security Plugin Shim ......................... SUCCESS [ 3.709 s]
[INFO] HBase Security Plugin .............................. SUCCESS [ 6.086 s]
[INFO] Hdfs Security Plugin ............................... SUCCESS [ 3.893 s]
[INFO] Hive Security Plugin ............................... SUCCESS [ 7.906 s]
[INFO] Knox Security Plugin Shim .......................... SUCCESS [ 2.105 s]
[INFO] Knox Security Plugin ............................... FAILURE [ 0.395 s]
[INFO] Storm Security Plugin .............................. SKIPPED
[INFO] YARN Security Plugin ............................... SKIPPED
[INFO] Ozone Security Plugin .............................. SKIPPED
[INFO] Ranger Util ........................................ SKIPPED
[INFO] Unix Authentication Client ......................... SKIPPED
[INFO] User Group Synchronizer Util ....................... SKIPPED
[INFO] Security Admin Web Application ..................... SKIPPED
[INFO] KAFKA Security Plugin .............................. SKIPPED
[INFO] SOLR Security Plugin ............................... SKIPPED
[INFO] NiFi Security Plugin ............................... SKIPPED
[INFO] NiFi Registry Security Plugin ...................... SKIPPED
[INFO] Kudu Security Plugin ............................... SKIPPED
[INFO] Unix User Group Synchronizer ....................... SKIPPED
[INFO] Ldap Config Check Tool ............................. SKIPPED
[INFO] Unix Authentication Service ........................ SKIPPED
[INFO] Unix Native Authenticator .......................... SKIPPED
[INFO] KMS Security Plugin ................................ SKIPPED
[INFO] Tag Synchronizer ................................... SKIPPED
[INFO] Hdfs Security Plugin Shim .......................... SKIPPED
[INFO] Hive Security Plugin Shim .......................... SKIPPED
[INFO] YARN Security Plugin Shim .......................... SKIPPED
[INFO] OZONE Security Plugin Shim ......................... SKIPPED
[INFO] Storm Security Plugin shim ......................... SKIPPED
[INFO] KAFKA Security Plugin Shim ......................... SKIPPED
[INFO] SOLR Security Plugin Shim .......................... SKIPPED
[INFO] Atlas Security Plugin Shim ......................... SKIPPED
[INFO] KMS Security Plugin Shim ........................... SKIPPED
[INFO] ranger-examples .................................... SKIPPED
[INFO] Ranger Examples - Conditions and ContextEnrichers .. SKIPPED
[INFO] Ranger Examples - SampleApp ........................ SKIPPED
[INFO] Ranger Examples - Ranger Plugin for SampleApp ...... SKIPPED
[INFO] sample-client ...................................... SKIPPED
[INFO] Apache Ranger Examples Distribution ................ SKIPPED
[INFO] Ranger Tools ....................................... SKIPPED
[INFO] Atlas Security Plugin .............................. SKIPPED
[INFO] SchemaRegistry Security Plugin ..................... SKIPPED
[INFO] Sqoop Security Plugin .............................. SKIPPED
[INFO] Sqoop Security Plugin Shim ......................... SKIPPED
[INFO] Kylin Security Plugin .............................. SKIPPED
[INFO] Kylin Security Plugin Shim ......................... SKIPPED
[INFO] Presto Security Plugin ............................. SKIPPED
[INFO] Presto Security Plugin Shim ........................ SKIPPED
[INFO] Elasticsearch Security Plugin Shim ................. SKIPPED
[INFO] Elasticsearch Security Plugin ...................... SKIPPED
[INFO] Apache Ranger Distribution ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.282 s
[INFO] Finished at: 2024-03-15T09:20:25+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ranger-knox-plugin: Could not resolve dependencies for project org.apache.ranger:ranger-knox-plugin:jar:2.4.0: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project ranger-knox-plugin: Could not resolve dependencies for project org.apache.ranger:ranger-knox-plugin:jar:2.4.0: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:292)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:170)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:401)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:347)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.apache.ranger:ranger-knox-plugin:jar:2.4.0: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:214)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:266)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:170)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:401)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:347)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:357)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:207)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:266)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:170)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:401)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:347)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:425)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:340)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:207)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:266)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:170)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:401)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:347)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 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 ccdc-dev has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException (DefaultUpdateCheckManager.java:217)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact (DefaultUpdateCheckManager.java:189)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads (DefaultArtifactResolver.java:574)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:484)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:402)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:340)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:207)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:266)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:170)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:401)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:347)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:299)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:963)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:296)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
[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 :ranger-knox-plugin
这个错误告诉我,Maven 尝试从指定的仓库地址下载依赖,但没能成功:
bash
[ERROR] com.cloudera.api.swagger:cloudera-manager-api-swagger:jar:7.0.3 was not found in http://172.20.0.2:8081/repository/maven-public/
看来这个依赖没有被发布到该仓库,也许仓库地址错了,或者依赖根本不存在。
2️⃣ 解决方案 💡
(1)检查仓库地址配置是否正确
我首先需要检查 Maven 的 settings.xml
配置,确保访问的仓库地址是正确的。我使用了如下配置:
xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>Nexus Repository</name>
<url>http://172.20.0.2:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus-releases</id>
<url>http://172.20.0.2:8081/repository/maven-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<url>http://172.20.0.2:8081/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-plugins</id>
<url>http://172.20.0.2:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
(2)强制 Maven 更新依赖缓存
为了让 Maven 重新下载依赖,我使用了以下命令来强制更新:
bash
mvn clean install -U
这会强制 Maven 重新检查并下载所有依赖。
(3)手动下载并安装依赖
如果仓库中确实没有这个依赖,可以尝试手动下载 cloudera-manager-api-swagger:jar:7.0.3
并安装到本地 Maven 仓库:
bash
mvn install:install-file -Dfile=/path/to/cloudera-manager-api-swagger-7.0.3.jar -DgroupId=com.cloudera.api.swagger -DartifactId=cloudera-manager-api-swagger -Dversion=7.0.3 -Dpackaging=jar
(4)添加其他公共仓库
最后,如果依赖确实不存在于本地或私有仓库,考虑添加其他公共仓库,例如 Cloudera 官方仓库:
xml
<repositories>
<repository>
<id>libs-release-local</id>
<url>https://repository.cloudera.com/repository/libs-release-local/</url>
</repository>
</repositories>
3️⃣ 我的解决方案(懒人办法)💡🚀
使用ambari-env 解决所有编译问题(只需一键)
https://gitee.com/tt-bigdata/ambari-env
我们提供了所有可能需要的镜像仓库,均为一键导入,解决表一过程中遇到的各类错误
4️⃣ 手动处理
详细步骤:
1️⃣ 添加 Cloudera 官方仓库为私服的 Proxy 仓库 💻🔗
-
首先,登录到你的私服管理页面(例如 Nexus Repository Manager)。🎯
-
在左侧菜单中,找到并点击 Repositories(仓库管理) ,然后点击 Create repository(创建仓库)。🛠️
-
选择 Proxy 仓库类型,这就是我们要代理远程仓库的方式!填写仓库名称(如
cloudera-libs
)📂。 -
在 Remote Storage URL(远程存储 URL) 中,填入 Cloudera 官方仓库地址:
bashhttps://repository.cloudera.com/repository/libs-release-local/
在这里插入图片描述
🚀 这样我们就将 Cloudera 仓库添加进来了。
-
完成其他必要设置后,点击 Create repository(创建仓库)。✨
2️⃣ 将 Proxy 仓库聚合到 Maven 公共仓库 🌐📦
-
接下来,要将新建的 Proxy 仓库添加到私服的 Maven 公共仓库(
maven-public
)中,统一下载路径,让整个流程更顺畅。🌊 -
回到 Repositories(仓库管理) 页面,找到并点击 maven-public 仓库。🖱️
-
进入 Configuration(配置) 页面,找到 Group(组仓库) 设置,把刚才创建的
cloudera-libs
仓库加入组里。🤝 -
💡 提示 :这样
maven-public
就变成了所有下载的统一入口,不用担心依赖下载分散的问题了!🎉