Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.8.1
-
None
Description
Suppose we have a project with two modules: "Lib" and "App", App depends on Lib. And we ran mvn clean install earlier. Then we changed something in Lib sources. Now consider these two scenarios:
- If we run mvn compile: Lib gets recompiled, then App gets recompiled - all good.
- If we run mvn package: Lib gets recompiled, but App doesn't ("Nothing to compile - all classes are up to date") - a bug.
The problem here is that if the current build requests packaging a jar then Lib is added to App's compilePath as .../lib/target/lib-x.y.z.jar (instead of .../lib/target/classes in case of "compile" goal). And the isDependencyChanged() function in AbstractCompilerMojo only checks class files, not jars.
This can be reproduced using the existing integration test https://github.com/apache/maven-compiler-plugin/tree/master/src/it/MCOMPILER-349_dependencyChanged, you'll just need to replace "compile" with "package" in the invoker.properties file.
Attachments
Issue Links
- fixes
-
MSHARED-763 Include a dependency change detection.
- Closed
- is related to
-
MCOMPILER-278 Incremental build does not track inter-module dependencies.
- Closed
- relates to
-
MCOMPILER-492 Dependent modules are always recompiled if we run the "package" goal
- Closed
- links to