Difference between Eclipse's “clean project” and Maven's “mvn clean” in m2e

喜你入骨 提交于 2019-12-12 07:44:37

问题


I use M2e + Eclipse + Maven and I would like to know what the difference is between:

  • running "mvn clean" in a terminal and
  • running "clean project" from Eclipse?

Can anyone please advise?


回答1:


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.




回答2:


I have the following entry in my pom.xml file:

<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 does get removed.



来源:https://stackoverflow.com/questions/8853098/difference-between-eclipses-clean-project-and-mavens-mvn-clean-in-m2e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!