Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 找不到kafka-clients-test.jar(org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0)_Spring Boot_Gradle_Apache Kafka_Release - Fatal编程技术网

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

Spring boot 找不到kafka-clients-test.jar(org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0),spring-boot,gradle,apache-kafka,release,Spring Boot,Gradle,Apache Kafka,Release,我正在尝试使用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 configurati

我正在尝试使用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.
  • 出了什么问题: 无法解析配置的所有文件:“搜索工具服务应用程序:compileClasspath”

    找不到kafka-clients-test.jar(org.apache.kafka:kafka-clients:0.10.2-kafka-2.2.0)。 在以下位置搜索: 文件:/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

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

  • 得到更多的帮助

构建在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.

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


尝试删除
~/.m2/repository
下的原始
org/apache/kafka/kafka客户端
目录,然后重试。这为我解决了问题。

您是否尝试访问本地_repo/.m2/repository/,并检查该文件是否存在?更多信息,此错误发生在快速构建计算机上。在我的本地版本中,maven中没有该jar文件,但构建工作仍然正常,我们正在使用gradle,在我的gradle缓存中,下面的jar是/Users/gajjarj/.gradle/caches/modules-2/files-2.1/org.apache.kafka/kafka-clients/0.10.2-kafka-2.2.0/b185c7d7529f2cebffc831161f9457aff0f15779/kafka-clients-0.10.2-kafka-2.0-test.jar只需切换
mavenLocal()
的顺序对我有效。谢谢