You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/13 15:42:03 UTC
[GitHub] [beam] lukecwik commented on a change in pull request #11399:
Interpolate publish credentials as expected for Maven settings.xml
lukecwik commented on a change in pull request #11399: Interpolate publish credentials as expected for Maven settings.xml
URL: https://github.com/apache/beam/pull/11399#discussion_r407545725
##########
File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
##########
@@ -600,9 +600,10 @@ class BeamModulePlugin implements Plugin<Project> {
? 'apache.releases.https' : 'apache.snapshots.https')
def m2SettingCreds = new XmlSlurper().parse(settingsXml).servers.server.find { server -> serverId.equals(server.id.text()) }
if (m2SettingCreds) {
+ def GroovyShell shell = new GroovyShell(new Binding([env:System.getenv()]))
credentials {
- username m2SettingCreds.username.text()
- password m2SettingCreds.password.text()
+ username shell.evaluate('"' + m2SettingCreds.username.text() +'"')
+ password shell.evaluate('"' + m2SettingCreds.password.text() +'"')
Review comment:
What about considering using a plugin to do this, there seems to be a few promising ones:
https://github.com/datlowe/gradle-maven-publish-auth
https://github.com/sebersole/gradle-maven-publish-auth
(might be more as well)
Also, if finding an existing plugin to do this doesn't work out, what about integrating with the maven settings builder?
https://github.com/apache/maven/blob/a2b800de32cdb9adc1e64a43a0fc32e3ba878103/maven-core/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java#L42
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services