maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r612011 - /maven/site/trunk/src/site/apt/guides/plugin/guide-java-plugin-development.apt
Date Tue, 15 Jan 2008 04:17:21 GMT
Author: vsiveton
Date: Mon Jan 14 20:17:20 2008
New Revision: 612011

MNG-3273: Point out known pitfalls when developing plugins
Submitted by: Benjamin Bentmann
Reviewed by: Vincent Siveton

o applied
o added "Commons Bugs thread" link


Modified: maven/site/trunk/src/site/apt/guides/plugin/guide-java-plugin-development.apt
--- maven/site/trunk/src/site/apt/guides/plugin/guide-java-plugin-development.apt (original)
+++ maven/site/trunk/src/site/apt/guides/plugin/guide-java-plugin-development.apt Mon Jan
14 20:17:20 2008
@@ -100,11 +100,12 @@
   * The <<<getLog>>> method (defined in <<<AbstractMojo>>>)
returns a
     log4j-like logger object which allows plugins to create messages at levels
     of "debug", "info", "warn", and "error".  This logger is the accepted means
-    to display information to the user.
+    to display information to the user. Please have a look at the section about
+    pitfalls for a hint on its proper usage.
- All Mojo annotations are described {{{../../developers/mojo-api-specification.html#The_Descriptor_and_Annotations}here}}.
+ All Mojo annotations are described by the {{{../../developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo
API Specification}}.
 ** Project Definition
@@ -319,7 +320,7 @@
   the variable as a mojo parameter.  The "<<<expression>>>"
   parameter defines the default value for the variable.  This value can
   include expressions which reference the project, such as
-  "<<<${project.version}>>>" (more can be found in the
+  "<<<$\{project.version\}>>>" (more can be found in the
   "Parameter Expressions" document).  The name of the variable is used
   as the name of the parameter.
@@ -696,6 +697,24 @@
   into the mojo fields. If you really need to use <<<java.lang.String>>>
for the parameter type (e.g. to allow the user to alternatively specify
   a class path resource or URL), be sure to always resolve relative file paths manually against
the base directory of the project.
+** Creating Resource Bundles
+ Omitting an explicit resource bundle for the default locale provided by the base bundle
is not allowed. For example, the following family
+ of resource bundles does not provide reliable internationalization for your mojo:
+  <<Explanation>>: As described in the method javadoc about
+  <<<{{{,%20java.util.Locale,%20java.lang.ClassLoader)}ResourceBundle.getBundle(String,
Locale, ClassLoader)}}>>>,
+  the lookup strategy to find a bundle for a specific locale will prefer the bundle for the
JVM's default locale over the base bundle.
+  However, the JVM's default locale needs not to match the locale of the base bundle. In
the example above, a request for the locale "en" will
+  retrieve the bundle <<<>>> instead of <<<>>>
if the JVM's default locale happens to be "de".
+  Therefore, always provide a dedicated bundle for the default locale of your bundle family
(e.g. <<<>>>). This
+  bundle should be empty such that it retrieves strings via the parent chain from the base
 * Resources
     [[1]] {{{../../developers/mojo-api-specification.html}Mojo Documentation}}: Mojo API,
Mojo annotations
@@ -707,5 +726,7 @@
     [[4]] {{{}Plexus Common Utilities}}: Set of utilities
classes useful for Mojo development.
     [[5]] {{{}Commons IO}}: Set of utilities classes useful
for file/path handling.
+    [[6]] {{{}Common Bugs Thread}}.

View raw message