You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

引入camel-restlet-starter依赖致Spring Boot构建失败(AuthorizationException)

解决方案

这个问题的核心原因是旧的Restlet Maven仓库http://maven.restlet.org已经停止服务,并且设置了访问拦截,所以才会返回InvalidBrowser错误,和代理配置关系不大(除非代理本身限制了新仓库的访问)。下面是具体的解决步骤:

1. 替换Restlet仓库地址

Restlet官方已经将Maven仓库迁移到了HTTPS地址,同时大部分稳定版本也同步到了Maven Central。你需要移除旧仓库配置,改用以下方案之一:

  • 推荐:使用Maven Central:确保你的pom/settings中已经启用了Maven Central(默认情况下Maven会自带这个仓库配置),无需额外添加仓库。
  • 备选:使用Restlet新仓库:如果某些特定版本在Central找不到,可在pom.xml中添加:
<repositories>
    <repository>
        <id>restlet</id>
        <name>Restlet Official Repository</name>
        <url>https://maven.restlet.com</url>
    </repository>
</repositories>

2. 指定兼容的依赖版本

你的camel-restlet-starter没有指定版本,Maven会根据Spring Boot BOM拉取一个旧版本,而旧版本依赖的正是失效的Restlet仓库。建议指定一个兼容Spring Boot 1.5.12的Camel版本,比如:

<properties>
    <!-- 2.20.x系列兼容Spring Boot 1.5.x -->
    <camel.version>2.20.4</camel.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-restlet-starter</artifactId>
        <version>${camel.version}</version>
    </dependency>
</dependencies>

3. 清理Maven本地缓存

本地缓存的旧仓库元数据可能导致问题,执行以下命令强制更新依赖:

mvn clean install -U

-U参数会强制Maven刷新所有依赖的快照和发布版本信息。

4. 代理配置检查(可选)

如果上述步骤后仍然有问题,再检查代理设置:

  • 确认settings.xml中的代理配置正确,包含proxyHost、proxyPort,若需认证则补充username和password
  • 确保代理允许访问https://maven.restlet.com和https://repo1.maven.org/maven2/

内容的提问来源于stack exchange,提问作者Ron C.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 09:09:09