I use STS(spring tool suite) + maven plugin.
Every time when I run my application using maven-clean
I see following error:
[INFO] Scanni
If all steps (in existing answers) dont work , Just close eclipse and again open eclipse .
solved by deleting the target folder manually.
You may also try try -Dmaven.clean.failOnError=false
(from Maven FAQ)
Delete the java.exe process in Task Manager and run mvn clean install.It worked for me.
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>
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!