在settings.gradle中使用maven存储库凭据

问题描述 投票:0回答:1

我正在开发 Liferay 工作区项目。如何在主文件夹中的某些外部文件(例如 gradle.properties)中设置 Maven 存储库的凭据,并在 settings.gradle 中使用它。我知道上述设置适用于 build.gradle,但我需要与 settings.gradle 相同的设置 目前我的settings.gradle如下所示,

buildscript {
    dependencies {
        classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "latest.release"
        classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
    }

    repositories {
        maven {
            credentials {
                username 'user'
                password 'pw'
            }
            url "https://<host>/<url>"
        }
    }
}
gradle liferay-7
1个回答
0
投票

没有太大区别,这是来自settings.gradle的示例 在本例中,用户名和密码来自个人财产。

buildscript {

    dependencies { classpath "com.liferay:com.liferay.gradle.plugins.workspace:1.9.2" }

    repositories {
        maven {
            credentials {
                username = artifactory_username
                password = artifactory_password
            }
            url "https://example/artifactory/libs-release"
        }
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.