我的项目具有以下结构:
-root project
-settings.gradle
-build.gradle
-moduleA
-build.gradle
moduleB
-build.gradle
我在每个模块中都有此配置:
repositories {
maven {
credentials {
username "username"
password "password"
}
url "http://artifactory..."
}
}
我不想复制此配置,而是要将其移动到父配置。我该怎么办?
现在我有这个build.gradle
(父母):
group = 'my.group'
version = '0.0.1-SNAPSHOT'
ext {
springBootVersion = '2.1.3.RELEASE'
cxfVersion = '3.2.7'
uuidGeneratorVersion = '3.1.5'
commonLang3Version = '3.7'
encacheVersion = '2.6.11'
logstashVersion = '5.2'
}
repositories {
maven {
credentials {
username "username"
password "password"
}
url "http://artifactory...."
}
}
答案 0 :(得分:1)
假设moduleA
和moduleB
是子项目,请在build.gradle
中这样定义它:
subprojects {
repositories {
maven {
credentials {
username "username"
password "password"
}
url "http://artifactory...."
}
}
}