Quarkus在build.gradle.kts中强制使用平台BOM会破坏添加的依赖关系。

huangapple go评论88阅读模式
英文:

Quarkus enforcedplatform BOM in build.gradle.kts breaks added dependency

问题

我已经为我的Quarkus项目添加了一个依赖项implementation("com.netflix.conductor:conductor-client:3.13.8")。然而,enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")破坏了conductor-client的传递依赖关系。我查看了Gradle文档,他们建议使用exclude,但在我的情况下,exclude没有起作用。

构建Gradle文件如下:

plugins {
    kotlin("jvm") version "1.8.22"
    kotlin("plugin.allopen") version "1.8.22"
    id("io.quarkus")
}
    
repositories {
    mavenCentral()
    mavenLocal()
}
    
val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project
val ktor_version: String by project
    
dependencies {
    implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
    implementation("io.quarkus:quarkus-picocli")
    implementation("io.quarkus:quarkus-kotlin")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("io.quarkus:quarkus-arc")
    implementation("io.ktor:ktor-client-cio-jvm:2.3.3")
    testImplementation("io.quarkus:quarkus-junit5")
    implementation("io.ktor:ktor-client-core:$ktor_version")
    implementation("io.ktor:ktor-client-cio:$ktor_version")
    // https://mvnrepository.com/artifact/com.netflix.conductor/conductor-client
    implementation("com.netflix.conductor:conductor-client:3.13.8")
}
    
group = "io.my1795"
version = "1.0.0-SNAPSHOT"
    
    
    
java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}
   
tasks.withType<Test> {
    systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
}
allOpen {
    annotation("jakarta.ws.rs.Path")
    annotation("jakarta.enterprise.context.ApplicationScoped")
    annotation("io.quarkus.test.junit.QuarkusTest")
}
    
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
    kotlinOptions.javaParameters = true
}

quarkusBuild之后出现错误:

11:29:08 AM: Executing 'quarkusBuild'...

> Task :processResources UP-TO-DATE
> Task :quarkusGenerateCode FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings
2 actionable tasks: 1 executed, 1 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusGenerateCode'.
> Could not resolve all files for configuration ':quarkusProdBaseRuntimeClasspathConfiguration'.
   > Could not resolve org.apache.logging.log4j:log4j-api:2.20.0.
     Required by:
         project : > io.quarkus.platform:quarkus-bom:3.2.3.Final
      > Cannot find a version of 'org.apache.logging.log4j:log4j-api' that satisfies the version constraints:
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Constraint path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'io.quarkus.platform:quarkus-bom:3.2.3.Final' (enforced-platform-runtime) --> 'org.apache.logging.log4j:log4j-api:2.20.0'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-core:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-jul:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-web:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-annotations:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'

   > Could not resolve org.apache.logging.log4j:log4j-api:{strictly 2.17.2}.
     Required by:
         project : > com.netflix.conductor:conductor-client:3.13.8
         project : > com.netflix.conductor:conductor-client:3.13.8 > com.netflix.conductor:conductor-common:3.13.8
         project : > com.netflix.conductor:conductor-client:3.13.8 > com.netflix.conductor:conductor-common:3.13.8 > com.netflix.conductor:conductor-annotations:3.13.8
      > Cannot find a version of 'org.apache.logging.log4j:log4j-api' that satisfies the version constraints:
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Constraint path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'io.quarkus.platform:quarkus-bom:3.2.3.Final' (enforced-platform-runtime) --> 'org.apache.logging.log4j:log4j-api:2.20.0'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-core:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-jul:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-web:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-annotations:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'

   > Could not resolve org.apache.logging.log4j:log4j-api:2.17.2.
     Required by:
         project : > com.netflix.conductor:conductor-client:3.13.8 > org.apache.logging.log4j:log4j-core:2.17.2
         project : > com.netflix.conductor:conductor-client:3.13.8 > org.apache.logging.log4j:log4j-slf4j-impl:2.17.2
         project : > com.netflix.conductor:conductor-client:3.13.8 > org.apache.logging.log4j:log4j-jul:2.17.2
         project : > com.netflix.conductor:conductor-client:3.13.8 > org.apache.logging.log4j:log4j-web:2.17.2
      > Cannot find a version of 'org.apache.logging.log4j:log4j-api' that satisfies the version constraints:
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Constraint path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'io.quarkus.platform:quarkus-bom:3.2.3.Final' (enforced-platform-runtime) --> 'org.apache.logging.log4j:log4j-api:2.20.0'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-core:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-jul:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-web:2.17.2' (runtime) --> 'org.apache.logging.log4j:log4j-api:2.17.2'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'
           Dependency path 'io.my1795:conductor-commander:1.0.0-SNAPSHOT' --> 'com.netflix.conductor:conductor-client:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-common:3.13.8' (runtimeElements) --> 'com.netflix.conductor:conductor-annotations:3.13.8' (runtimeElements) --> 'org.apache.logging.log4j:log4j-api:{strictly 2.17.2}'


* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 370ms
11:29:08 AM: Execution finished 'quarkusBuild'.
英文:

I have added a dependecny implementation(&quot;com.netflix.conductor:conductor-client:3.13.8&quot;)
for my quarkus project. However enforcedPlatform(&quot;${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}&quot;) breaks transitive dependency of conductor-client. I looked at gradle documentation, They suggest to use exclude but exclude did not work in my case

Build Gradle File:

plugins {
kotlin(&quot;jvm&quot;) version &quot;1.8.22&quot;
kotlin(&quot;plugin.allopen&quot;) version &quot;1.8.22&quot;
id(&quot;io.quarkus&quot;)
}
repositories {
mavenCentral()
mavenLocal()
}
val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project
val ktor_version: String by project
dependencies {
implementation(enforcedPlatform(&quot;${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}&quot;))
implementation(&quot;io.quarkus:quarkus-picocli&quot;)
implementation(&quot;io.quarkus:quarkus-kotlin&quot;)
implementation(&quot;org.jetbrains.kotlin:kotlin-stdlib-jdk8&quot;)
implementation(&quot;io.quarkus:quarkus-arc&quot;)
implementation(&quot;io.ktor:ktor-client-cio-jvm:2.3.3&quot;)
testImplementation(&quot;io.quarkus:quarkus-junit5&quot;)
implementation(&quot;io.ktor:ktor-client-core:$ktor_version&quot;)
implementation(&quot;io.ktor:ktor-client-cio:$ktor_version&quot;)
// https://mvnrepository.com/artifact/com.netflix.conductor/conductor-client
implementation(&quot;com.netflix.conductor:conductor-client:3.13.8&quot;)
}
group = &quot;io.my1795&quot;
version = &quot;1.0.0-SNAPSHOT&quot;
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType&lt;Test&gt; {
systemProperty(&quot;java.util.logging.manager&quot;, &quot;org.jboss.logmanager.LogManager&quot;)
}
allOpen {
annotation(&quot;jakarta.ws.rs.Path&quot;)
annotation(&quot;jakarta.enterprise.context.ApplicationScoped&quot;)
annotation(&quot;io.quarkus.test.junit.QuarkusTest&quot;)
}
tasks.withType&lt;org.jetbrains.kotlin.gradle.tasks.KotlinCompile&gt; {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
kotlinOptions.javaParameters = true
}

Failure after quarkusBuild

11:29:08 AM: Executing &#39;quarkusBuild&#39;...

