Author: tchemit Date: 2013-08-08 14:30:53 +0200 (Thu, 08 Aug 2013) New Revision: 906 Url: http://nuiton.org/projects/maven-helper-plugin/repository/revisions/906 Log: improve log messages Modified: trunk/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java Modified: trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java =================================================================== --- trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java 2013-08-08 12:30:53 UTC (rev 906) @@ -275,7 +275,7 @@ if (isGoalSkip()) { // goal mark to be skipped - getLog().info("skipGoal flag is on, will skip the goal."); + getLog().info("Skipping goal (skipCheckAutocontainer flag is on)."); return false; } @@ -293,17 +293,17 @@ boolean shouldInvoke = needInvoke(runOnce, runOnlyOnRoot, key); if (!shouldInvoke) { - + getLog().info("Skipping goal (runOnce flag is on and goal was already executed)."); return false; } if (artifacts.isEmpty()) { - getLog().info("Project has no dependecy."); + getLog().info("Skipping goal (Project has no dependecy)."); return false; } if (repositories.isEmpty()) { - getLog().info("No repository defined."); + getLog().info("Skipping goal (No repository defined)."); return false; } return super.checkSkip(); Modified: trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java =================================================================== --- trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java 2013-08-08 12:30:53 UTC (rev 906) @@ -228,13 +228,13 @@ @Override protected boolean checkSkip() { if (skip) { - getLog().info("Skip flag is on, goal will not be executed."); + getLog().info("Skipping goal (skip flag is on)."); return false; } if (files.isEmpty()) { - getLog().warn("No file to collect, goal will not be executed."); + getLog().warn("Skipping goal (No file to collect)."); return false; } Modified: trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java =================================================================== --- trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java 2013-08-08 12:30:53 UTC (rev 906) @@ -301,7 +301,7 @@ protected boolean checkSkip() { if (isGoalSkip()) { // goal mark to be skipped - getLog().info("skipGoal flag is on, will skip the goal."); + getLog().info("Skipping goal (skipSendEmail flag is on)."); return false; } @@ -319,6 +319,9 @@ String key = buffer.toString(); boolean shouldInvoke = needInvoke(runOnce, runOnlyOnRoot, key); + if (!shouldInvoke) { + getLog().info("Skipping goal (runOnce flag is on and goal was already executed)."); + } return shouldInvoke && super.checkSkip(); } Modified: trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java =================================================================== --- trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java 2013-08-08 12:30:53 UTC (rev 906) @@ -265,7 +265,7 @@ public boolean checkSkip() { if (isGoalSkip()) { - getLog().info("Skip flag is on, goal will not be executed."); + getLog().info("Skipping goal (skipShareServerSecret flag is on)."); return false; } @@ -281,7 +281,9 @@ String key = buffer.toString(); boolean shouldInvoke = needInvoke(runOnce, runOnlyOnRoot, key); - + if (!shouldInvoke) { + getLog().info("Skipping goal (runOnce flag is on and goal was already executed)."); + } return shouldInvoke && super.checkSkip(); } @@ -316,7 +318,7 @@ } else { - getLog().info("export server [" + serverId + "] " + key.name() + + getLog().info("Exporting server [" + serverId + "] " + key.name() + " in ${" + propertyTargetName + "}"); properties.setProperty(propertyTargetName, propertyValue); Modified: trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java =================================================================== --- trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java 2013-08-08 12:30:53 UTC (rev 906) @@ -125,24 +125,9 @@ // check if plugin was already done. - if (isVerbose()) { - getLog().info("check if already done for key : " + key); - } - Object value = project.getProperties().get(key); - if (value != null) { + boolean shouldInvoke = needInvoke(runOnce, false, key); - // ok was already done - getLog().info("Goal was already executed, will skip goal."); - result = false; - } else { - - long timestamp = System.nanoTime(); - project.getProperties().put(key, timestamp + ""); - if (isVerbose()) { - getLog().info("Adding cache key " + key + - " with timestamp " + timestamp); - } - } + return shouldInvoke && super.checkSkip(); } return result; } Modified: trunk/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java =================================================================== --- trunk/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java 2013-08-08 11:18:48 UTC (rev 905) +++ trunk/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java 2013-08-08 12:30:53 UTC (rev 906) @@ -372,7 +372,9 @@ Object value = getProject().getProperties().get(key); if (value != null) { // ok was already done - getLog().info("Goal was already executed (but asked to be run only once), will skip goal."); + if (isVerbose()) { + getLog().info("Goal was already executed (but asked to be run only once), will skip goal."); + } return false; } long timestamp = System.nanoTime();