我有一个自定义任务来从服务器获取凭据:
task getToken {
ext.token = // curl whatever
}
我想在出版物存储库的凭据块中使用此任务的输出,如下所示:
publishing {
publications {
myPublication(MavenPublication) {
from components.java
}
}
repositories {
maven {
url = "https://somewhere.com/repo"
credentials {
username System.properties['user.name']
password getToken.token
}
}
}
}
但是,我不知道那里的凭据何时解决,显然该任务getToken
需要事先完成。
我如何实现这一目标?