简体   繁体   English

无法在项目 spring-boot-keycloak 上执行目标 org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean)

[英]Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project spring-boot-keycloak

My application was working fine and i was able to do mvn clean install using <packaging>jar</packaging> and able to execute a jar file but i change it to war file and i was't able to do mvn clean install .我的应用程序运行良好,我能够使用<packaging>jar</packaging>进行 mvn clean install 并能够执行 jar 文件,但我将其更改为 war 文件并且我无法进行mvn clean install

is there any deference between these too ?这些之间也有任何尊重吗? I looked for more solutions but with no luck我寻找了更多的解决方案,但没有运气

Error :错误 :

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project spring-boot-keycloak: Failed to clean project: Failed to delete C:\\Users\\user\\Documents\\New folder\\E.Services\\target无法在项目 spring-boot-keycloak 上执行目标 org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean):无法清理项目:无法删除 C:\\Users\\user \\Documents\\New folder\\E.Services\\target

My POM File :我的 POM 文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.baeldung.keycloak</groupId>
    <artifactId>spring-boot-keycloak</artifactId>
    <version>0.0.1</version>
    <name>spring-boot-keycloak</name>
    <packaging>war</packaging>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.keycloak.bom</groupId>
                <artifactId>keycloak-adapter-bom</artifactId>
                <version>3.3.0.Final</version>
                <type>pom</type>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>


<-- Many dependencies -->

    </dependencies>
    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Plugin Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </repository>

    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

无法删除目标——这是一个文件系统问题,实际上是一个非常常见的问题——你可能在 ${project.home}/target 目录中打开了一个文件或一个 Windows 资源管理器...

这是一个文件系统问题实际上是一个非常常见的问题——您可能在 ${project.home}/target 目录中打开了一个文件或一个 Windows 资源管理器...

There can be many causes for this error.此错误可能有多种原因。 One of the main reasons could be that the directory maven is trying to delete is locked.主要原因之一可能是 maven 尝试删除的目录被锁定。 Try to access the directory that maven is trying to delete.尝试访问 maven 尝试删除的目录。 If you get a prompt like "the file or directory is corrupted or unreadable", try fixing disk errors.如果您收到类似“文件或目录已损坏或无法读取”的提示,请尝试修复磁盘错误。 It worked for me.它对我有用。 The steps I followed are:我遵循的步骤是:

  1. Launch CMD on your Windows PC via the Start Menu.通过开始菜单在 Windows PC 上启动 CMD。 Right click on it to run it as administrator.右键单击它以管理员身份运行它。
  2. Type chkdsk /fx: in the Command Prompt window and press Enter to execute the command.在命令提示符窗口中键入 chkdsk /fx: 并按 Enter 执行命令。 X here is the drive letter of the corrupted partition that you want to check.这里的 X 是您要检查的损坏分区的驱动器号。 Please replace it with your own drive letter.请用您自己的驱动器号替换它。

暂无
暂无

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

相关问题 如何解决“无法在项目上执行目标 org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)”? - How to solve "Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project"? Maven - 未能执行目标 org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Maven - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean 无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean 运行Maven项目的多个“实例”-无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean - Running multiple 'instances' of maven project - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean Maven 无法执行目标 org.apache.maven.plugins:maven-clean-plugin:2.5:clean 无法删除 access_log - Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log 如何修复Maven异常:[错误]无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean - How to fix maven exception : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean Maven 全新安装:无法执行目标 org.apache.maven.plugins:maven-resources-plugin:3.20。 - Maven clean install: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources Maven:插件 org.apache.maven.plugins:maven-clean-plugin:2.5 或其依赖项之一无法解析 - Maven : Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.5.1:在项目上编译(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project 无法在项目上执行目标org.apache.maven.plugins:maven-compiler-plugin:3.3:compile(default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM