Can props from be overwritten with -D parameter?

(detlef.brendle) #1

I have a project with a file that defines a system property for httpProxy.


Is it still possible to overwrite that proxy with a -D command line parameter ? I tried it but could not find a way to do so.

Thanks, detlef

(Wouter Roosenburg) #2

-D is maven, within Gradle -P is used.

So, in your case it would be -PsystemProp.http.proxyHost=proxy

(Peter Niederwieser) #3

Currently, a system property set via ‘’ wins over one passed with ‘-D’. Doesn’t seem right to me, but might be an intentional compromise because the other way around is difficult to implement. We are currently working on related stuff, so maybe we can do something about it. I’ve created GRADLE-2122 to track this.

(Wouter Roosenburg) #4

Oops, I misread the part about system properties. Usually I overwrite props from with -P but I don’t know if this works if it is a system property. Apparently not :slight_smile:

(frank waldheim) #5

it just works with -Dorg.gradle.project.propertyName=value then you’re property from gets the value overwritten.

sorry. misread you’re intention.

(detlef.brendle) #6

Hi, I guess I do something wrong here. If I run


and check to debug log statements I still see the proxy that is defined within

[org.apache.commons.httpclient.HttpConnection] Open connection to

Whats wrong ? thanks, detlef

(Peter Niederwieser) #7

That’s what this whole thread is about. Properties in ‘’ can not currently be overridden with ‘-D’.