diff --git a/src/it/MCOMPILER-500-package-info-incr/verify.groovy b/src/it/MCOMPILER-500-package-info-incr/verify.groovy index ef41bdeca..ccfebf3f4 100644 --- a/src/it/MCOMPILER-500-package-info-incr/verify.groovy +++ b/src/it/MCOMPILER-500-package-info-incr/verify.groovy @@ -20,7 +20,7 @@ def logFile = new File( basedir, 'build.log' ) assert logFile.exists() content = logFile.text -assert 1 == content.count( 'Changes detected - recompiling the module!' ) -assert 1 == content.count( 'Nothing to compile - all classes are up to date' ) +assert 1 == content.count( "Recompiling the module because of ") +assert 1 == content.count( 'Nothing to compile - all classes are up to date.' ) diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index 0537bc65d..89754ee55 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -878,20 +878,22 @@ public void execute() throws MojoExecutionException, CompilationFailureException DirectoryScanResult dsr = computeInputFileTreeChanges(incrementalBuildHelper, sources); - boolean idk = compiler.getCompilerOutputStyle() + boolean immutableOutputFile = compiler.getCompilerOutputStyle() .equals(CompilerOutputStyle.ONE_OUTPUT_FILE_FOR_ALL_INPUT_FILES) && !canUpdateTarget; boolean dependencyChanged = isDependencyChanged(); boolean sourceChanged = isSourceChanged(compilerConfiguration, compiler); boolean inputFileTreeChanged = hasInputFileTreeChanged(dsr); // CHECKSTYLE_OFF: LineLength - if (idk || dependencyChanged || sourceChanged || inputFileTreeChanged) + if (immutableOutputFile || dependencyChanged || sourceChanged || inputFileTreeChanged) // CHECKSTYLE_ON: LineLength { - String cause = idk - ? "idk" - : (dependencyChanged ? "dependency" : (sourceChanged ? "source" : "input tree")); - getLog().info("Changes detected - recompiling the module! :" + cause); + String cause = immutableOutputFile + ? "immutable single output file" + : (dependencyChanged + ? "changed dependency" + : (sourceChanged ? "changed source code" : "added or removed source files")); + getLog().info("Recompiling the module because of " + cause + "."); if (showCompilationChanges) { for (String fileAdded : dsr.getFilesAdded()) { getLog().info("\t+ " + fileAdded); @@ -903,7 +905,7 @@ public void execute() throws MojoExecutionException, CompilationFailureException compilerConfiguration.setSourceFiles(sources); } else { - getLog().info("Nothing to compile - all classes are up to date"); + getLog().info("Nothing to compile - all classes are up to date."); return; }