maven… Failed to clean project: Failed to delete ..\org.ow2.util.asm-asm-tree-3.1.jar

后端 未结 20 1704
臣服心动
臣服心动 2020-12-24 10:02

I use STS(spring tool suite) + maven plugin.

Every time when I run my application using maven-clean I see following error:

[INFO] Scanni         


        
相关标签:
20条回答
  • 2020-12-24 10:58

    If all steps (in existing answers) dont work , Just close eclipse and again open eclipse .

    0 讨论(0)
  • 2020-12-24 11:03

    solved by deleting the target folder manually.

    0 讨论(0)
  • 2020-12-24 11:04

    You may also try try -Dmaven.clean.failOnError=false (from Maven FAQ)

    0 讨论(0)
  • 2020-12-24 11:04

    Delete the java.exe process in Task Manager and run mvn clean install.It worked for me.

    0 讨论(0)
  • 2020-12-24 11:04

    In pre-clean phase I execute with Maven Unlocker program. This program unlock all files and directory for anyone program.

    I execute this with maven-antrun-plugin and only in windows systems

    <profile>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.8</version>
            <executions>
              <execution>
                <phase>pre-clean</phase>
                <configuration>
                  <tasks>
                    <exec dir="${project.build.directory}" executable="cmd" failonerror="false">
                      <arg value="Unlocker.exe" />
                      <arg value="/S" />
                    </exec>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    0 讨论(0)
  • 2020-12-24 11:07

    Probably there are many processes that use sources compiled, could be a server, an old maven instruction or IDE. Sure terminate all processes, stop the server and then execute maven again. If the problem persists, you should close java.exe process.

    Regards!

    0 讨论(0)
提交回复
热议问题