找不到 kafka-clients-test.jar (org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0)

Jig*_*jar 2 release gradle apache-kafka spring-boot

我正在尝试使用 gradlew 进行发布。我得到低于错误。

有人熟悉这个错误吗?我能够在本地构建所有内容,只有在我们发布时才会发生问题。

17:11:15,004 ERROR - FAILURE: Build failed with an exception.
17:11:15,004 ERROR -
17:11:15,004 ERROR - * What went wrong:
17:11:15,004 ERROR - Could not resolve all files for configuration ':search-tools-service-application:compileClasspath'.
17:11:15,004 ERROR - > Could not find kafka-clients-test.jar (org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0).
17:11:15,004 ERROR - Searched in the following locations:
17:11:15,004 ERROR - file:/local_repo/.m2/repository/org/apache/kafka/kafka-clients/0.10.2-kafka-2.2.0/kafka-clients-0.10.2-kafka-2.2.0-test.jar
17:11:15,004 ERROR -
17:11:15,004 ERROR - * Try:
17:11:15,004 INFO  -
17:11:15,004 INFO  - Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
17:11:15,004 INFO  - Use '--warning-mode all' to show the individual deprecation warnings.
17:11:15,004 INFO  - See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
17:11:15,004 INFO  - 5 actionable tasks: 4 executed, 1 up-to-date
17:11:15,004 ERROR - Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
17:11:15,004 ERROR -
17:11:15,004 ERROR - * Get more help at https://help.gradle.org
17:11:15,004 ERROR -
17:11:15,004 ERROR - BUILD FAILED in 13s
17:11:15,374 INFO  - Executing post-execute action...
17:11:15,375 ERROR - Step 'master>Publish Release - Git with Gradle>gradle publish using axion-release' is failed: Gradle build failed.
Errors occurred while build effective model from /local_repo/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.pom:
'build.plugins.plugin[io.spring.gradle.dependencymanagement.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. in log4j:log4j:1.2.16

FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)
  • 出了什么问题:无法解析配置“:search-tools-service-application:compileClasspath”的所有文件。

    找不到 kafka-clients-test.jar (org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0)。在以下位置搜索:file:/local_repo/.m2/repository/org/apache/kafka/kafka-clients/0.10.2-kafka-2.2.0/kafka-clients-0.10.2-kafka-2.2.0-测试文件

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。

  • https://help.gradle.org获取更多帮助

13 秒内构建失败

17:11:15,527 INFO  - Executing post-execute action...
17:11:15,527 ERROR - Step 'master>Publish Release - Git with Gradle' is failed: Composite step 'Publish Release - Git with Gradle' failed due to unsatisfied success condition.
17:11:15,644 INFO  - Executing post-execute action...
17:11:15,644 ERROR - Step 'master' is failed: Composite step 'master' failed due to unsatisfied success condition.
Run Code Online (Sandbox Code Playgroud)

小智 8

我有同样的问题,这是由于mavenLocal()之前mavenCentral()在您build.gradle文件的存储库部分。其他东西下载kafka-clients-2.x.x.jar到本地存储库中,并且由于 gradle 可以在那里找到它,它甚至不会再kafka-clients-2.x.x-test.jar在 maven central 中查找。

尝试删除下面的原始org/apache/kafka/kafka-clients目录并重~/.m2/repository试。这为我解决了这个问题。

  • 只是切换`mavenLocal()`的顺序对我有用。谢谢 (2认同)