From 5c42776c50e88e8d939fc50cbc12bcc03e7d2c78 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Fri, 20 Feb 2009 21:58:19 +0000 Subject: [PATCH] [MPLUGIN-111] Warn about the use of platform encoding for extracting mojo metadata. This warning is adapted from that used in the resources plugin, from maven-filtering. git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@746382 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/plugin/plugin/AbstractGeneratorMojo.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java index 75ea6e9..e768385 100644 --- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java +++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java @@ -30,6 +30,7 @@ import org.apache.maven.tools.plugin.extractor.ExtractionException; import org.apache.maven.tools.plugin.generator.Generator; import org.apache.maven.tools.plugin.scanner.MojoScanner; import org.apache.maven.tools.plugin.util.PluginUtils; +import org.codehaus.plexus.util.ReaderFactory; import java.io.File; import java.io.IOException; @@ -151,6 +152,16 @@ public abstract class AbstractGeneratorMojo pluginDescriptor.setDescription( project.getDescription() ); + if ( encoding == null || encoding.length() < 1 ) + { + getLog().warn( "Using platform encoding (" + ReaderFactory.FILE_ENCODING + + " actually) to read mojo metadata, i.e. build is platform dependent!" ); + } + else + { + getLog().info( "Using '" + encoding + "' encoding to read mojo metadata." ); + } + try { pluginDescriptor.setDependencies( PluginUtils.toComponentDependencies( project.getRuntimeDependencies() ) );