Maven-license-plugin-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 268 discussions
r1651 - in trunk/src/test/resources/org/nuiton/license/header: . plugin/UpdateHeaderPluginTest
by tchemit@users.nuiton.org 27 Sep '09
by tchemit@users.nuiton.org 27 Sep '09
27 Sep '09
Author: tchemit
Date: 2009-09-27 21:05:50 +0200 (Sun, 27 Sep 2009)
New Revision: 1651
Removed:
trunk/src/test/resources/org/nuiton/license/header/UpdateHeaderPluginTest/
Modified:
trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/bug_28.xml
trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/java.xml
trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/properties.xml
trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/xml.xml
Log:
add model version in mojo test poms
Modified: trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/bug_28.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/bug_28.xml 2009-09-26 03:56:02 UTC (rev 1650)
+++ trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/bug_28.xml 2009-09-27 19:05:50 UTC (rev 1651)
@@ -6,6 +6,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-license-plugin-bug_28</artifactId>
<version>0</version>
+ <modelVersion>4.0.0</modelVersion>
<name>TestOne</name>
Modified: trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/java.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/java.xml 2009-09-26 03:56:02 UTC (rev 1650)
+++ trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/java.xml 2009-09-27 19:05:50 UTC (rev 1651)
@@ -6,6 +6,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-license-plugin-java</artifactId>
<version>0</version>
+ <modelVersion>4.0.0</modelVersion>
<name>TestOne</name>
Modified: trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/properties.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/properties.xml 2009-09-26 03:56:02 UTC (rev 1650)
+++ trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/properties.xml 2009-09-27 19:05:50 UTC (rev 1651)
@@ -6,6 +6,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-license-plugin-properties</artifactId>
<version>0</version>
+ <modelVersion>4.0.0</modelVersion>
<name>TestOne</name>
Modified: trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/xml.xml
===================================================================
--- trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/xml.xml 2009-09-26 03:56:02 UTC (rev 1650)
+++ trunk/src/test/resources/org/nuiton/license/header/plugin/UpdateHeaderPluginTest/xml.xml 2009-09-27 19:05:50 UTC (rev 1651)
@@ -6,6 +6,7 @@
<groupId>org.nuiton</groupId>
<artifactId>maven-license-plugin-xml</artifactId>
<version>0</version>
+ <modelVersion>4.0.0</modelVersion>
<name>TestOne</name>
1
0
r1650 - in trunk: . src/main/java/org/nuiton/license/header/generator src/main/java/org/nuiton/license/header/generator/impl src/main/java/org/nuiton/license/header/plugin
by tchemit@users.nuiton.org 26 Sep '09
by tchemit@users.nuiton.org 26 Sep '09
26 Sep '09
Author: tchemit
Date: 2009-09-26 05:56:02 +0200 (Sat, 26 Sep 2009)
New Revision: 1650
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java
trunk/src/main/java/org/nuiton/license/header/generator/HeaderGeneratorUtil.java
trunk/src/main/java/org/nuiton/license/header/generator/impl/JavaHeaderGenerator.java
trunk/src/main/java/org/nuiton/license/header/generator/impl/PropertiesHeaderGenerator.java
trunk/src/main/java/org/nuiton/license/header/generator/impl/XmlHeaderGenerator.java
trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java
trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java
Log:
- [EVOLUTION #64] : ajout des propri?\195?\169t?\195?\169s dryRun et skipUpdateHeader sur le mojo update-header
- improve header generator discovering with plexus instead of ServiceLoader
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/pom.xml 2009-09-26 03:56:02 UTC (rev 1650)
@@ -159,7 +159,7 @@
<artifactId>commons-httpclient</artifactId>
</exclusion>
- <exclusion>
+ <exclusion>
<groupId>plexus</groupId>
<artifactId>plexus-mail-sender-simple</artifactId>
</exclusion>
@@ -270,7 +270,21 @@
<plugins>
+ <!-- expose new plexus components -->
<plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <version>1.2.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-plugin-plugin</artifactId>
<executions>
<execution>
Modified: trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -31,6 +31,11 @@
public interface HeaderGenerator {
/**
+ * Plexus role name
+ */
+ String ROLE_NAME = HeaderGenerator.class.getName();
+
+ /**
*
* @return the name of the generator
*/
Modified: trunk/src/main/java/org/nuiton/license/header/generator/HeaderGeneratorUtil.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/HeaderGeneratorUtil.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/generator/HeaderGeneratorUtil.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -29,7 +29,10 @@
*
* @author chemit
* @since 1.0.1
+ * @deprecated since 1.0.2, prefer use a plexus component inspection, rather
+ * than java {@link ServiceLoader} mecanism.
*/
+@Deprecated
public class HeaderGeneratorUtil {
/**
Modified: trunk/src/main/java/org/nuiton/license/header/generator/impl/JavaHeaderGenerator.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/impl/JavaHeaderGenerator.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/generator/impl/JavaHeaderGenerator.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -28,6 +28,8 @@
*
* @author chemit
* @since 1.0.1
+ *
+ * @plexus.component role-hint="license-java"
*/
public class JavaHeaderGenerator extends AbstractLicenseHeaderGenerator {
Modified: trunk/src/main/java/org/nuiton/license/header/generator/impl/PropertiesHeaderGenerator.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/impl/PropertiesHeaderGenerator.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/generator/impl/PropertiesHeaderGenerator.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -28,6 +28,8 @@
*
* @author chemit
* @since 1.0.1
+ *
+ * @plexus.component role-hint="license-properties"
*/
public class PropertiesHeaderGenerator extends AbstractLicenseHeaderGenerator {
Modified: trunk/src/main/java/org/nuiton/license/header/generator/impl/XmlHeaderGenerator.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/impl/XmlHeaderGenerator.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/generator/impl/XmlHeaderGenerator.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -28,6 +28,8 @@
*
* @author chemit
* @since 1.0.1
+ *
+ * @plexus.component role-hint="license-xml"
*/
public class XmlHeaderGenerator extends AbstractLicenseHeaderGenerator {
Modified: trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java 2009-09-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -20,13 +20,13 @@
*/
package org.nuiton.license.header.plugin;
+import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.nuiton.license.header.generator.HeaderGenerator;
-import org.nuiton.license.header.generator.HeaderGeneratorUtil;
/**
* The goal display all the knwon generators.
@@ -49,24 +49,34 @@
* @since 1.0.1
*/
protected boolean detail;
+ /**
+ * All available generators
+ *
+ * @component role="org.nuiton.license.header.generator.HeaderGenerator"
+ */
+ protected Map<String, HeaderGenerator> _generators;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
- // obtain all available generators
- Map<String, HeaderGenerator> generators = HeaderGeneratorUtil.getGenerators(getClass().getClassLoader());
-
// display it
StringBuilder buffer = new StringBuilder('\n');
buffer.append("\n\n-------------------------------------------------------------------------------\n");
buffer.append(" maven-license-plugin\n");
buffer.append("-------------------------------------------------------------------------------\n\n");
- buffer.append("List of available generators :\n\n");
- for (Entry<String, HeaderGenerator> e : generators.entrySet()) {
- buffer.append(" - ").append(e.getKey()).append(" : ").append(e.getValue().getDescription());
- buffer.append("\n");
- if (detail) {
- buffer.append("\n example : \n").append(e.getValue().getHeader("content ")).append('\n');
+ if (_generators == null || _generators.isEmpty()) {
+ buffer.append("No generator found.\n\n");
+ } else {
+ buffer.append("List of available generators :\n\n");
+ Iterator<Entry<String, HeaderGenerator>> itr = _generators.entrySet().iterator();
+ while (itr.hasNext()) {
+ Entry<String, HeaderGenerator> e = itr.next();
+ HeaderGenerator generator = e.getValue();
+ buffer.append(" - ").append(e.getKey()).append(" : ").append(generator.getDescription());
+ buffer.append("\n");
+ if (detail) {
+ buffer.append("\n example : \n").append(generator.getHeader("content ")).append('\n');
+ }
}
}
getLog().info(buffer.toString());
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-26 02:53:12 UTC (rev 1649)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-09-26 03:56:02 UTC (rev 1650)
@@ -21,13 +21,13 @@
package org.nuiton.license.header.plugin;
import org.nuiton.processor.LicenseProcessor;
-import org.apache.maven.plugin.MojoExecutionException;
import java.io.File;
import java.io.StringWriter;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -40,7 +40,6 @@
import org.nuiton.license.License;
import org.nuiton.license.LicenseFactory;
import org.nuiton.license.header.generator.HeaderGenerator;
-import org.nuiton.license.header.generator.HeaderGeneratorUtil;
import org.nuiton.plugin.AbstractPlugin;
import org.nuiton.util.PluginHelper;
@@ -196,12 +195,32 @@
*/
protected boolean verbose;
/**
+ * A flag to skip the goal.
+ *
+ * @parameter expression="${skipUpdateHeader}" default-value="false"
+ * @since 1.0.3
+ */
+ private boolean skipUpdateHeader;
+ /**
+ * A flag to test plugin but modify no file.
+ *
+ * @parameter expression="${dryRun}" default-value="false"
+ * @since 1.0.3
+ */
+ protected boolean dryRun;
+ /**
* Velocity Component.
*
* @component roleHint="maven-license-plugin"
* @since 2.0.0
*/
protected VelocityComponent velocity;
+ /**
+ * All available generators
+ *
+ * @component role="org.nuiton.license.header.generator.HeaderGenerator"
+ */
+ protected Map<String, HeaderGenerator> _generators;
/** le header a ajouter dans chaque fichier source java */
protected String licenseHeaderContent;
/** le header complet (avec les balises de commentaires) */
@@ -243,17 +262,29 @@
@Override
public boolean init() throws Exception {
+ if (skipUpdateHeader) {
+ return true;
+ }
timestamp = System.nanoTime();
- HeaderGenerator generator;
+ if (_generators == null) {
+ // should never happen...
+ getLog().warn("no header generator found");
+ return false;
+ }
+ if (verbose) {
+ Iterator<Entry<String, HeaderGenerator>> itr = _generators.entrySet().iterator();
+ while (itr.hasNext()) {
+ Entry<String, HeaderGenerator> next = itr.next();
+ getLog().info("config - available generator : " + next.getKey());
+ }
+ }
- // obtain the header generator
- try {
- generator = HeaderGeneratorUtil.getGenerator(getClass().getClassLoader(), generatorName, true);
- } catch (IllegalArgumentException e) {
- // generator non trouve
- throw new MojoExecutionException("the generator named '" + generatorName + "' is unknown (use generator-list goal to see all of them)");
+ if (!_generators.containsKey(generatorName.trim())) {
+ getLog().warn("the generator named '" + generatorName + "' is unknown (use generator-list goal to see all of them)");
+ return false;
}
+ HeaderGenerator generator = _generators.get(generatorName);
// obtain all files to be treated
@@ -265,6 +296,7 @@
boolean doGenerate = !filesToTreate.isEmpty();
+
if (doGenerate) {
File templateFile = new File(template);
@@ -297,6 +329,11 @@
@Override
protected void doAction() throws Exception {
+ if (skipUpdateHeader) {
+ getLog().info("skip flag is on, the goal is skip.");
+ return;
+ }
+
// create a licence processor with given header
LicenseProcessor p = new LicenseProcessor(licenseHeaderContent);
@@ -324,19 +361,26 @@
getLog().info("adding license header on file " + file);
String content = PluginHelper.readAsString(file, encoding);
content = boxedLicenseHeaderContent + content;
- writeFile(processFile, content, encoding);
+ if (!dryRun) {
+ writeFile(processFile, content, encoding);
+ }
}
}
- if (keepBackup) {
+ if (keepBackup && !dryRun) {
File backupFile = new File(file.getAbsolutePath() + "~");
if (verbose) {
getLog().debug("backup original file " + file);
}
file.renameTo(backupFile);
}
- processFile.renameTo(file);
+ if (dryRun) {
+ processFile.delete();
+ } else {
+ processFile.renameTo(file);
+ }
+
} catch (Exception e) {
getLog().warn("skip file " + file + " (could not process for reason : " + e.getMessage() + ")");
processFile.delete();
1
0
26 Sep '09
Author: tchemit
Date: 2009-09-26 04:53:12 +0200 (Sat, 26 Sep 2009)
New Revision: 1649
Modified:
trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java
trunk/src/main/java/org/nuiton/license/header/plugin/LicenseListPlugin.java
Log:
improve ouput of non requiresProject mojo
Modified: trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java 2009-09-26 02:05:03 UTC (rev 1648)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/GeneratorListPlugin.java 2009-09-26 02:53:12 UTC (rev 1649)
@@ -33,7 +33,7 @@
*
* @author chemit
*
- * @requiresProject true
+ * @requiresProject false
* @requiresDirectInvocation
* @goal generator-list
*
@@ -57,13 +57,16 @@
Map<String, HeaderGenerator> generators = HeaderGeneratorUtil.getGenerators(getClass().getClassLoader());
// display it
- StringBuilder buffer = new StringBuilder();
- buffer.append("list of available generators :\n");
+ StringBuilder buffer = new StringBuilder('\n');
+ buffer.append("\n\n-------------------------------------------------------------------------------\n");
+ buffer.append(" maven-license-plugin\n");
+ buffer.append("-------------------------------------------------------------------------------\n\n");
+ buffer.append("List of available generators :\n\n");
for (Entry<String, HeaderGenerator> e : generators.entrySet()) {
buffer.append(" - ").append(e.getKey()).append(" : ").append(e.getValue().getDescription());
buffer.append("\n");
if (detail) {
- buffer.append("example : \n").append(e.getValue().getHeader("content ")).append('\n');
+ buffer.append("\n example : \n").append(e.getValue().getHeader("content ")).append('\n');
}
}
getLog().info(buffer.toString());
Modified: trunk/src/main/java/org/nuiton/license/header/plugin/LicenseListPlugin.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/plugin/LicenseListPlugin.java 2009-09-26 02:05:03 UTC (rev 1648)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/LicenseListPlugin.java 2009-09-26 02:53:12 UTC (rev 1649)
@@ -66,23 +66,26 @@
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
- StringBuilder sb = new StringBuilder();
- sb.append("Available licenses :\n");
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("\n\n-------------------------------------------------------------------------------\n");
+ buffer.append(" maven-license-plugin\n");
+ buffer.append("-------------------------------------------------------------------------------\n\n");
+ buffer.append("Available licenses :\n\n");
LicenseFactory factory = LicenseFactory.newInstance(extraResolver);
for (Entry<String, String> entry : factory.getLicenseNames().entrySet()) {
String licenseName = entry.getKey();
- sb.append(" * ").append(licenseName).append(" : ").append(entry.getValue()).append('\n');
+ buffer.append(" * ").append(licenseName).append(" : ").append(entry.getValue()).append('\n');
if (detail) {
License license = factory.revolv(licenseName);
try {
- sb.append(license.getHeaderContent(encoding)).append('\n');
+ buffer.append("\n").append(license.getHeaderContent(encoding)).append("\n\n");
} catch (IOException ex) {
throw new MojoExecutionException("could not instanciate license with name " + licenseName + " for reason " + ex.getMessage(), ex);
}
}
}
- getLog().info(sb.toString());
+ getLog().info(buffer.toString());
}
}
1
0
Author: tchemit
Date: 2009-09-26 04:05:03 +0200 (Sat, 26 Sep 2009)
New Revision: 1648
Modified:
trunk/pom.xml
Log:
- clean javadoc config
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-25 22:34:45 UTC (rev 1647)
+++ trunk/pom.xml 2009-09-26 02:05:03 UTC (rev 1648)
@@ -289,12 +289,6 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
- <docencoding>${project.reporting.outputEncoding}</docencoding>
- <encoding>${project.reporting.outputEncoding}</encoding>
- <charset>${project.reporting.outputEncoding}</charset>
- <quiet>true</quiet>
- <!-- uniquement a partir de javadoc 2.5 -->
- <!--skip>${maven.javadoc.skip}</skip-->
<taglets>
<taglet>
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
@@ -492,12 +486,6 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
- <docencoding>${project.reporting.outputEncoding}</docencoding>
- <encoding>${project.reporting.outputEncoding}</encoding>
- <charset>${project.reporting.outputEncoding}</charset>
- <quiet>true</quiet>
- <!-- uniquement a partir de javadoc 2.5 -->
- <!--skip>${maven.javadoc.skip}</skip-->
<taglets>
<taglet>
<tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
1
0
Author: tchemit
Date: 2009-09-26 00:34:45 +0200 (Sat, 26 Sep 2009)
New Revision: 1647
Modified:
trunk/pom.xml
Log:
[ANOMALIE #60] : rendre le plugin compatible 2.2.x (maven-helper-plugin)
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-21 10:46:47 UTC (rev 1646)
+++ trunk/pom.xml 2009-09-25 22:34:45 UTC (rev 1647)
@@ -64,6 +64,36 @@
<artifactId>commons-httpclient</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-simple</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-api</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-javamail</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-cipher</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-sec-dispatcher</artifactId>
+ </exclusion>
+
</exclusions>
</dependency>
@@ -129,6 +159,36 @@
<artifactId>commons-httpclient</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-simple</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-api</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>plexus</groupId>
+ <artifactId>plexus-mail-sender-javamail</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-cipher</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-sec-dispatcher</artifactId>
+ </exclusion>
+
</exclusions>
</dependency>
1
0
Author: tchemit
Date: 2009-09-21 12:46:47 +0200 (Mon, 21 Sep 2009)
New Revision: 1646
Modified:
trunk/pom.xml
Log:
improve test dependencies
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-21 10:44:43 UTC (rev 1645)
+++ trunk/pom.xml 2009-09-21 10:46:47 UTC (rev 1646)
@@ -117,6 +117,19 @@
<version>${helper.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
+ <exclusions>
+
+ <exclusion>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-dependency-tree</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+
+ </exclusions>
</dependency>
<dependency>
@@ -124,6 +137,38 @@
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.2</version>
<scope>test</scope>
+ <exclusions>
+
+ <exclusion>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-monitor</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-http-lightweight</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-archiver</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ </exclusion>
+
+ </exclusions>
</dependency>
<dependency>
1
0
r1645 - trunk/src/main/java/org/nuiton/license/header/generator
by tchemit@users.nuiton.org 21 Sep '09
by tchemit@users.nuiton.org 21 Sep '09
21 Sep '09
Author: tchemit
Date: 2009-09-21 12:44:43 +0200 (Mon, 21 Sep 2009)
New Revision: 1645
Modified:
trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java
Log:
fix javadoc
Modified: trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java 2009-09-21 10:27:21 UTC (rev 1644)
+++ trunk/src/main/java/org/nuiton/license/header/generator/HeaderGenerator.java 2009-09-21 10:44:43 UTC (rev 1645)
@@ -57,7 +57,7 @@
/**
*
* @param content
- * @return
+ * @return the prefix content
* @throws IOException
*/
String prefixContent(String content) throws IOException;
1
0
21 Sep '09
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;
- }
}
1
0
r1643 - in trunk: . src/main/java/org/nuiton/license/header/plugin
by tchemit@users.nuiton.org 21 Sep '09
by tchemit@users.nuiton.org 21 Sep '09
21 Sep '09
Author: tchemit
Date: 2009-09-21 12:17:05 +0200 (Mon, 21 Sep 2009)
New Revision: 1643
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java
Log:
oblige de forcer plexus-utils sinon il prend pas le bon en runtime...
ajout javadoc
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-21 10:11:54 UTC (rev 1642)
+++ trunk/pom.xml 2009-09-21 10:17:05 UTC (rev 1643)
@@ -61,126 +61,329 @@
</exclusion>
<exclusion>
<groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
- </exclusions>
- </dependency>
+ </exclusions>
+ </dependency>
<!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas -->
- <!--<dependency>
+ <dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.5.15</version>
<scope>compile</scope>
- </dependency>-->
+ </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>${maven.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>${maven.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${maven.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-velocity</artifactId>
- <version>1.1.7</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-velocity</artifactId>
+ <version>1.1.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- tests dependencies -->
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <version>${helper.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
- </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <version>${helper.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.7</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
-</dependencies>
+ </dependencies>
<!-- ************************************************************* -->
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
-<name>Maven License Plugin</name>
+ <name>Maven License Plugin</name>
-<description>
+ <description>
Plugin pour mettre à jour l'en-tête des fichiers (avec la license choisie)
dans un module maven 2.
-</description>
-<inceptionYear>2008</inceptionYear>
-<url>http://maven-site.nuiton.org/maven-license-plugin</url>
+ </description>
+ <inceptionYear>2008</inceptionYear>
+ <url>http://maven-site.nuiton.org/maven-license-plugin</url>
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
-<packaging>maven-plugin</packaging>
+ <packaging>maven-plugin</packaging>
-<properties>
+ <properties>
- <processor.version>1.0.1-SNAPSHOT</processor.version>
+ <processor.version>1.0.1-SNAPSHOT</processor.version>
-</properties>
+ </properties>
-<build>
+ <build>
- <defaultGoal>install</defaultGoal>
+ <defaultGoal>install</defaultGoal>
- <plugins>
+ <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
+ </plugins>
- <pluginManagement>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc.version}</version>
+ <configuration>
+ <docencoding>${project.reporting.outputEncoding}</docencoding>
+ <encoding>${project.reporting.outputEncoding}</encoding>
+ <charset>${project.reporting.outputEncoding}</charset>
+ <quiet>true</quiet>
+ <!-- uniquement a partir de javadoc 2.5 -->
+ <!--skip>${maven.javadoc.skip}</skip-->
+ <taglets>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusComponentTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusConfigurationTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusRequirementTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ </taglets>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jrst</groupId>
+ <artifactId>doxia-module-jrst</artifactId>
+ <version>${jrst.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ </build>
+
+ <reporting>
<plugins>
<plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ <plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
@@ -354,222 +557,19 @@
</taglet>
</taglets>
</configuration>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
</plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.nuiton.jrst</groupId>
- <artifactId>doxia-module-jrst</artifactId>
- <version>${jrst.version}</version>
- </dependency>
- </dependencies>
- </plugin>
</plugins>
- </pluginManagement>
-
-</build>
-
-<reporting>
- <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>${javadoc.version}</version>
- <configuration>
- <docencoding>${project.reporting.outputEncoding}</docencoding>
- <encoding>${project.reporting.outputEncoding}</encoding>
- <charset>${project.reporting.outputEncoding}</charset>
- <quiet>true</quiet>
- <!-- uniquement a partir de javadoc 2.5 -->
- <!--skip>${maven.javadoc.skip}</skip-->
- <taglets>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-javadoc</artifactId>
- <version>2.4.2</version>
- </tagletArtifact>
- </taglet>
-
- <taglet>
- <tagletClass>org.codehaus.plexus.javadoc.PlexusComponentTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-javadoc</artifactId>
- <version>1.0</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.codehaus.plexus.javadoc.PlexusConfigurationTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-javadoc</artifactId>
- <version>1.0</version>
- </tagletArtifact>
- </taglet>
- <taglet>
- <tagletClass>org.codehaus.plexus.javadoc.PlexusRequirementTaglet</tagletClass>
- <tagletArtifact>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-javadoc</artifactId>
- <version>1.0</version>
- </tagletArtifact>
- </taglet>
- </taglets>
- </configuration>
- </plugin>
- </plugins>
-</reporting>
+ </reporting>
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<!-- Source control management. -->
-<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
-</scm>
+ <scm>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
+ </scm>
</project>
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:11:54 UTC (rev 1642)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-09-21 10:17:05 UTC (rev 1643)
@@ -199,8 +199,9 @@
* Velocity Component.
*
* @component roleHint="maven-license-plugin"
+ * @since 2.0.0
*/
- private VelocityComponent velocity;
+ protected VelocityComponent velocity;
/** le header a ajouter dans chaque fichier source java */
protected String licenseHeaderContent;
/** le header complet (avec les balises de commentaires) */
1
0
r1642 - in trunk: . src/main/java/org/nuiton/license/header/plugin src/main/resources/META-INF src/main/resources/META-INF/plexus src/test/java/org/nuiton/license/header src/test/java/org/nuiton/license/header/plugin
by tchemit@users.nuiton.org 21 Sep '09
by tchemit@users.nuiton.org 21 Sep '09
21 Sep '09
Author: tchemit
Date: 2009-09-21 12:11:54 +0200 (Mon, 21 Sep 2009)
New Revision: 1642
Added:
trunk/src/main/resources/META-INF/plexus/
trunk/src/main/resources/META-INF/plexus/components.xml
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java
trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java
trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java
Log:
[EVOLUTION #56] : utilisation novuelles api de maven-helper-plugin
- utilisation component plexus-velocity
- ajout des tagslets javadocs pour les mojo
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-08-29 21:29:19 UTC (rev 1641)
+++ trunk/pom.xml 2009-09-21 10:11:54 UTC (rev 1642)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom</artifactId>
- <version>1.0.2-SNAPSHOT</version>
+ <version>1.0.3-SNAPSHOT</version>
</parent>
<artifactId>maven-license-plugin</artifactId>
@@ -29,134 +29,547 @@
<artifactId>maven-helper-plugin</artifactId>
<version>${helper.version}</version>
<scope>compile</scope>
- </dependency>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact-manager</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-dependency-tree</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-profile</artifactId>
+ </exclusion>
+
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </exclusion>
+
+ </exclusions>
+ </dependency>
+
<!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas -->
- <dependency>
+ <!--<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.5.15</version>
<scope>compile</scope>
- </dependency>
+ </dependency>-->
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>${maven.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>${maven.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${maven.version}</version>
- <scope>provided</scope>
- </dependency>
-
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-velocity</artifactId>
+ <version>1.1.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- tests dependencies -->
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <version>${helper.version}</version>
- <scope>test</scope>
- <classifier>tests</classifier>
- </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-helper-plugin</artifactId>
+ <version>${helper.version}</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.1</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.6</version>
- <scope>test</scope>
- </dependency>
+</dependencies>
- </dependencies>
-
<!-- ************************************************************* -->
<!-- *** Project Information ************************************* -->
<!-- ************************************************************* -->
- <name>Maven License Plugin</name>
+<name>Maven License Plugin</name>
- <description>
+<description>
Plugin pour mettre à jour l'en-tête des fichiers (avec la license choisie)
dans un module maven 2.
- </description>
- <inceptionYear>2008</inceptionYear>
- <url>http://maven-site.nuiton.org/maven-license-plugin</url>
+</description>
+<inceptionYear>2008</inceptionYear>
+<url>http://maven-site.nuiton.org/maven-license-plugin</url>
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
- <packaging>maven-plugin</packaging>
+<packaging>maven-plugin</packaging>
- <properties>
+<properties>
- <helper.version>1.0.2-SNAPSHOT</helper.version>
- <processor.version>1.0.1-SNAPSHOT</processor.version>
+ <processor.version>1.0.1-SNAPSHOT</processor.version>
- </properties>
+</properties>
- <build>
+<build>
- <defaultGoal>install</defaultGoal>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+
+ <pluginManagement>
<plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc.version}</version>
+ <configuration>
+ <docencoding>${project.reporting.outputEncoding}</docencoding>
+ <encoding>${project.reporting.outputEncoding}</encoding>
+ <charset>${project.reporting.outputEncoding}</charset>
+ <quiet>true</quiet>
+ <!-- uniquement a partir de javadoc 2.5 -->
+ <!--skip>${maven.javadoc.skip}</skip-->
+ <taglets>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusComponentTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusConfigurationTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusRequirementTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ </taglets>
+ </configuration>
<executions>
<execution>
+ <id>attach-javadocs</id>
<goals>
- <goal>helpmojo</goal>
+ <goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
-
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jrst</groupId>
+ <artifactId>doxia-module-jrst</artifactId>
+ <version>${jrst.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
+ </pluginManagement>
- <pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.nuiton.jrst</groupId>
- <artifactId>doxia-module-jrst</artifactId>
- <version>${jrst.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </pluginManagement>
+</build>
- </build>
+<reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${javadoc.version}</version>
+ <configuration>
+ <docencoding>${project.reporting.outputEncoding}</docencoding>
+ <encoding>${project.reporting.outputEncoding}</encoding>
+ <charset>${project.reporting.outputEncoding}</charset>
+ <quiet>true</quiet>
+ <!-- uniquement a partir de javadoc 2.5 -->
+ <!--skip>${maven.javadoc.skip}</skip-->
+ <taglets>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ </taglet>
- <reporting>
- <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusComponentTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusConfigurationTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ <taglet>
+ <tagletClass>org.codehaus.plexus.javadoc.PlexusRequirementTaglet</tagletClass>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-javadoc</artifactId>
+ <version>1.0</version>
+ </tagletArtifact>
+ </taglet>
+ </taglets>
+ </configuration>
+ </plugin>
+ </plugins>
+</reporting>
<!-- ************************************************************* -->
<!-- *** Build Environment ************************************** -->
<!-- ************************************************************* -->
<!-- Source control management. -->
- <scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
- </scm>
+<scm>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
+</scm>
</project>
Modified: trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-08-29 21:29:19 UTC (rev 1641)
+++ trunk/src/main/java/org/nuiton/license/header/plugin/UpdateHeaderPlugin.java 2009-09-21 10:11:54 UTC (rev 1642)
@@ -25,22 +25,24 @@
import java.io.File;
import java.io.StringWriter;
-import java.net.URL;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Properties;
import org.apache.maven.project.MavenProject;
-import org.nuiton.AbstractPlugin;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.context.Context;
+import org.codehaus.plexus.velocity.VelocityComponent;
import org.nuiton.license.License;
import org.nuiton.license.LicenseFactory;
import org.nuiton.license.header.generator.HeaderGenerator;
import org.nuiton.license.header.generator.HeaderGeneratorUtil;
+import org.nuiton.plugin.AbstractPlugin;
import org.nuiton.util.PluginHelper;
-import org.nuiton.util.VelocityTemplateGenerator;
/**
* The goal to update (or add) the licence header on some files.
@@ -193,6 +195,12 @@
* @since 1.0.0
*/
protected boolean verbose;
+ /**
+ * Velocity Component.
+ *
+ * @component roleHint="maven-license-plugin"
+ */
+ private VelocityComponent velocity;
/** le header a ajouter dans chaque fichier source java */
protected String licenseHeaderContent;
/** le header complet (avec les balises de commentaires) */
@@ -263,7 +271,7 @@
// verifie que la template existe (dans le class-path ou en tant que fichier)
checkResource(templateFile);
- URL templateURL = getTemplate(templateFile);
+ // URL templateURL = getTemplate(templateFile);
// recuperation de la license a utiliser
LicenseFactory factory = LicenseFactory.newInstance(licenseResolver);
@@ -272,10 +280,10 @@
if (verbose) {
getLog().info("config - use license " + license.getName());
getLog().info("config - use generator " + generator.getName());
- getLog().info("config - use template " + templateURL);
+ getLog().info("config - use template " + template);
}
// obtain content of license header
- licenseHeaderContent = computeHeader(license, templateURL, generator);
+ licenseHeaderContent = computeHeader(license, generator);
// build the comment boxed header content
boxedLicenseHeaderContent = generator.getHeader(licenseHeaderContent);
@@ -348,12 +356,11 @@
* license donnée.
*
* @param license
- * @param templateURL
* @param generator
* @return le header construit
* @throws Exception pour toute erreur pendant la construction du header
*/
- protected String computeHeader(License license, URL templateURL, HeaderGenerator generator) throws Exception {
+ protected String computeHeader(License license, HeaderGenerator generator) throws Exception {
// recuperation de la license a mettre dans le header
String licenseContent = license.getHeaderContent(encoding);
@@ -366,33 +373,45 @@
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);
+// // 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());
+// }
+// }
- if (templateParameters != null) {
- for (Entry<String, String> e : templateParameters.entrySet()) {
- env.put(e.getKey(), e.getValue());
- }
- }
+
+ Context context = createVelocityContext(licenseContent);
+
if (verbose) {
StringBuilder buffer = new StringBuilder();
buffer.append("config - parameters for template : ");
- for (Entry<Object, Object> e : env.entrySet()) {
- buffer.append("\n * " + e.getKey() + " : " + e.getValue());
+ for (Object key : context.getKeys()) {
+ buffer.append("\n * " + key + " : " + context.get(key + ""));
}
getLog().info(buffer.toString());
}
// generation du contenu via velocity
+ VelocityEngine engine = velocity.getEngine();
+
StringWriter writer = new StringWriter();
- VelocityTemplateGenerator gen = new VelocityTemplateGenerator(project, templateURL);
- gen.generate(env, writer);
+ Template velocityTemplate = engine.getTemplate(template, encoding);
+
+ velocityTemplate.merge(context, writer);
+
+ writer.flush();
+
+ writer.close();
+
// recuperation du contenu du texte genere
String r = writer.getBuffer().toString();
@@ -401,4 +420,23 @@
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;
+ }
}
Added: trunk/src/main/resources/META-INF/plexus/components.xml
===================================================================
--- trunk/src/main/resources/META-INF/plexus/components.xml (rev 0)
+++ trunk/src/main/resources/META-INF/plexus/components.xml 2009-09-21 10:11:54 UTC (rev 1642)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.velocity.VelocityComponent</role>
+ <role-hint>maven-license-plugin</role-hint>
+ <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
+ <configuration>
+ <properties>
+ <property>
+ <name>resource.loader</name>
+ <value>file,classpath</value>
+ </property>
+ <property>
+ <name>classpath.resource.loader.class</name>
+ <value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
+ </property>
+ <property>
+ <name>file.resource.loader.class</name>
+ <value>org.apache.velocity.runtime.resource.loader.FileResourceLoader</value>
+ </property>
+ </properties>
+ </configuration>
+ </component>
+ </components>
+</component-set>
\ No newline at end of file
Modified: trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java 2009-08-29 21:29:19 UTC (rev 1641)
+++ trunk/src/test/java/org/nuiton/license/header/LicenseProcessorTest.java 2009-09-21 10:11:54 UTC (rev 1642)
@@ -25,13 +25,13 @@
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codehaus.plexus.PlexusTestCase;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Test;
+import org.nuiton.plugin.TestHelper;
import org.nuiton.util.PluginHelper;
/**
@@ -48,9 +48,8 @@
@BeforeClass
public static void initClass() throws Exception {
- String path = PlexusTestCase.getBasedir();
- basedir = new File(path);
- testdir = new File(basedir, "target" + File.separator + "tests" + File.separator + LicenseProcessorTest.class.getSimpleName());
+ basedir = TestHelper.getBasedir();
+ testdir = TestHelper.getFile(basedir, "target", "tests", LicenseProcessorTest.class.getSimpleName());
testdir.mkdirs();
}
@@ -65,8 +64,8 @@
@Test
public void testProcessor() throws IOException {
- File in = new File(basedir, "src" + File.separator + "test" + File.separator + "resources" + File.separator + "LicenseProcessorTest.java2");
- File out = new File(testdir, in.getName());
+ File in = TestHelper.getFile(basedir, "src", "test", "resources", "LicenseProcessorTest.java2");
+ File out = TestHelper.getFile(testdir, in.getName());
LicenseProcessor processor = new LicenseProcessor("my license");
processor.process(in, out);
String content = PluginHelper.readAsString(out, "utf-8");
@@ -81,7 +80,7 @@
@Test
public void testProcessor2() throws IOException {
- File in = new File(basedir, "src" + File.separator + "test" + File.separator + "resources" + File.separator + "LicenseProcessorTest_1.java2");
+ File in = TestHelper.getFile(basedir, "src", "test", "resources", "LicenseProcessorTest_1.java2");
File out = new File(testdir, in.getName());
LicenseProcessor processor = new LicenseProcessor("my license");
processor.process(in, out);
Modified: trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java
===================================================================
--- trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java 2009-08-29 21:29:19 UTC (rev 1641)
+++ trunk/src/test/java/org/nuiton/license/header/plugin/UpdateHeaderPluginTest.java 2009-09-21 10:11:54 UTC (rev 1642)
@@ -23,71 +23,47 @@
import java.io.File;
import java.io.IOException;
import java.util.Map.Entry;
-import org.nuiton.util.PluginConfig;
import static org.junit.Assert.*;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
-import org.junit.AfterClass;
import org.nuiton.processor.filters.LicenseFilter;
-import org.nuiton.util.BasePluginTestCase;
import org.nuiton.util.PluginHelper;
+import org.nuiton.plugin.AbstractMojoTest;
/** @author chemit */
-public class UpdateHeaderPluginTest extends BasePluginTestCase {
+public class UpdateHeaderPluginTest extends AbstractMojoTest<UpdateHeaderPlugin> {
public static final String _LICENSE_TO_CHANGE_ = LicenseFilter.HEADER + " license to change " + LicenseFilter.FOOTER;
public static final String _MUST_BE_THERE = "// MUST BE THERE!";
- UpdateHeaderPlugin plugin;
- @BeforeClass
- public static void initClass() throws Exception {
- initConfigs(UpdateHeaderPluginTest.class, "testBug_28", "testJava", "testXml", "testProperties");
- }
-
- @AfterClass
- public static void afterClass() throws Exception {
- configItr = null;
- testDir = null;
- }
-
- @Before
@Override
- public void setUp() throws Exception {
- super.setUp();
- assertNotNull(mojo);
- plugin = (UpdateHeaderPlugin) mojo;
- plugin.setVerbose(true);
+ protected String getGoalName(String methodName) {
+ return "update-header";
}
@Test
- @PluginConfig(pomName = "bug_28.xml", goalName = "update-header")
- public void testBug_28() throws Exception {
+ public void bug_28() throws Exception {
testPom(new String[]{_MUST_BE_THERE}, new String[]{});
}
@Test
- @PluginConfig(pomName = "java.xml", goalName = "update-header")
- public void testJava() throws Exception {
+ public void java() throws Exception {
testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_});
}
@Test
- @PluginConfig(pomName = "xml.xml", goalName = "update-header")
- public void testXml() throws Exception {
+ public void xml() throws Exception {
testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_});
}
@Test
- @PluginConfig(pomName = "properties.xml", goalName = "update-header")
- public void testProperties() throws Exception {
+ public void properties() throws Exception {
testPom(new String[]{_MUST_BE_THERE}, new String[]{_LICENSE_TO_CHANGE_});
@@ -95,9 +71,11 @@
public void testPom(String[] mandatoryPatterns, String[] excludePatterns) throws Exception {
- plugin.execute();
+ UpdateHeaderPlugin mojo = getMojo();
- for (Entry<File, String[]> entry : plugin.filesToTreate.entrySet()) {
+ mojo.execute();
+
+ for (Entry<File, String[]> entry : mojo.filesToTreate.entrySet()) {
File src = entry.getKey();
for (String javaRelativePath : entry.getValue()) {
File f = new File(src, javaRelativePath);
1
0