Build: Support overwrite maven repo by gradle properties#2574
Build: Support overwrite maven repo by gradle properties#2574rdblue merged 2 commits intoapache:masterfrom
Conversation
| def apacheReleasesRepoUrl = 'https://repository.apache.org/service/local/staging/deploy/maven2' | ||
| def snapshotsRepoUrl = project.hasProperty('mavenSnapshotsRepo') ? project.property('mavenSnapshotsRepo') : "$apacheSnapshotsRepoUrl" | ||
| def releasesRepoUrl = project.hasProperty('mavenReleasesRepo') ? project.property('mavenReleasesRepo') : "$apacheReleasesRepoUrl" | ||
| def snapshotsRepoUrl = project.hasProperty('mavenSnapshotsRepo') ? "$mavenSnapshotsRepo" : "$apacheSnapshotsRepoUrl" |
There was a problem hiding this comment.
I'm a little lost here, it looks like previously we could set this based on the -PmavenSnapshotsRepo and now we are switching it to a local property? Or does -P handle set the local property as well?
Mostly i'm confused why project.property was not sufficient before
There was a problem hiding this comment.
Groovy and Gradle still hold a lot of mysteries for me
There was a problem hiding this comment.
Overwrite snapshotsRepo by -PmavenSnapshotsRepo? Seems not work for me.
As my understand, before only handle mavenUser and mavenPassword by -P or local properties but hardcode repo urls.
Groovy and Gradle still hold a lot of mysteries for me
Big +1
There was a problem hiding this comment.
From my understanding project.property('mavenSnapshotsRepo') picks up properties from either a gradles.properties file or from -P args, I"ll run some tests to see
There was a problem hiding this comment.
yeap, and -P args should have the high priority.
There was a problem hiding this comment.
oh, i see. the inlined conversation diff looks weird, but File Changed page looks good.
There was a problem hiding this comment.
I'm still lost a bit I think
def snapshotsRepoUrl = project.hasProperty('mavenSnapshotsRepo') ? "$mavenSnapshotsRepo" : "$apacheSnapshotsRepoUrl"should be
def snapshotsRepoUrl = project.hasProperty('mavenSnapshotsRepo') ? project.property("mavenSnapshotsRepo") : "$apacheSnapshotsRepoUrl"When I do a quick test
print(project.hasProperty("mavenSnapshotsRepo"))
print(project.property("mavenSnapshotsRepo"))
print($mavenSnapshotsRepo)and
g -PmavenSnapshotsRepo=oneThen I get mavenSnapshotsRepo undefined but the first two work fine.
There was a problem hiding this comment.
print("$mavenSnapshotsRepo") works but print($mavenSnapshotsRepo) not.
"$mavenSnapshotsRepo" will fallback to project.property("mavenSnapshotsRepo")
There was a problem hiding this comment.
So this is some magic in the string interpolation?
|
@aokolnychyi + @rdblue I haven't done a release so one of you should probably check it too :) |
cc @RussellSpitzer