Maven执行install报错:无法从Azure Feed拉取openapi插件依赖
问题原因与解决方法
核心问题
你配置的<repositories>仅负责项目编译、运行阶段的依赖拉取,而Maven插件(包括插件自身的依赖)的仓库地址需要通过<pluginRepositories>单独配置。当前报错里的pe.com.pichincha:mic-libs-openapi-generator是openapi-generator-maven-plugin的依赖,Maven只会去插件仓库列表里查找,所以你之前加的<repositories>对插件依赖无效。
解决步骤
在你的pom.xml中添加<pluginRepositories>节点,把Azure Feed仓库配置进去,示例如下:
<pluginRepositories> <pluginRepository> <id>t002</id> <url>https://pkgs.dev.azure.com/gz1606/u-devops/_packaging/t002/maven/v1</url> <!-- 若为快照仓库,需开启快照支持 --> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories>
额外排查点
- 如果Azure Feed是私有仓库,需在
settings.xml中配置对应id的认证信息:<servers> <server> <id>t002</id> <username>你的Azure账号</username> <password>你的Azure令牌/密码</password> </server> </servers> - 执行
mvn install -X查看详细日志,确认Maven是否已将Azure Feed加入插件依赖的查找列表 - 检查全局
settings.xml中是否存在优先级更高的插件仓库配置,可能覆盖了项目级配置
内容的提问来源于stack exchange,提问作者cekodis681 cekodis681
相关产品推荐
相关产品推荐

