Gradle: can't use the URL-encoded project path
🔥 Problem
When using $ gradle
, we can't use the URL-encoded project path as the id of the project.
$ gradle
will interpret those %2F
into /
and thus, it will not properly work.
build.gradle
example:
plugins {
id 'java'
id 'application'
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/issue-reproduce%2Fpackages%2Fmaven%2F332028-test/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
value = '<token>'
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
dependencies {
implementation 'foo.bar.app:something-works:3.1'
}
🔮 The available workaround
The available workaround here is to use the project id
directly instead of its full path.
🚒 Solutions
There are different ways to solve this:
- Properly document that URL-encoded project full paths are not supported with
$ gradle
. - Check if we could do something about it in the Grape API router.