&gt; Task :processResources UP-TO-DATE
&gt; Task :quarkusGenerateCode FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use &#39;--warning-mode all&#39; to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings
2 actionable tasks: 1 executed, 1 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task &#39;:quarkusGenerateCode&#39;.
&gt; Could not resolve all files for configuration &#39;:quarkusProdBaseRuntimeClasspathConfiguration&#39;.
   &gt; Could not resolve org.apache.logging.log4j:log4j-api:2.20.0.
     Required by:
         project : &gt; io.quarkus.platform:quarkus-bom:3.2.3.Final
      &gt; Cannot find a version of &#39;org.apache.logging.log4j:log4j-api&#39; that satisfies the version constraints:
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Constraint path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;io.quarkus.platform:quarkus-bom:3.2.3.Final&#39; (enforced-platform-runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.20.0&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-core:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-slf4j-impl:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-jul:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-web:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-annotations:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;

   &gt; Could not resolve org.apache.logging.log4j:log4j-api:{strictly 2.17.2}.
     Required by:
         project : &gt; com.netflix.conductor:conductor-client:3.13.8
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; com.netflix.conductor:conductor-common:3.13.8
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; com.netflix.conductor:conductor-common:3.13.8 &gt; com.netflix.conductor:conductor-annotations:3.13.8
      &gt; Cannot find a version of &#39;org.apache.logging.log4j:log4j-api&#39; that satisfies the version constraints:
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Constraint path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;io.quarkus.platform:quarkus-bom:3.2.3.Final&#39; (enforced-platform-runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.20.0&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-core:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-slf4j-impl:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-jul:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-web:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-annotations:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;

   &gt; Could not resolve org.apache.logging.log4j:log4j-api:2.17.2.
     Required by:
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; org.apache.logging.log4j:log4j-core:2.17.2
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; org.apache.logging.log4j:log4j-slf4j-impl:2.17.2
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; org.apache.logging.log4j:log4j-jul:2.17.2
         project : &gt; com.netflix.conductor:conductor-client:3.13.8 &gt; org.apache.logging.log4j:log4j-web:2.17.2
      &gt; Cannot find a version of &#39;org.apache.logging.log4j:log4j-api&#39; that satisfies the version constraints:
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Constraint path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;io.quarkus.platform:quarkus-bom:3.2.3.Final&#39; (enforced-platform-runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.20.0&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-core:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-slf4j-impl:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-jul:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-web:2.17.2&#39; (runtime) --&gt; &#39;org.apache.logging.log4j:log4j-api:2.17.2&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;
           Dependency path &#39;io.my1795:conductor-commander:1.0.0-SNAPSHOT&#39; --&gt; &#39;com.netflix.conductor:conductor-client:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-common:3.13.8&#39; (runtimeElements) --&gt; &#39;com.netflix.conductor:conductor-annotations:3.13.8&#39; (runtimeElements) --&gt; &#39;org.apache.logging.log4j:log4j-api:{strictly 2.17.2}&#39;


* Try:
&gt; Run with --stacktrace option to get the stack trace.
&gt; Run with --info or --debug option to get more log output.
&gt; Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 370ms
11:29:08 AM: Execution finished &#39;quarkusBuild&#39;.

答案1

得分: 0

我会说这是conductor中的一个错误。

一个库通常不应该严格依赖于某个具体版本,否则就会出现像这样的问题,其中库严格要求某个版本,而某个构建或其他库严格依赖于另一个版本,导致无法解决。

在你的情况下,你使用了enforcedPlatform来添加第二个严格版本,这会添加严格的约束,通常也不应该使用。它更适用于罕见的边缘情况,通常只应使用platform

但是除此之外,如果你查看https://github.com/Netflix/conductor/blob/v3.13.8/build.gradle#L108-L116,似乎严格边界应该允许在2.17.2和3.0之间的任何版本,但构建的其他部分似乎将其更改为严格只有2.17.2。

除此之外,除了log4j-core之外的整个块都是非常可疑的。它很可能是为了防止Log4Shell,但是Log4Shell只影响log4j-core,所以对其他log4j依赖项进行这些操作是没有意义的,而且可能会减慢依赖项解析。

但是确实可以使用排除来临时解决你的问题。你说它没有起作用,但是没有说你在哪里以及如何尝试过。例如,你可以从conductor-client的依赖项中排除它,然后手动依赖它,如果没有其他部分依赖它,并且conductor-client需要它。

英文:

I would say that is a bug in conductor.

A library should usually never strictly depend on some concrete version or you get problems like this where the library strictly requires a version and some build or other library strictly depends on some other version which then cannot be resolved.

In your case you add the second strict version by using enforcedPlatform which adds strict constraints and should usually also not be used. It is more for rare edge cases and usually just platform should be used.

But besides that, if you look at https://github.com/Netflix/conductor/blob/v3.13.8/build.gradle#L108-L116 it seems that the strict boundary should allow any version between 2.17.2 and 3.0, but some other part of the build seems to change this to strictly only 2.17.2.

Besides that the whole block except for log4j-core is very questionable. It is most probably to protect against Log4Shell, which anyway only affects log4j-core, so having all theses for the other log4j dependencies is pointless anyway and just slows down dependency resolution potentially.

But indeed an exclude should work to ad-hoc solve your problem. You said it didn't work, but but did not say where and how you tried it. You could for example exclude it from the conductor-client dependency and then depend manually on it if no other part depends on it and conductor-client needs it.

huangapple
  • 本文由 发表于 2023年8月9日 16:30:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76865920.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定