如何解决为Gradle Multi项目配置TeamCity
- 红色箭头:root gradle
- 绿色箭头:访问项目
- 紫色箭头:公地
- 蓝色箭头:公司项目
整个项目都在一个存储库(主库)中,每个子项目我都建立了一个git子树,并且有自己的存储库。我正在尝试配置自动部署,但不能,甚至不能进行任何清理。我进行了如下配置:
我的根gradle:
import org.jetbrains.kotlin.gradle.tasks.*
plugins {
kotlin("jvm") apply false
kotlin("plugin.serialization") apply false
id("com.github.johnrengelman.shadow") apply false
id("io.gitlab.arturbosch.detekt") apply false
id("org.flywaydb.flyway") apply false
`maven-publish`
}
group = "com.rjdesenvolvimento"
version = "0.0.1"
subprojects {
group = "com.rjdesenvolvimento"
version = "0.0.1"
repositories {
jcenter()
maven(url = "https://kotlin.bintray.com/ktor") { name = "bintray-ktor" }
maven(url = "http://packages.confluent.io/maven/")
maven(url = "https://jitpack.io")
}
afterEvaluate {
if (project.plugins.hasPlugin("org.jetbrains.kotlin.jvm")) {
tasks {
withType<KotlinCompile>().configureEach {
kotlinoptions.jvmTarget = "11"
}
withType<io.gitlab.arturbosch.detekt.Detekt> {
this.jvmTarget = "11"
}
withType<Test> {
useJUnitPlatform()
testLogging {
events("passed","skipped","Failed")
}
}
}
publishing {
publications {
create<MavenPublication>("mavenKotlin") {
from(components["kotlin"])
pom {
licenses {
license {
name.set("The Apache License,Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
}
}
}
}
}
}
}
和我在teamcity中使用的子项目的成果
plugins {
application
kotlin("jvm")
id("com.github.johnrengelman.shadow")
id("org.flywaydb.flyway")
id("io.gitlab.arturbosch.detekt")
`maven-publish`
}
group = "com.rjdesenvolvimento"
version = "0.0.1"
application {
mainClassName = "io.ktor.server.netty.EngineMain"
}
repositories {
jcenter()
maven { url = uri("https://kotlin.bintray.com/ktor") }
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("ch.qos.logback:logback-classic:_")
implementation("io.ktor:ktor-server-netty:_")
implementation("io.ktor:ktor-server-core:_")
implementation("io.ktor:ktor-jackson:_")
implementation(project(":commons:commons.consumer"))
implementation(project(":commons:commons.patterns"))
implementation(project(":commons:commons.kafka"))
implementation(project(":commons:commons.elasticsearch"))
testImplementation("io.ktor:ktor-server-tests:_")
testImplementation(project(":commons:commons.test"))
}
kotlin.sourceSets["main"].kotlin.srcDirs("src")
kotlin.sourceSets["test"].kotlin.srcDirs("test")
sourceSets["main"].resources.srcDirs("resources")
sourceSets["test"].resources.srcDirs("testresources")
detekt {
buildUponDefaultConfig = false
input = files("src")
config = files("resources/detekt.yml")
debug = true
ignoreFailures = false
reports {
xml {
enabled = true
destination = file("build/reports/detekt.xml")
}
html {
enabled = true
destination = file("build/reports/detekt.html")
}
txt {
enabled = true
destination = file("build/reports/detekt.txt")
}
custom {
reportId = "CustomJsonReport"
destination = file("build/reports/detekt.json")
}
}
}
flyway {
url = System.getenv("URL")
user = System.getenv("Psql_USER")
password = System.getenv("Psql_PASSWORD")
baselineOnMigrate = true
locations = arrayOf("filesystem:resources/db/migration")
}
当我尝试运行时,它显示错误消息,该代理与配置不兼容。 我该怎么办?有人可以帮忙吗?
为了更好地理解,将github与该项目一起使用。 https://github.com/rodrigodevelms/Proof-of-concept
更新2:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。