I have a large maven multi-module project with a sibling folder setup (a
maven parent directory in the same parent-folder as all the modules; no
nested projects/modules). Eclipse is the IDE, with the M2E plugin. All code
is in a mono-repo (the parent-folder). All maven/code versions are
up-to-date (maven 3).

The maven install phase is only used for final builds in the release cycle.
Otherwise, all development relies on the code being linked via sibling
folders and the /target sub-folder.

I am trying to use the maven-build-cache-extension. If I use the cache and
execute "mvn clean", maven deletes all the source code in /target.
Subsequently, "mvn compile" determines that the project is up-to-date and
does not repopulate the /target folder. All modules which depend on other
modules then complain about "missing jars".

The "IDE Support" chapter in the documentation says:

>The cache doesn't restore the entire project state. Compiled classes,
unpacked artifacts, and similar ones typically will not be restored in the
build directory (aka target). Configure your IDE to not use Maven build
(target) directories for compilation and execution. In that case, IDE will
provide fast compilation using native caches, and the build cache will
supplement that with fast builds.

This seems important! But I have been unable to find any additional
explanation on the internets.

It has never been clear to me when to use the IDE to update the eclipse
projects (alt-F5) and when to use "mvn compile". Embarrassing because I've
used maven for many years.

Am I really supposed to tell maven to use a different build (target)
directory? If the "cache doesn't restore the entire project state", what
state DOES it restore? What is the difference between "fast compilation
using native caches" and "fast builds" when the only command is "mvn
compile"? If I use "alt-F5 or Project -> Build automatically" in eclipse,
what benefit does the maven-build-cache-extension provide? What IS the best
way to take advantage of maven-build-cache-extension when all development
takes place in an IDE without need for linking via jars?

I am afraid I am missing critical understanding. Any help appreciated. TIA.

Rich MacDonald

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Reply via email to