Can mvn compile
be expected to work with multi-module Maven reactor builds?
I am trying to work on a project that uses a reactor/multi-module Maven build. When mvn compile
failed*, I was told by persons familiar with the project that mvn install
is needed, and not mvn compile
, because it is a reactor build.
While mvn install
indeed works because Maven can then pull the build dependency out of the local repository, it seems wrong to me that I must publish to the repository since doing so can create problems, especially in CI environments.
However, nearly every example I can find surrounding a multi-module project uses mvn clean install
, including Maven by Example. I have found no examples of mvn compile
that I can attribute to multi-module projects, making me inclined to think there is a Maven limitation/requirement here.
I note that mvn compile
did work for me with the example provided in Maven by Example, but that is a relatively simple project so I know I cannot take that to mean it should work in general.
* It failed because it could not find one of the dependencies that was built successfully earlier in the reactor build.