简体   繁体   中英

Running multiple 'instances' of maven project - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean

I am trying to run multiple instances of the same maven project using netbeans. There is only 1 main class in the project. This is the error I get:


Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project Client: Failed to clean project: Failed to delete C:\\x\\x\\x\\Client\\target\\Client-1.0-SNAPSHOT.jar -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


I realise that I cannot run more than one instances because maven cannot clean/delete the jar file while it is already in use. However, I need to get this working; to implement and test multi-threading and synchronisation.

Anyone know a solution or a workaround? Thanks.

Why would you like to run the build in parallel for the same project? Just build once mvn clean package and start your resulting jar several times via java -jar ...target/Client-1.0-SNAPSHTO.jar from different console windows.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM