You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hasProperty() (also in pluginManagement {}) returns true or false based on a property defined or not.
Current Behavior
null is always returned.
Context
I keep organization-specific internal Gradle plugins in a private GitLab repository which has to be configured in different way for local and CI-based access. For example:
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name "My private GitLab package repository"
url "https://gitlab.com/..."
credentials(HttpHeaderCredentials) {
name = hasProperty("gitLabPrivateToken") ? 'Private-Token' : 'Job-Token'
value = hasProperty("gitLabPrivateToken") ? getProperty("gitLabPrivateToken") : System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
As hasProperty() returns null and I have to fallback to checking system environments instead, but in some cases (e.g. two different properties) it might be problematic.
On a contrary getProperty() works fine in both inside and outside pluginManagement {} in settings.gradle.
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.
Expected Behavior
hasProperty()
(also inpluginManagement {}
) returns true or false based on a property defined or not.Current Behavior
null
is always returned.Context
I keep organization-specific internal Gradle plugins in a private GitLab repository which has to be configured in different way for local and CI-based access. For example:
As
hasProperty()
returnsnull
and I have to fallback to checking system environments instead, but in some cases (e.g. two different properties) it might be problematic.On a contrary
getProperty()
works fine in both inside and outsidepluginManagement {}
insettings.gradle
.Steps to Reproduce
In
settings.gradle
:Your Environment
Gradle 6.8.3, OpenJDK 15, Linux.
The text was updated successfully, but these errors were encountered: