[英]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. 我正在尝试使用Netbeans运行同一Maven项目的多个实例。 There is only 1 main class in the project.
该项目中只有1个主要课程。 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] 无法在项目客户端上执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean(默认清除):无法清除项目:无法删除C:\\ x \\ x \\ x \\ Client \\ target \\ Client-1.0-SNAPSHOT.jar-> [帮助1]
To see the full stack trace of the errors, re-run Maven with the -e switch. 要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。 Re-run Maven using the -X switch to enable full debug logging.
使用-X开关重新运行Maven以启用完整的调试日志记录。
For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 有关错误和可能的解决方案的更多信息,请阅读以下文章:[帮助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. 我意识到我不能运行多个实例,因为当maven已经在使用中时,maven无法清理/删除该jar文件。 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. 只需构建一次
mvn clean package
,然后通过java -jar ...target/Client-1.0-SNAPSHTO.jar
从不同的控制台窗口多次启动生成的jar。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.