0

I have been using maven this last few days. I was wondering why the install phase launches compile or test phase too ?

I have read the documentation of maven, and as far as I understand, mvn install launches install:install goal. It seems to me that before launching this goal, it launches other goals (or phases) which compiles and tests the project.

Does this mean that maven launches all the phases "before" install phase in the default lifecycle ?

Thanks for your answer (there is something I don't undertand).

Darkkrad
  • 67
  • 1
  • 4
  • You may be confusing "deployment" with "install" Install means it will build the target and install to your repository. – OldProgrammer Jan 29 '19 at 23:05
  • Possible duplicate of [What are Maven goals and phases and what is their difference?](https://stackoverflow.com/questions/16205778/what-are-maven-goals-and-phases-and-what-is-their-difference) – brunobastosg Jan 30 '19 at 01:27

1 Answers1

1

Yes.

Calling a phase like install runs the lifecycle from the beginning up to the phase you call.

If you do not want this behaviour, you need to call a goal (like install:install) explictly (mvn install:install). Usually, building with mvn clean install is the way to go.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142