简体   繁体   中英

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

I have a multi project build

main-module

-> api

-> pets

-> gateway

  1. Configured settings.gradle in root project to include all the subprojects.
  2. Included api in pets and gateway -> compile project(":api").
  3. Start pets with gradlew run -> starts successfully
  4. Start gateway with gradlew run -> I get below error

Execution failed for task ':api:jar'.

java.io.IOException: Unable to delete file: \\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. 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

See up to date checks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM