Index: maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java diff -u maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.1 maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.2 --- maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java:1.1 Sun Dec 30 23:33:59 2007 +++ maven-commandline-plugin/src/java/org/codelutin/option/generate/RstGeneratorGoal.java Mon Dec 31 03:34:21 2007 @@ -18,10 +18,11 @@ * ##% */ package org.codelutin.option.generate; +import org.codelutin.i18n.I18n; import static org.codelutin.i18n.I18n._; import org.codelutin.option.OptionParser; import org.codelutin.option.ParserUtil; -import org.codelutin.option.generate.AbstractGeneratorGoal; +import org.codelutin.util.Resource; import java.io.BufferedWriter; import java.io.File; @@ -45,7 +46,11 @@ * @required */ protected String parserFQN; - + /** + * @description le chemin où trouver les fichiers de traductions pour l'initialisation I18N, sinon le fichier du plugin est utilisé, alors qu'il faut que ce soit celui de l'application + * @parameter expression="${commandline.i18nCP}" default-value="${basedir}/target/gen/i18n" + */ + protected String i18nCP; /** * @description Target rst file. * @parameter expression="${commandline.rstFilePath}" @@ -63,8 +68,12 @@ @SuppressWarnings({"unchecked"}) protected void initAction() throws ClassNotFoundException, MalformedURLException { - - //Resource.addDefaultClassLoader(out.toURI().toURL()); + log.info("projectCP:" + out); + // add i18n location as classpath + Resource.addDefaultClassLoader(new File(i18nCP).toURI().toURL()); + Resource.addDefaultClassLoader(out.toURI().toURL()); + // init i18n + I18n.init2(System.getProperty("user.language"), System.getProperty("user.country"), "ISO-8859-1"); checkInstanceOf(parserFQN, OptionParser.class); Index: maven-commandline-plugin/src/java/org/codelutin/option/generate/JavaGeneratorGoal.java diff -u maven-commandline-plugin/src/java/org/codelutin/option/generate/JavaGeneratorGoal.java:1.1 maven-commandline-plugin/src/java/org/codelutin/option/generate/JavaGeneratorGoal.java:1.2 --- maven-commandline-plugin/src/java/org/codelutin/option/generate/JavaGeneratorGoal.java:1.1 Sun Dec 30 23:33:59 2007 +++ maven-commandline-plugin/src/java/org/codelutin/option/generate/JavaGeneratorGoal.java Mon Dec 31 03:34:21 2007 @@ -21,6 +21,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.maven.plugin.MojoFailureException; import static org.codelutin.i18n.I18n._; +import org.codelutin.i18n.I18n; import org.codelutin.option.Config; import org.codelutin.option.Option; import org.codelutin.option.OptionAction; @@ -154,11 +155,14 @@ public JavaGeneratorGoal() { } - public JavaGeneratorGoal(String prefix, String i18nCP, boolean verbose) { - super(prefix, i18nCP, verbose); + public JavaGeneratorGoal(String prefix, boolean verbose) { + super(prefix, verbose); } protected void initAction() throws Exception { + // init i18n + I18n.init2(System.getProperty("user.language"), System.getProperty("user.country"), "ISO-8859-1"); + checkInstanceOf(parserSuperClass, OptionParser.class); checkInstanceOf(optionSuperClass, Option.class); checkInstanceOf(actionSuperClass, OptionAction.class); Index: maven-commandline-plugin/src/java/org/codelutin/option/generate/AbstractGeneratorGoal.java diff -u maven-commandline-plugin/src/java/org/codelutin/option/generate/AbstractGeneratorGoal.java:1.2 maven-commandline-plugin/src/java/org/codelutin/option/generate/AbstractGeneratorGoal.java:1.3 --- maven-commandline-plugin/src/java/org/codelutin/option/generate/AbstractGeneratorGoal.java:1.2 Mon Dec 31 00:53:13 2007 +++ maven-commandline-plugin/src/java/org/codelutin/option/generate/AbstractGeneratorGoal.java Mon Dec 31 03:34:21 2007 @@ -24,14 +24,9 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; -import org.codelutin.i18n.I18n; import org.codelutin.log.LutinLogFactory; -import org.codelutin.util.Resource; import org.codelutin.util.StringUtil; -import java.io.File; -import static java.lang.System.getProperty; - /** * Classe de base pour une goal de génération * @@ -53,11 +48,6 @@ protected String prefix; /** - * @description le chemin où trouver les fichiers de traductions pour l'initialisation I18N, sinon le fichier du plugin est utilisé, alors qu'il faut que ce soit celui de l'application - * @parameter expression="${commandline.i18nCP}" default-value="${basedir}/target/gen/i18n" - */ - protected String i18nCP; - /** * @description flag pour afficher verbeusement ou non les logs * @parameter expression="${commandline.verbose}" default-value="${maven.verbose}" */ @@ -72,8 +62,7 @@ protected AbstractGeneratorGoal() { } - protected AbstractGeneratorGoal(String prefix, String i18nCP, boolean verbose) { - this.i18nCP = i18nCP; + protected AbstractGeneratorGoal(String prefix, boolean verbose) { this.prefix = prefix; this.verbose = verbose; } @@ -86,12 +75,6 @@ t0 = System.currentTimeMillis(); i18nPrefix = prefix.toLowerCase(); try { - - // add i18n location as classpath - Resource.addDefaultClassLoader(new File(i18nCP).toURI().toURL()); - // init i18n - I18n.init2(getProperty("user.language"), getProperty("user.country"), "ISO-8859-1"); - Logger logger = Logger.getLogger("org.codelutin.option"); if (verbose) { // set logger to debug level