0
votes

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).

1
You may be confusing "deployment" with "install" Install means it will build the target and install to your repository. - OldProgrammer

1 Answers

1
votes

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.