23

I have a maven project in eclipse. I use mvn clean install for installing dependencies in pom.xml.

I want to know what mvn eclipse:clean eclipse:eclipse command does and also the difference between these two?

Dev
  • 13,492
  • 19
  • 81
  • 174
  • possible duplicate of [Difference between Eclipse's "clean project" and Maven's "mvn clean" in m2e](http://stackoverflow.com/questions/8853098/difference-between-eclipses-clean-project-and-mavens-mvn-clean-in-m2e) – Steve Chambers Sep 16 '15 at 14:45

1 Answers1

36

mvn eclipse:clean eclipse:eclipse
The second command is completely different from the first one.
First, it deletes previously generated Eclipse files (like .project and .classpath and .settings) and then generates new ones, thus, effectively updating them. It may be useful if you introduced some changes in pom.xml (like new dependencies or plugins) and want Eclipse to be aware of them.

mvn clean install
The first command deletes target directory and then builds all you code and installs artifacts into local repository.

Ahmed Nabil
  • 17,392
  • 11
  • 61
  • 88
madhead
  • 31,729
  • 16
  • 153
  • 201
  • 3
    It should be noted that the m2e (maven for eclipse) plugin is vastly improved since eclipse 4.3 and so you really shouldn't need to use 'mvn eclipse:eclipse' command to generate/update eclipse projects. – tdrury Jun 12 '15 at 14:45
  • @madhead The answer you gave was so valuable to me. I had an issue in visual studio code. I created a project in spring boot and i opened it with vs-code by typing `code .` in the project directory. Then I added a lombok dependency in the pom.xml file. After vs-code was having problem recognizing some packages in occurrence **javax.persistence.*** But after reading your answer I close vs-code, run **./mvnw eclipse:clean eclipse:eclipse** the problem seem to be resolved. Thank you – Elom Atsou Agboka Nov 05 '18 at 23:10