r1644 - trunk/src/main/java/org/nuiton/license/header/plugin
Author: tchemit Date: 2009-09-21 12:27:21 +0200 (Mon, 21 Sep 2009) New Revision: 1644 Modified: trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java Log: remove commented code Modified: trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-09-21 10:17:05 UTC (rev 1643) +++ trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-09-21 10:27:21 UTC (rev 1644) @@ -272,8 +272,6 @@ // verifie que la template existe (dans le class-path ou en tant que fichier) checkResource(templateFile); - // URL templateURL = getTemplate(templateFile); - // recuperation de la license a utiliser LicenseFactory factory = LicenseFactory.newInstance(licenseResolver); License license = factory.revolv(licenseName); @@ -374,22 +372,21 @@ inceptionYear = inceptionYear + " - " + thisYear; } -// // preparation de l'environnement velocity -// Properties env = new Properties(); -// env.put("inceptionYear", inceptionYear); -// env.put("projectName", projectName); -// env.put("organizationName", organizationName); -// env.put("licenseContent", licenseContent); -// -// if (templateParameters != null) { -// for (Entry<String, String> e : templateParameters.entrySet()) { -// env.put(e.getKey(), e.getValue()); -// } -// } + // preparation de l'environnement velocity + Context context = new VelocityContext(); - Context context = createVelocityContext(licenseContent); + context.put("inceptionYear", inceptionYear); + context.put("projectName", projectName); + context.put("organizationName", organizationName); + context.put("licenseContent", licenseContent); + if (templateParameters != null) { + for (Entry<String, String> e : templateParameters.entrySet()) { + context.put(e.getKey(), e.getValue()); + } + } + if (verbose) { StringBuilder buffer = new StringBuilder(); @@ -421,23 +418,4 @@ return '\n' + result; } - - protected Context createVelocityContext(String licenseContent) throws MojoExecutionException { - - // prepare velocity context - Context context = new VelocityContext(); - - context.put("inceptionYear", inceptionYear); - context.put("projectName", projectName); - context.put("organizationName", organizationName); - context.put("licenseContent", licenseContent); - - if (templateParameters != null) { - for (Entry<String, String> e : templateParameters.entrySet()) { - context.put(e.getKey(), e.getValue()); - } - } - - return context; - } }
participants (1)
-
tchemit@users.nuiton.org