java - 向 Azure Artifacts Maven 验证 Gradle
问题描述
我想对 Azure DevOps Artifacts 的 Azure 管道进行身份验证,对此我vstsFeedId
很方便。该项目基于 Gradle
在本地,它通过创建个人访问令牌并使用~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id><id>
<username><username>
<password><password>
</server>
</servers>
</settings>
摇篮
repositories {
mavenCentral()
maven {
url ''
name ''
authentication {
basic(BasicAuthentication)
}
}
}
但是,当我上网到管道时,Gradle 无法获取依赖项,因为未设置身份验证
FAILURE:构建失败并出现异常。
* What went wrong:
Execution failed for task ':compileJava'.
> Failed to notify dependency resolution listener.
> Could not resolve all dependencies for configuration ':detachedConfiguration1'.
> You cannot configure authentication schemes for this repository type if no credentials are provided.
> Could not resolve all dependencies for configuration ':detachedConfiguration2'.
> You cannot configure authentication schemes for this repository type if no credentials are provided.
我发现Maven 任务mavenAuthenticateFeed
有一个可能有用的属性,而Gradle 任务没有
如何向我自己的 Azure DevOps Artifacts 存储库验证 Gradle?
解决方案
推荐阅读
- python - 在类中调用方法时遇到问题
- javacc - Javacc 错误报告导致“扩展可以由空字符串匹配”。
- excel - 使用宏/脚本在 Excel 中打开超链接 - 如何绕过打开文件的安全性?
- python - python中的正则表达式拆分字符串
- python - 无法通过 websocket 连接流式传输传入的股票/股票代码数据?
- javascript - 下拉更改后在多个 Highcharts 上调整大小不起作用
- java - 如何使用 Jackson 注释解开 java Map 中的键和值对象?
- android - Firebase Crashlytics - 设置用户 ID 不起作用?
- python - Django settings.py 语句执行了两次
- vba - 将 Microsoft Teams 添加到 Outlook 会议请求