eclipse m2e中Eclipse的“clean project”和Maven的“mvn clean”的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8853098/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between Eclipse's "clean project" and Maven's "mvn clean" in m2e
提问by balteo
I use M2e + Eclipse + Maven and I would like to know what the difference is between:
我使用 M2e + Eclipse + Maven,我想知道它们之间有什么区别:
- running "mvn clean" in a terminaland
- running "clean project" from Eclipse?
- 在终端中运行“mvn clean”并
- 从 Eclipse 运行“干净的项目”?
Can anyone please advise?
任何人都可以请指教吗?
采纳答案by Giorgos Dimtsas
From some quick tests, it seems that Eclipse's clean project
is only clearing out the folders that are set as output folder in the project's preferences, whereas maven's clean
is deleting the /target folder completely.
从一些快速测试来看,Eclipse 似乎clean project
只清除了项目首选项中设置为输出文件夹的文件夹,而 mavenclean
则完全删除了 /target 文件夹。
回答by Peter Lynch
I have the following entry in my pom.xml file:
我的 pom.xml 文件中有以下条目:
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>target</directory>
<excludes>
<exclude>classes/db/**</exclude>
</excludes>
</fileset>
</filesets>
<verbose>true</verbose>
</configuration>
When I do a mvn clean from the command line, the directory that I want kept (classes/db in the output directory) is not deleted, as I expect. However, when I do a Clean in Eclipse, the directory doesget removed.
当我从命令行执行 mvn clean 时,我想要保留的目录(输出目录中的类/db)没有被删除,正如我所期望的。但是,当我在 Eclipse 中执行 Clean 时,该目录确实被删除了。