Allowing the user to define properties with a dot in them?


It is quite a common idiom that, when you have properties related to one another, you use a “custom namespace” such as:

‘’’ domain.property1 = value1 domain.property2 = value2 ‘’’

Unfortunately, Gradle, as of 1.6, does not allow for it (I have tried sourcing a ‘’ with such values but failed).

It would be really, really nice if Gradle allowed for this. For instance, I upload to Sonatype: I have to define ‘sonatypeUsername’, ‘sonatypePassword’, but what I would like to be able to specify is ‘sonatype.credentials.userName’, ‘sonatype.credentials.password’ or the like.

Is there a plan in store to allow for that type of definitions to be usable from property files, or from ‘project.ext’?

It’s already possible, e.g. ‘println property(“”)’ or ‘project.ext[“one.two”] = “foo”’.

Is it possible to use dot properties in Strings as well, e.g.

dependencies {

compile (


) }

At the moment it’s failing with: > No such property: spring for class: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

Same deal: ‘“org.springframework:spring-webmvc:${property(‘spring.version’)}”’

okay, thx!