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
.
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
My POM File :
<?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. Try to access the directory that maven is trying to delete. 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:
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.