一主多子项目配置
...小于 1 分钟
一主多子项目配置
一个主多子项目配置,参见项目模板
配置 wrapper
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
配置 setting.gradle
rest
、service
、client
为子项目目录,更多配置见ihub-settings插件:
plugins {
id 'pub.ihub.plugin.ihub-settings' version '1.4.1'
}
iHubSettings {
includeProjects 'rest', 'service', 'client'
}
配置 build.gradle
子项目引入Java插件(ihub-java)、测试插件(ihub-test)以及验证插件(ihub-verification),配置ihub-git-hooks插件钩子命令:
plugins {
id 'pub.ihub.plugin'
id 'pub.ihub.plugin.ihub-git-hooks'
id 'pub.ihub.plugin.ihub-java' apply false
id 'pub.ihub.plugin.ihub-test' apply false
id 'pub.ihub.plugin.ihub-verification' apply false
id 'pub.ihub.plugin.ihub-publish' apply false
id 'pub.ihub.plugin.ihub-boot' apply false
}
subprojects {
apply {
plugin 'pub.ihub.plugin.ihub-java'
plugin 'pub.ihub.plugin.ihub-test'
plugin 'pub.ihub.plugin.ihub-verification'
}
dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
}
iHubGitHooks {
hooks = [
'pre-commit': './gradlew build',
'commit-msg': './gradlew commitCheck'
]
}
配置 gradle.properties
配置项目名称以及group,其中name
为ihub-settings插件扩展属性,group
为原生项目属性
name=demo
group=pub.ihub.demo