具有 OAuth2(或任何其他 HTTP header 身份验证)的 Maven 存储库

标签 maven gradle oauth-2.0

我正在尝试使用 Gitlab 存储库作为我的依赖项的私有(private) Maven 存储库。部署过程运行良好(类似于 as described here ),但更加简化)。

不,我正在尝试添加依赖项,但这似乎不起作用。在 Maven 中,这似乎是可能的( as described here )。但在 Gradle 中只有 BasicAuth 或 AWS s3 token seem to be supported .

有什么方法可以将自定义 header 添加到对 Maven 存储库的请求中吗?或者有什么办法可以使用OAuth2-authentification?

如果没有,您能给我一个提示,从哪里开始实现它吗?

最佳答案

The best piece of information我可以得到 2 1/2 岁的信息,它来自 Gradle 核心开发人员:

Currently this is not possible. We want to potentially support more authentication schemes but there are no plans to support OAuth2 at this time.

还有这个3年的 secret Gradle Git Repo Plugin但有一个“大”对应物:

Private maven repos however, aren't easily accessible via the standard maven http interface, or at least I haven't figured out how to get the authentication right. This plugin simply clones the repo behind the scenes and uses it as a local repo, so if you have permissions to clone the repo you can access it.

所以基本上你被困住了。

关于具有 OAuth2(或任何其他 HTTP header 身份验证)的 Maven 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50522734/

相关文章:

maven - 处理Maven非库 Artifact 依赖项的Gradle方法

maven - 如何将 Maven 日志中的测试运行次数与源代码匹配?

plugins - 应用gradle自定义jar插件

node.js - 如何撤销 Google OAuth 提供的 token ? NodeJS

python - Google App Engine 远程 API + OAuth

asp.net-mvc - 使用 OWIN 身份从多个 API 客户端注册 Web API 2 外部登录

android - 无法从 jitpack.io 存储库中找到依赖项

java - 应用程序错误(Hibernate 5 + Spring MVC 5)

java - 无法解决 Android 错误 :Execution failed for task ':app:compileDebugJavaWithJavac'

Gradle 多项目并行构建消耗 100% 的 CPU 时间