简体   繁体   English

多项目gradle构建-java.io.IOException:无法删除文件

[英]Multi project gradle build - java.io.IOException: Unable to delete file

I have a multi project build 我有一个多项目构建

main-module 主模块

-> api -> API

-> pets ->宠物

-> gateway ->网关

  1. Configured settings.gradle in root project to include all the subprojects. 在根项目中配置了settings.gradle以包括所有子项目。
  2. Included api in pets and gateway -> compile project(":api"). 宠物和网关中包含的api->编译项目(“:api”)。
  3. Start pets with gradlew run -> starts successfully 用gradlew run启动宠物->成功启动
  4. Start gateway with gradlew run -> I get below error 使用gradlew run启动网关->我收到以下错误

Execution failed for task ':api:jar'. 任务':api:jar'的执行失败。

java.io.IOException: Unable to delete file: \\main-module\\api\\build\\libs\\api.jar java.io.IOException:无法删除文件:\\ main-module \\ api \\ build \\ libs \\ api.jar

How do I resolve this? 我该如何解决? Thanks. 谢谢。

It seems there's something wrong with your build. 您的构建似乎有问题。 The api:jar task should be considered as UP-TO-DATE at step 4 (since step 3 has already built it and nothing has changed) but it seems that it's trying to build the jar again. api:jar任务应该在第4步视为UP-TO-DATE(因为第3步已经构建了它,并且没有任何改变),但似乎它正在尝试再次构建jar。 Most likely cause is a task input (a file) has changed 最可能的原因是任务输入(文件)已更改

I'd guess that some of your task inputs/outputs are incorrect. 我猜想您的某些任务输入/输出不正确。 Or maybe you generate a file with the current date/time in it as part of your build process?. 还是在生成过程中生成了包含当前日期/时间的文件? You can try running gradle with --info to see why api:jar task is not UP-TO-DATE for step 4 您可以尝试使用--info运行gradle,以查看步骤4的api:jar任务为何不最新

See up to date checks 查看最新检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Gradle 无法将 sysout 写入文件 - java.io.IOException:无法删除文件 - Gradle unable to write sysout to file - java.io.IOException: Unable to delete file java.io.IOException:无法删除原始文件moveFileToDirectory - java.io.IOException: Failed to delete original file moveFileToDirectory “ java.io.IOException:这可能不是PDF文件” - “java.io.IOException: This may not be a PDF File” Avro - java.io.IOException:不是数据文件 - Avro - java.io.IOException: Not a data file java.io.IOException:找不到文件 - java.io.IOException: File Not Found java.io.IOException: error=2, 没有那个文件或目录 - java.io.IOException: error=2, No such file or directory java.io.IOException: 无法运行程序“...”: java.io.IOException: error=2, No such file or directory - java.io.IOException: Cannot run program “…”: java.io.IOException: error=2, No such file or directory java.io.IOException:java.io.FileNotFoundException :(无此类文件或目录) - java.io.IOException: java.io.FileNotFoundException:(No such file or directory) 无法启动测试系统'slim':java.io.IOException:无法运行程序“ java”:error = 2,没有这样的文件或目录 - Unable to start test system 'slim': java.io.IOException: Cannot run program “java”: error=2, No such file or directory java.io.IOException java - java.io.IOException java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM