This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository maven-helper-plugin. See http://git.nuiton.org/maven-helper-plugin.git commit 20eb087a770db3410d4a7f7357f896b0363c3716 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon May 25 15:41:33 2015 +0200 make javadoc jdk8 compat (refs #3702) --- .../java/org/nuiton/io/MirroredFileUpdater.java | 2 +- .../io/PropertiesDateRemoveFilterStream.java | 3 +- .../main/java/org/nuiton/io/SortedProperties.java | 21 +++--- .../nuiton/plugin/AbstractAvailableDataMojo.java | 5 +- .../java/org/nuiton/plugin/AbstractPlugin.java | 49 +++++-------- .../java/org/nuiton/plugin/DependencyUtil.java | 19 ++--- .../src/main/java/org/nuiton/plugin/Plugin.java | 2 +- .../main/java/org/nuiton/plugin/PluginHelper.java | 28 +++----- .../java/org/nuiton/plugin/PluginIOContext.java | 4 +- .../java/org/nuiton/plugin/PluginWithEncoding.java | 3 +- .../nuiton/plugin/VelocityTemplateGenerator.java | 21 ++---- .../main/java/org/nuiton/plugin/MojoTestRule.java | 16 +++-- .../helper/io/mail/ProjectJavamailMailSender.java | 5 +- .../helper/plugin/CheckAutoContainerPlugin.java | 7 +- .../org/nuiton/helper/plugin/CollectFilesMojo.java | 80 ++++++---------------- .../helper/plugin/ExecuteRemoteCommandMojo.java | 35 ++++++---- .../org/nuiton/helper/plugin/SendEmailMojo.java | 2 +- .../helper/plugin/ShareServerSecretPlugin.java | 53 +++++++------- .../helper/plugin/TransformProjectVersionMojo.java | 8 +-- 19 files changed, 144 insertions(+), 219 deletions(-) diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/io/MirroredFileUpdater.java b/helper-maven-plugin-api/src/main/java/org/nuiton/io/MirroredFileUpdater.java index be3dad7..e149f56 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/io/MirroredFileUpdater.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/io/MirroredFileUpdater.java @@ -35,7 +35,7 @@ import java.io.File; */ public class MirroredFileUpdater implements FileUpdater { - /** to use log facility, just put in your code: log.info(\"...\"); */ + /** Logger. */ static private final Log log = LogFactory.getLog(MirroredFileUpdater.class); /** source basedir */ diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/io/PropertiesDateRemoveFilterStream.java b/helper-maven-plugin-api/src/main/java/org/nuiton/io/PropertiesDateRemoveFilterStream.java index aebacf6..9c3f164 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/io/PropertiesDateRemoveFilterStream.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/io/PropertiesDateRemoveFilterStream.java @@ -29,9 +29,8 @@ import java.io.OutputStream; /** * Un ecrivain qui supprime la premiere ligne rencontree dans le flux. * - * * <b>Note: </b> Attention, les performance d'utilisation de cet ecrivain - * est problèmatique, car sur de gros fichiers (>1000 entrees) les + * est problèmatique, car sur de gros fichiers (>1000 entrees) les * performances se degradent serieusement : pour 1200 entrees on arrive à * plus de 5 secondes, alors que sans on a 76 ms! ... * diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/io/SortedProperties.java b/helper-maven-plugin-api/src/main/java/org/nuiton/io/SortedProperties.java index 035f021..e5e4c87 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/io/SortedProperties.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/io/SortedProperties.java @@ -45,7 +45,7 @@ import java.util.Vector; * Extend {@link Properties} to allow alphabetical order. Encoding could also * be defined but you must use this class only with Java 1.6. * - * @author ruchaud <ruchaud@codelutin.com> + * @author ruchaud - ruchaud@codelutin.com * @author tchemit - chemit@codelutin.com */ public class SortedProperties extends Properties { @@ -76,7 +76,7 @@ public class SortedProperties extends Properties { /** * A flag to write unicode using the a lower letter. - * <p/> + * * Example : {@code \u00e9} instead of {@code \u00E9}. */ final protected boolean unicodeLower; @@ -146,11 +146,11 @@ public class SortedProperties extends Properties { * and {@link #ENCODING_ASCII}. A specific {@link Reader} will * be used to read the file. * - * @param src File where Properties will be loaded + * @param src File where Properties will be loaded * @param encoding Encoding to use + * @return this instance * @throws IOException for any file errors * @since 1.3 - * @return this instance */ public SortedProperties load(File src, String encoding) throws IOException { Reader reader = new InputStreamReader(new FileInputStream(src), encoding); @@ -181,7 +181,7 @@ public class SortedProperties extends Properties { * be used to save the file. Otherwise the default Properties behavior * will escape unicode chars with <code>\u</code><i>xxxx</i>. * - * @param dst File to save Properties + * @param dst File to save Properties * @param encoding Encoding to use * @throws IOException for any file errors * @since 1.3 @@ -198,18 +198,18 @@ public class SortedProperties extends Properties { /** * If encoding is not the default Properties one, we will use a writer * to use this custom encoding. - * <p/> + * * We must call the right method depends on encoding, for a custom one * the {@link #store(Writer, String)} method is used otherwise the * default encoding 8859_1 must be used as superclass define it in * {@link #store(OutputStream, String)}. - * <p/> + * * Encoding {@link #ENCODING_DEFAULT}, * {@link #ENCODING_LATIN1} and {@link #ENCODING_ASCII} * are considered as default Properties one, so the old method will be use * escaping unicode chars like <code>\u</code><i>xxxx</i>. * - * @param stream OutputStream to save in + * @param stream OutputStream to save in * @param encoding Encoding to use * @throws IOException For any file errors */ @@ -296,7 +296,7 @@ public class SortedProperties extends Properties { } synchronized (this) { - for (Enumeration e = keys(); e.hasMoreElements();) { + for (Enumeration e = keys(); e.hasMoreElements(); ) { String key = (String) e.nextElement(); String val = (String) get(key); key = saveConvert(key, true, escUnicode); @@ -424,9 +424,10 @@ public class SortedProperties extends Properties { } /** - * Convert a nibble to a hex character + * Convert a nibble to a hex character. * * @param nibble the nibble to convert. + * @return the converted nibble */ protected char toHex(int nibble) { return hexDigit[(nibble & 0xF)]; diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractAvailableDataMojo.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractAvailableDataMojo.java index 9fb92c6..050e1ff 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractAvailableDataMojo.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractAvailableDataMojo.java @@ -31,11 +31,10 @@ import java.util.Map; /** * Abstract mojo used to display {@link AvailableData} in a simple way. - * <p/> + * * Created: 10/05/11 * - * @author fdesbois <desbois@codelutin.com> - * $Id$ + * @author fdesbois - desbois@codelutin.com * @since 1.3 */ public abstract class AbstractAvailableDataMojo extends AbstractMojo { diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java index 7ed5a9c..d4af6a7 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/AbstractPlugin.java @@ -154,8 +154,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { * and * {@link #rejectPackaging(Plugin.Packaging...)} * - * @return {@code true} if can execute the goal for the packaging of the - * project, {@code false} otherwise. + * @return {@code true} if can execute the goal for the packaging of the project, {@code false} otherwise. */ protected boolean checkPackaging() { // by default, accept every type of packaging @@ -216,8 +215,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Check if an execution was already done according to the given - * parameters based on a timestamp. + * Check if an execution was already done according to the given parameters based on a timestamp. * * @param runOnce the flag * @param onlyForRoot a flag to @@ -271,14 +269,13 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Check if an execution should be done or not according to the - * given parameters. + * Check if an execution should be done or not according to the given parameters. * * @param runOnce the flag * @param onlyForRoot a flag to * @param buildStartTime the build statrt time (if none means must do it) - * @param newStartTime the current build start time - * {@code true} if the goal should be invoked, {@code false} otherwise. + * @param newStartTime the current build start time {@code true} if the goal should be invoked, {@code false} otherwise. + * @return {@code true} if should be invoked, {@code false} otherwise. * @since 2.1 */ protected boolean needInvoke(boolean runOnce, @@ -369,8 +366,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Recupere le fichier donnée à partir de son chemin relatif sur le basedir - * du projet maven. + * Recupere le fichier donnée à partir de son chemin relatif sur le basedir du projet maven. * * @param paths les paths pour atteindre le fichier ou le répertoire * @return le fichier de la destination @@ -398,8 +394,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Write a {@code content} into the given destination file for the given - * {@code encoding}. + * Write a {@code content} into the given destination file for the given {@code encoding}. * * @param destFile location where to write the content * @param content content ot write in the file @@ -414,8 +409,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { * Test if a file exists and is newer than the pom file. * * @param f the file to test - * @return {@code true} if file exists and is newer than the pom file, - * {@code false} otherwise. + * @return {@code true} if file exists and is newer than the pom file, {@code false} otherwise. */ protected boolean isFileNewerThanPomFile(File f) { File pomFile = getProject().getFile(); @@ -429,8 +423,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { * @param excludes excludes * @param roots root directories to treate * @param files cache of file detected indexed by their root directory - * @param updater the updater used to detect changes (if none, will get all - * the files) + * @param updater the updater used to detect changes (if none, will get all the files) */ protected void getFilesToTreateForRoots( String[] includes, @@ -566,8 +559,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Add a given directory in maven project's compile source roots (if not - * already present). + * Add a given directory in maven project's compile source roots (if not already present). * * @param srcDir the location to include in compile source roots */ @@ -581,8 +573,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Remove a given directory in maven project's compile source roots (if - * present). + * Remove a given directory in maven project's compile source roots (if present). * * @param srcDir the location to remove from compile source roots */ @@ -596,8 +587,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Add a given directory in maven project's test compile source roots - * (if not already present). + * Add a given directory in maven project's test compile source roots (if not already present). * * @param srcDir the location to include in test compile source roots */ @@ -613,8 +603,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Remove a given directory in maven project's test compile source roots - * (if present). + * Remove a given directory in maven project's test compile source roots (if present). * * @param srcDir the location to remove from test compile source roots */ @@ -628,8 +617,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Add a new resource location to the maven project - * (in not already present). + * Add a new resource location to the maven project (in not already present). * * @param dir the new resource location to add * @param includes files to include @@ -643,8 +631,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Add a new test resource location to the maven project - * (in not already present). + * Add a new test resource location to the maven project (in not already present). * * @param dir the new resource location to add * @param includes files to include @@ -715,8 +702,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Backups the given file using the {@link #getBackupFile(File)} as - * destination file. + * Backups the given file using the {@link #getBackupFile(File)} as destination file. * * @param f the file to backup * @throws IOException if any pb while copying the file @@ -879,8 +865,7 @@ public abstract class AbstractPlugin extends AbstractMojo implements Plugin { } /** - * Check that the given resource exists in a simple fs file or in the - * classPath. + * Check that the given resource exists in a simple fs file or in the classPath. * * @param f the required resource file. * @throws IOException for any error while looking up for the resources content. diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/DependencyUtil.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/DependencyUtil.java index 7f5c087..b221647 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/DependencyUtil.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/DependencyUtil.java @@ -37,12 +37,10 @@ import java.util.*; */ public class DependencyUtil { - /** to use log facility, just put in your code: log.info(\"...\"); */ + /** Logger. */ private static final Log log = LogFactory.getLog(DependencyUtil.class); - public static void sortArtifacts(DependencyNode rootNode, - List<Artifact> artifacts, - boolean verbose) { + public static void sortArtifacts(DependencyNode rootNode, List<Artifact> artifacts, boolean verbose) { if (artifacts.size() < 2) { return; @@ -68,11 +66,7 @@ public class DependencyUtil { // premiere passe pour recuperer l'ensemble des dependances for (ArtifactDependencyEntry entry : dico.values()) { - List<String> dependencies = getDependencies(rootNode, - entry, - universe, - verbose - ); + List<String> dependencies = getDependencies(rootNode, entry, universe, verbose); entry.depIds = dependencies; } @@ -99,8 +93,7 @@ public class DependencyUtil { if (levelFixed.isEmpty()) { // aucune modification, c'est un cycle! - throw new IllegalStateException( - "cycle detecte ! entre les artifacts " + universe); + throw new IllegalStateException("cycle detecte ! entre les artifacts " + universe); } // on met a jour les listes @@ -244,9 +237,7 @@ public class DependencyUtil { } } - protected static DependencyNode getNode(DependencyNode rootNode, - String requiredKey, - boolean verbose) { + protected static DependencyNode getNode(DependencyNode rootNode, String requiredKey, boolean verbose) { for (Iterator<?> itr = rootNode.preorderIterator(); itr.hasNext();) { DependencyNode d = (DependencyNode) itr.next(); diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/Plugin.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/Plugin.java index 7ab813d..99c91cd 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/Plugin.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/Plugin.java @@ -27,7 +27,7 @@ import org.apache.maven.project.MavenProject; /** * A common contract to be implements by our mojo and reports. - * <p/> + * * Just expose a {@link #isVerbose()} flag and the maven project {@link #getProject()}. * * @author tchemit - chemit@codelutin.com diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginHelper.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginHelper.java index 3e29aad..a638e48 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginHelper.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginHelper.java @@ -76,11 +76,11 @@ public class PluginHelper { /** * Permet de convertir une liste non typee, en une liste typee. - * <p/> + * * La liste en entree en juste bien castee. - * <p/> + * * On effectue une verification sur le typage des elements de la liste. - * <p/> + * * Note : <b>Aucune liste n'est creee, ni recopiee</b> * * @param <O> le type des objets de la liste @@ -202,8 +202,7 @@ public class PluginHelper { } /** - * Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un - * dictionnaire donne. + * Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un dictionnaire donne. * * @param map le dictionner a parcourir * @return la liste des clefs dont la valeur est nulle ou vide @@ -299,8 +298,7 @@ public class PluginHelper { * Cretae the directory (and his parents) if necessary. * * @param dir the directory to create if not exisiting - * @return {@code true} if directory was created, {@code false} if was no - * need to create it + * @return {@code true} if directory was created, {@code false} if was no need to create it * @throws IOException if could not create directory * @since 1.1.1 */ @@ -389,8 +387,7 @@ public class PluginHelper { } /** - * Permet de lire un fichier et de retourner sont contenu sous forme d'une - * chaine de carateres + * Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres * * @param file le fichier a lire * @param encoding encoding to read file @@ -410,8 +407,7 @@ public class PluginHelper { } /** - * Permet de lire un fichier et de retourner sont contenu sous forme d'une - * chaine de carateres + * Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres * * @param reader la source alire * @return the content of the file @@ -656,12 +652,10 @@ public class PluginHelper { /** * Method to be invoked in init phase to check sanity of {@link PluginWithEncoding#getEncoding()}. - * <p/> - * If no encoding was filled, then use the default for system - * (via {@code file.encoding} environement property). - * <p/> - * <b>Note:</b> If mojo is not implementing {@link PluginWithEncoding}, - * nothing is done. + * + * If no encoding was filled, then use the default for system (via {@code file.encoding} environement property). + * + * <b>Note:</b> If mojo is not implementing {@link PluginWithEncoding}, nothing is done. * * @param mojo the mojo to check. * @since 1.2.6 diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginIOContext.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginIOContext.java index b11d108..f5d9213 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginIOContext.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginIOContext.java @@ -26,9 +26,9 @@ import java.io.File; /** * Une classe pour définir les entrées-sortie d'un plugin. - * <p/> + * * En entrée, on peut avoir un ou plusieurs répertoires ({@link #inputs}. - * <p/> + * * En sortie, on ne peut avoir qu'un seul répertoire ({@link #output}. * * @author tchemit - chemit@codelutin.com diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginWithEncoding.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginWithEncoding.java index cf529b7..c057558 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginWithEncoding.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/PluginWithEncoding.java @@ -24,7 +24,7 @@ package org.nuiton.plugin; /** * A common contract to be implements by our mojo and reports which needs encoding. - * <p/> + * * Just expose a getter-setter {@link #getEncoding()} and {@link #setEncoding(String)}. * * @author tchemit - chemit@codelutin.com @@ -32,7 +32,6 @@ package org.nuiton.plugin; */ public interface PluginWithEncoding extends Plugin { - /** * Gets the encoding to be used to read and write io resources. * diff --git a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java index aaa5f8f..1486f08 100644 --- a/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java +++ b/helper-maven-plugin-api/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java @@ -37,7 +37,7 @@ import java.util.Properties; /** * Generator of template base on velocity. - * <p/> + * * TODO TC-20091011 should use plexus velocity component * * @author tchemit - chemit@codelutin.com @@ -51,8 +51,7 @@ public class VelocityTemplateGenerator { protected Template velocityTemplate; - public VelocityTemplateGenerator(MavenProject mavenProject, - URL template) throws URISyntaxException { + public VelocityTemplateGenerator(MavenProject mavenProject, URL template) throws URISyntaxException { if (mavenProject == null) { throw new IllegalArgumentException("mavenProject must not be null"); @@ -90,8 +89,7 @@ public class VelocityTemplateGenerator { int i = url.indexOf("!"); templateName = url.substring(i + 2); - props.setProperty("jar.resource.loader.path", - url.substring(0, i + 2)); + props.setProperty("jar.resource.loader.path", url.substring(0, i + 2)); } else { @@ -105,8 +103,7 @@ public class VelocityTemplateGenerator { engine = new VelocityEngine(); engine.init(props); } catch (Exception e) { - IllegalArgumentException iae = new IllegalArgumentException( - "Could not initialise Velocity"); + IllegalArgumentException iae = new IllegalArgumentException("Could not initialise Velocity"); iae.initCause(e); throw iae; } @@ -115,9 +112,7 @@ public class VelocityTemplateGenerator { velocityTemplate = engine.getTemplate(templateName); } catch (Exception e) { IllegalArgumentException iae = - new IllegalArgumentException( - "Could not load the template file from '" + - template + "'"); + new IllegalArgumentException("Could not load the template file from '" + template + "'"); iae.initCause(e); throw iae; } @@ -171,15 +166,13 @@ public class VelocityTemplateGenerator { writer.flush(); } catch (Exception e) { throw new Exception( - "Could not generate the template " + - velocityTemplate.getName() + ": " + e.getMessage(), e); + "Could not generate the template " + velocityTemplate.getName() + ": " + e.getMessage(), e); } finally { writer.close(); } } - protected void addPropertiesToContext(Properties properties, - VelocityContext context) { + protected void addPropertiesToContext(Properties properties, VelocityContext context) { for (Object o : properties.keySet()) { String key = (String) o; diff --git a/helper-maven-plugin-test-api/src/main/java/org/nuiton/plugin/MojoTestRule.java b/helper-maven-plugin-test-api/src/main/java/org/nuiton/plugin/MojoTestRule.java index a43763a..f232039 100644 --- a/helper-maven-plugin-test-api/src/main/java/org/nuiton/plugin/MojoTestRule.java +++ b/helper-maven-plugin-test-api/src/main/java/org/nuiton/plugin/MojoTestRule.java @@ -18,13 +18,15 @@ import java.beans.Introspector; import java.io.File; /** - * To offer inside each test method (annotated by a {@link Test}) the - * following properties : - * <p/> - * <ul> <li>{@link #testDirectory} : location where to find resources for the - * test</li> <li>{@link #pomFile} : location of the pom file to use to build - * the mojo</li> <li>{@link #mojo} : the instanciated and initialized - * mojo</li> </ul> + * TODO Review this documentation. + * + * To offer inside each test method (annotated by a {@link Test}) the following properties : + * + * <ul> + * <li>{@link #testDirectory} : location where to find resources for the test</li> + * <li>{@link #pomFile} : location of the pom file to use to build the mojo</li> + * <li>{@link #mojo} : the instanciated and initialized mojo</li> + * </ul> */ public class MojoTestRule<P extends AbstractPlugin> extends MojoRule { diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/io/mail/ProjectJavamailMailSender.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/io/mail/ProjectJavamailMailSender.java index 00a289d..23a0962 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/io/mail/ProjectJavamailMailSender.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/io/mail/ProjectJavamailMailSender.java @@ -44,9 +44,8 @@ import java.util.Properties; /** * Helper class for sending email. - * <p/> - * Note : this code was stolen in {@code maven-changes-plugin}, should thanks - * them... + * + * Note : this code was stolen in {@code maven-changes-plugin}, should thanks them... * * @author tchemit - chemit@codelutin.com * @since 1.0.3 diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java index 7c3fb76..49b8896 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CheckAutoContainerPlugin.java @@ -67,7 +67,7 @@ public class CheckAutoContainerPlugin extends AbstractPlugin { /** * Map of repositories to use. - * <p/> + * * Keys are repository id and Values are repository url. * * @since 1.2.5 @@ -102,9 +102,8 @@ public class CheckAutoContainerPlugin extends AbstractPlugin { /** * A flag to execute only once the mojo. - * <p/> - * <b>Note:</b> By default, value is {@code true} since it is not necessary - * to check twice for a same artifact. + * + * <b>Note:</b> By default, value is {@code true} since it is not necessary to check twice for a same artifact. * * @since 1.2.6 */ diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java index 8d65dcd..35442fb 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java @@ -101,7 +101,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * User extra files to collect. - * <p/> + * * Multi values can be used, separated by comma. * * @since 1.0.0 @@ -111,7 +111,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * File name pattern of selected files to publish. - * <p/> + * * If no Set - no include filter * * @since 1.0.0 @@ -121,7 +121,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * File name pattern of selected files to publish. - * <p/> + * * If no Set - no exclude filter * * @since 1.0.0 @@ -131,7 +131,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * Directory where to store collected files. - * <p/> + * * <b>Note :</b> In a multi-module context, will always use the value of * the property of the root module, because we need to push collected files * to only one place. @@ -143,7 +143,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * File with all files collected (one file by line in absolute path). - * <p/> + * * <b>Note :</b> If not Set, will not generate the description file. * * @since 1.0.0 @@ -230,7 +230,6 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi } if (files.isEmpty()) { - getLog().warn("Skipping goal (No file to collect)."); return false; } @@ -258,8 +257,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi File base = new File(rootProject.getBasedir(), outputDirectory); - File output = new File(base, project.getGroupId() + "--" + - project.getArtifactId()); + File output = new File(base, project.getGroupId() + "--" + project.getArtifactId()); if (verbose) { getLog().info("Ouput dir : " + output); @@ -306,8 +304,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi } if (!withDescriptionFile && !copyFiles) { - throw new MojoExecutionException( - "must use at least one of the parameters 'copyFiles' or 'descriptionFile'"); + throw new MojoExecutionException("must use at least one of the parameters 'copyFiles' or 'descriptionFile'"); } String basedir = rootProject.getBasedir().getAbsolutePath(); @@ -362,7 +359,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi /** * Save the list of files in the given output file. - * <p/> + * * Each line is the absolute path of each files of the list * * @param output the file when to write @@ -379,10 +376,8 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi protected List<File> getFiles() { - Pattern includePattern = StringUtils.isBlank(includes) ? null : - Pattern.compile(includes.trim()); - Pattern excludePattern = StringUtils.isBlank(excludes) ? null : - Pattern.compile(excludes.trim()); + Pattern includePattern = StringUtils.isBlank(includes) ? null : Pattern.compile(includes.trim()); + Pattern excludePattern = StringUtils.isBlank(excludes) ? null : Pattern.compile(excludes.trim()); List<File> result = new ArrayList<>(); @@ -391,20 +386,10 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi if (includeAttached) { if ("pom".equals(project.getPackaging())) { - addFile(project.getFile(), - "adding artifact file : ", - result, - includePattern, - excludePattern - ); + addFile(project.getFile(), "adding artifact file : ", result, includePattern, excludePattern); } else { - addFile(artifact.getFile(), - "adding artifact file : ", - result, - includePattern, - excludePattern - ); + addFile(artifact.getFile(), "adding artifact file : ", result, includePattern, excludePattern); } } File file; @@ -422,12 +407,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi file = new File(basedir, path.trim()); } - addFile(file, - "adding user file : ", - result, - includePattern, - excludePattern - ); + addFile(file, "adding user file : ", result, includePattern, excludePattern); } } @@ -442,12 +422,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi for (Object o : attachedArtifacts) { file = ((Artifact) o).getFile(); - addFile(file, - "adding attached artifact file : ", - result, - includePattern, - excludePattern - ); + addFile(file, "adding attached artifact file : ", result, includePattern, excludePattern); } } @@ -461,20 +436,10 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi //This is a big hack and we should sheck this name does not // changes when bumping maven version (anyway, it is not risky // since this class should never change ?) - if ("SiteDescriptorArtifactMetadata".equals( - o.getClass().getSimpleName())) { - String path = - localRepository.pathOfLocalRepositoryMetadata( - o, deploymentRepository); - File destination = new File( - localRepository.getBasedir(), - path); - addFile(destination, - "adding site descriptor file : ", - result, - includePattern, - excludePattern - ); + if ("SiteDescriptorArtifactMetadata".equals(o.getClass().getSimpleName())) { + String path = localRepository.pathOfLocalRepositoryMetadata(o, deploymentRepository); + File destination = new File(localRepository.getBasedir(), path); + addFile(destination, "adding site descriptor file : ", result, includePattern, excludePattern); } } } @@ -482,11 +447,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi return result; } - protected void addFile(File f, - String msg, - List<File> files, - Pattern includePattern, - Pattern excludePattern) { + protected void addFile(File f, String msg, List<File> files, Pattern includePattern, Pattern excludePattern) { if (f == null) { return; } @@ -507,8 +468,7 @@ public class CollectFilesMojo extends AbstractPlugin implements PluginWithEncodi if (!includePattern.matcher(f.getName()).matches()) { // skip this file if (verbose) { - getLog().info( - "skip " + f + " : not in includes " + includes); + getLog().info("skip " + f + " : not in includes " + includes); } return; } diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ExecuteRemoteCommandMojo.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ExecuteRemoteCommandMojo.java index 8c7e265..091c282 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ExecuteRemoteCommandMojo.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ExecuteRemoteCommandMojo.java @@ -50,20 +50,26 @@ import org.nuiton.plugin.AbstractPlugin; * @since 1.3.1 */ @Mojo(name = "execute-remote-command", - defaultPhase = LifecyclePhase.VALIDATE, - requiresOnline = true, - requiresProject = true) + defaultPhase = LifecyclePhase.VALIDATE, + requiresOnline = true, + requiresProject = true) public class ExecuteRemoteCommandMojo extends AbstractPlugin { - /** A flag to activate verbose mode. */ + /** + * A flag to activate verbose mode. + */ @Parameter(property = "helper.verbose", defaultValue = "${maven.verbose}") protected boolean verbose; - /** Project. */ - @Parameter( defaultValue = "${project}", required = true, readonly = true ) + /** + * Project. + */ + @Parameter(defaultValue = "${project}", required = true, readonly = true) protected MavenProject project; - /** Active proxy from settings (if any). */ + /** + * Active proxy from settings (if any). + */ @Parameter(defaultValue = "${settings.activeProxy}", required = true, readonly = true) protected Proxy proxy; @@ -72,12 +78,12 @@ public class ExecuteRemoteCommandMojo extends AbstractPlugin { * * @since 1.1.0 */ - @Parameter( defaultValue = "${settings}", required = true, readonly = true ) + @Parameter(defaultValue = "${settings}", required = true, readonly = true) protected Settings settings; /** * Id of the server to use to obtain user login. - * <p/> + * * Must be found in your settings.xml. */ @Parameter(property = "helper.repositoryId", required = true) @@ -91,11 +97,15 @@ public class ExecuteRemoteCommandMojo extends AbstractPlugin { @Parameter(property = "helper.repositoryUrl", required = true) protected String repositoryUrl; - /** Command to execute on remote server. */ + /** + * Command to execute on remote server. + */ @Parameter(property = "helper.command", required = true) protected String command; - /** Wagon manager component. */ + /** + * Wagon manager component. + */ @Component protected WagonManager wagonManager; @@ -185,8 +195,7 @@ public class ExecuteRemoteCommandMojo extends AbstractPlugin { } // FIXME when upgrading to maven 3.x : this must be changed. - AuthenticationInfo auth = - wagonManager.getAuthenticationInfo(repository.getId()); + AuthenticationInfo auth = wagonManager.getAuthenticationInfo(repository.getId()); ProxyInfo proxyInfo = getProxyInfo(); if (proxyInfo != null) { diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java index 40a51cc..5c547e6 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java @@ -124,7 +124,7 @@ public class SendEmailMojo extends AbstractPlugin implements PluginWithEncoding /** * The id of the developer sending the announcement mail. Only used if - * the <tt>mailSender</tt> attribute is not set. In this case, this should + * the <i>mailSender</i> attribute is not set. In this case, this should * match the id of one of the developers in the pom. If a matching * developer is not found, then the first developer in the pom will be * used. diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java index b2ef259..9c28a85 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java @@ -41,7 +41,7 @@ import java.util.Properties; /** * Obtain a server authentication and share it in the maven * project properties. - * <p/> + * * To select data to export from the server with the given {@code serverId}, * fill the properties : * <pre> @@ -55,8 +55,8 @@ import java.util.Properties; * @since 1.1.0 */ @Mojo(name = "share-server-secret", - defaultPhase = LifecyclePhase.INITIALIZE, - requiresProject = true) + defaultPhase = LifecyclePhase.INITIALIZE, + requiresProject = true) public class ShareServerSecretPlugin extends AbstractPlugin { /** @@ -64,7 +64,7 @@ public class ShareServerSecretPlugin extends AbstractPlugin { * * @since 1.1.0 */ - @Parameter( defaultValue = "${project}", required = true, readonly = true ) + @Parameter(defaultValue = "${project}", required = true, readonly = true) protected MavenProject project; /** @@ -72,13 +72,12 @@ public class ShareServerSecretPlugin extends AbstractPlugin { * * @since 1.1.0 */ - @Parameter( defaultValue = "${settings}", required = true, readonly = true ) + @Parameter(defaultValue = "${settings}", required = true, readonly = true) protected Settings settings; /** * Server id to use for authentication (must be defined in your setting - * and use the maven >= 2.1.0 password encryption mecanism). - * <p/> + * and use the maven >= 2.1.0 password encryption mecanism). * * @since 1.1.0 */ @@ -87,7 +86,7 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** * The name of the property where to export the username of the server. - * <p/> + * * <b>Note:</b> If not set - then no export of the username of the server. * * @since 1.1.0 @@ -97,11 +96,10 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** * The name of the property where to export the password of the server. - * <p/> + * * <b>Note:</b> If not set - then no export of the password of the server. - * <p/> - * <b>Note:</b> If the password is crypted (since maven 2.1.0) then - * decrypt it. + * + * <b>Note:</b> If the password is crypted (since maven 2.1.0) then decrypt it. * * @since 1.1.0 */ @@ -110,11 +108,10 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** * The name of the property where to export the passphrase of the server. - * <p/> + * * <b>Note:</b> If not set - then no export of the passphrase of the server. - * <p/> - * <b>Note:</b> If the passphrase is crypted (since maven 2.1.0) then - * decrypt it. + * + * <b>Note:</b> If the passphrase is crypted (since maven 2.1.0) then decrypt it. * * @since 1.1.0 */ @@ -123,7 +120,7 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** * The name of the property where to export the private key of the server. - * <p/> + * * <b>Note:</b> If not set - then no export of the private key of the server. * * @since 1.1.0 @@ -141,9 +138,8 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** * A flag to execute only once the mojo. - * <p/> - * <b>Note:</b> By default, value is {@code true} since it is not necessary - * to inject twice secrets in session. + * + * <b>Note:</b> By default, value is {@code true} since it is not necessary to inject twice secrets in session. * * @since 1.1.0 */ @@ -183,10 +179,14 @@ public class ShareServerSecretPlugin extends AbstractPlugin { @Component(hint = "maven-helper-plugin") protected SecDispatcher sec; - /** the server to use to obtain secrets */ + /** + * The server to use to obtain secrets. + */ private Server server; - /** server secrets to expose */ + /** + * Server secrets to expose. + */ private Map<Property, String> propertiesToTreate; public enum Property { @@ -254,8 +254,7 @@ public class ShareServerSecretPlugin extends AbstractPlugin { if (server == null) { throw new MojoExecutionException( - "Could not find server with id '" + serverId + - "', check your settings.xml file."); + "Could not find server with id '" + serverId + "', check your settings.xml file."); } } @@ -310,14 +309,12 @@ public class ShareServerSecretPlugin extends AbstractPlugin { } else { throw new MojoExecutionException( "Null values found for server [" + - serverId + "] " + key.name() + - ", use skipNullValue to authrize it."); + serverId + "] " + key.name() + ", use skipNullValue to authrize it."); } } else { - getLog().info("Exporting server [" + serverId + "] " + key.name() + - " in ${" + propertyTargetName + "}"); + getLog().info("Exporting server [" + serverId + "] " + key.name() + " in ${" + propertyTargetName + "}"); properties.setProperty(propertyTargetName, propertyValue); } diff --git a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java index 0d170d6..bd93448 100644 --- a/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java +++ b/helper-maven-plugin/src/main/java/org/nuiton/helper/plugin/TransformProjectVersionMojo.java @@ -64,18 +64,16 @@ public class TransformProjectVersionMojo extends AbstractPlugin { /** * Pattern of the new version. - * <p/> + * * Use {@code #V} for project version (without snapshot suffix) and * {@code #R} for the given scm revision and #S to add snapshot suffix - * <p/> + * * Example: - * <p/> * <pre> * #V-rev-#V -> 1.0-rev-1 (version=1.0 and revision=1) * #V-rev-#V#S -> 1.0-rev-1-SNAPSHOT (version=1.0 and revision=1) * #V-rev-#V#S -> 1.0-rev-1-SNAPSHOT (version=1.0-SNAPSHOT and revision=1) * </pre> - * <p/> * Note that the #S can only be putted at the end of the pattern * * @since 2.0 @@ -101,7 +99,7 @@ public class TransformProjectVersionMojo extends AbstractPlugin { /** * A flag to execute only once the mojo. - * <p/> + * * <b>Note:</b> By default, value is {@code true} since it is not necessary * to inject twice secrets in session. * -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.