1

Update: Does Project->Build Project in Eclipse with m2e include any Maven goal by default?

Does including <build> <defaultGoal>install</defaultGoal> </build> into POM.xml change the action of "Build Project" and add the second compilation also by Maven Builder?

builders

When the flag Project-> Build automatically is checked in Eclipse two builders do differnt things when I update a project. As far as I understand:

1) Maven Project Builder gets dependencies when I update pom.xml. 2) One of these two builders compiles code when I change it.

a. Which builder compiles code? As far as I know Maven has its own JAVA_HOME. And I can also attach any JRE to my Eclipse project. So JREs may be different.

b. What other actions does Maven Builder do and when (when updating pom or code)?

Ekaterina
  • 1,642
  • 3
  • 19
  • 36
  • Possible duplicate of [How do Java and Maven builders work together in eclipse?](https://stackoverflow.com/questions/6832789/how-do-java-and-maven-builders-work-together-in-eclipse) – howlger Aug 20 '17 at 13:09
  • And which builder works first when choose Project->Build Project? – Ekaterina Aug 20 '17 at 13:27
  • The topmost builder comes first. To change the order select a builder an press _Up_ or _Down_. If the `.classpath` is edited by the _Maven Project Builder_ then this change triggers another build, so the _Java Builder_ sees the correct dependencies. – howlger Aug 20 '17 at 13:51
  • Thanks you. Does including install into POM.xml adds the second compilation? – Ekaterina Aug 20 '17 at 14:58

1 Answers1

1
  • The Maven builder will build according to the goal which is defined to it and check the correctness of your dependencied by the pom file.
  • The Java builder compiles the code and automatically and responsible about ther correctness of your Eclipse project.
sharon182
  • 533
  • 1
  • 4
  • 19