Yes, the command mvn clean compile package
will run the Phase Compile twice.
This can be easily checked in the Maven log, as example below, in the excerpt maven-compiler-plugin:3.3:compile
that sometimes appears:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MyProject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ MyProject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 264 source files to C:\projetos\MyProject\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MyProject ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ MyProject ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 264 source files to C:\projetos\MyProject\target\classes
So to get the most performance would be to send alone
mvn clean package
?– Jefferson Quesado
Of course. It doesn’t even make sense the Compile package command, because as you said yourself, the package already does the Compile.
– Murillo Goulart