为Gradle Multi项目配置TeamCity

问题描述

我有一个多项目gradle,其配置如下:

enter image description here

  • 红色箭头:root gradle
  • 绿色箭头:访问项目
  • 紫色箭头:公地
  • 蓝色箭头:公司项目

整个项目都在一个存储库(主库)中,每个子项目我都建立了一个git子树,并且有自己的存储库。我正在尝试配置自动部署,但不能,甚至不能进行任何清理。我进行了如下配置:

enter image description here

我的根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

更新:图片错误

enter image description here

更新2:

添加了gradle包装器,并发生以下错误

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)