gpt4 book ai didi

windows - 无法删除一些 child 。发生这种情况的原因是,进程已打开文件或在目标目录中设置了工作目录

转载 作者:行者123 更新时间:2023-12-03 03:44:15 28 4
gpt4 key购买 nike

由于某些未知的原因,每当我启动笔记本后运行gradle clean build时,它就会按预期运行。当我第二次尝试时,我总是得到

Unable to delete directory 'C:\_d\mycompany\WSs\demo\build'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- C:\_d\mycompany\WSs\demo\build\classes\kotlin\main\com\mybank
- C:\_d\mycompany\WSs\demo\build\classes\kotlin\main\com
- C:\_d\mycompany\WSs\demo\build\classes\kotlin\main
- C:\_d\mycompany\WSs\demo\build\classes\kotlin\test\com
- C:\_d\mycompany\WSs\demo\build\classes\kotlin\test
- C:\_d\mycompany\WSs\demo\build\classes\kotlin
- C:\_d\mycompany\WSs\demo\build\classes
- C:\_d\mycompany\WSs\demo\build\generated\source\kapt
- C:\_d\mycompany\WSs\demo\build\generated\source\kaptKotlin\main
- C:\_d\mycompany\WSs\demo\build\generated\source\kaptKotlin\test
- C:\_d\mycompany\WSs\demo\build\generated\source\kaptKotlin
- C:\_d\mycompany\WSs\demo\build\generated\source
- C:\_d\mycompany\WSs\demo\build\generated
- C:\_d\mycompany\WSs\demo\build\kotlin\compileKotlin\caches-jvm\inputs
- C:\_d\mycompany\WSs\demo\build\kotlin\compileKotlin\caches-jvm\jvm\kotlin
- C:\_d\mycompany\WSs\demo\build\kotlin\compileKotlin\caches-jvm\jvm
- and more ...
New files were found. This might happen because a process is still writing to the target directory.
- C:\_d\mycompany\WSs\demo\build\kotlin\compileKotlin
我发现有人失败了类似的问题,但是使用的是Android Studio/Ubuntu(我使用的是IntelliJ Community/Windows 10):[其他问题] [1]
我仔细尝试了所有建议,但都没有解决我的问题。如果我重新启动Windows并仅工作一次,则只能恢复工作。
一些建议是:
1-关闭工作室并转到问题所在的路径,然后删除那里的文件夹。
我尝试关闭IntelliJ,但无法直接删除该文件夹
2-文件>设置>构建,执行,部署>即时运行>取消选中此复选框(启用即时运行以热插拔代码)
我的IntelliJ中没有这样的可选
IntelliJ IDEA 2020.2.3(社区版)
Build#IC-202.7660.26,建于2020年10月6日
运行时版本:11.0.8 + 10-b944.34 amd64
VM:由JetBrains s.r.o提供的OpenJDK 64位服务器VM。
Windows 10 10.0
GC:ParNew,ConcurrentMarkSweep
内存:1963M
核心数:8
非捆绑插件:Lombook插件,org.jetbrains.kotlin
3-gradlew清洁
同一期
4-右键单击目录,在将出现的上下文菜单上单击属性,然后取消选中“只读”属性。之后,单击“应用”以应用更改。
我是管理员,但无法更改此类文件夹属性。
5-在Windows中以管理员身份运行android studio对我有用。
同一期
这是我的build.gradle
plugins {
id "org.jetbrains.kotlin.jvm" version "1.4.10"
id "org.jetbrains.kotlin.kapt" version "1.4.10"
id "org.jetbrains.kotlin.plugin.allopen" version "1.4.10"
id "com.github.johnrengelman.shadow" version "6.1.0"
id "io.micronaut.application" version '1.0.5'
id "com.gorylenko.gradle-git-properties" version "2.2.2"
}

version "0.1"
group "com.mybank"

repositories {
mavenCentral()
jcenter()
}

micronaut {
runtime "netty"
testRuntime "junit5"
processing {
incremental true
annotations "com.mybank.*"
}
}

dependencies {
implementation("io.micronaut:micronaut-validation")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime")
implementation("javax.annotation:javax.annotation-api")
implementation("io.micronaut:micronaut-http-client")

implementation("io.micronaut:micronaut-management")
implementation("io.micronaut.sql:micronaut-jdbc-hikari")
implementation("io.micronaut.sql:micronaut-hibernate-jpa")
runtimeOnly("com.h2database:h2")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")



}

mainClassName = "com.mybank.ApplicationKt"
java {
sourceCompatibility = JavaVersion.toVersion('11')
}

compileKotlin {
kotlinOptions {
jvmTarget = '11'
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '11'
}
}
gradle.properties
micronautVersion=2.1.3
kotlinVersion=1.4.10
以及在IntelliJ中看到的build文件夹
[![在此处输入图片描述] [2]] [2]
***已编辑
我没有找到解决方法。我正在从[micronaut] [3]克隆的一个项目现在正在发生
虽然我是Windows管理员,但我无法删除构建文件夹
PS C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin> gradle clean build
> Task :clean FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':clean'.
> java.io.IOException: Unable to delete directory 'C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build'
Failed to delete some children. This might happen because a process has files open or has its working directory set in
the target directory.
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\generated\source\kaptKotlin\main
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\generated\source\kaptKotlin\test
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\generated\source\kaptKotlin
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\generated\source
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\generated
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\incApCache\main
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\incApCache\test
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\incApCache
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\stubs\main
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\stubs\test
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3\stubs
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp\kapt3
- C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin\build\tmp

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 13s
1 actionable task: 1 executed
PS C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin> gradle stop

FAILURE: Build failed with an exception.

* What went wrong:
Task 'stop' not found in root project 'hello-world-kotlin'.

* Try:
Run gradle tasks to get a list of available tasks. 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
PS C:\_d\toLearn\micronaut-grpc\examples\hello-world-kotlin>


[1]: https://stackoverflow.com/questions/25051278/unable-to-clean-project-in-android-studio/28139913
[2]: /image/BUhTt.png
[3]: https://github.com/micronaut-projects/micronaut-grpc.git

最佳答案

问题是您有多个Gradle进程仍在保持文件锁。
当碰巧停止在backgorund中运行的所有守护程序时,您可以尝试运行gradle --stop(通常有帮助)。
您还可以通过运行gradle --status来检查守护程序的状态。对我来说,输出:

No Gradle daemons are running.

Only Daemons for the current Gradle version are displayed.
See https://docs.gradle.org/6.5/userguide/gradle_daemon.html#sec:status
如果您看到某物,则可能是问题。
使用 --no-daemon--no-parallel可能会有所帮助,但它们只会隐藏潜在的问题。
以我为例,当发生这种情况时,我意识到我的进程在后台运行,因为测试从未完成。检查所有未完成/未完成的进程的线程和/或协程使用情况。
发生在我身上的另一种情况是,当我使用 ProcessBuilder启动另一个Java进程并且它没有退出时。

关于windows - 无法删除一些 child 。发生这种情况的原因是,进程已打开文件或在目标目录中设置了工作目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64734646/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com