Logger Name in Maven2 MOJO
From my observation, the logger name assigned to plugin seems to be auto-determined by maven, which is somthing like removing -maven- or -maven-plugin in the artifact name.
Is there any way that I can declare the logger name my plugin will use? Because my plugin artifact id was something like
foo-bar-ma开发者_如何学Goven-hello-world
And the resulting logger name become
foo-barhello-world
(which still works, but looks really bad... :P )
I am not sure you can tweak the logger name that gets injected by Plexus (at least, I don't know how to do this).
As an side note, I'd suggest to use the ${prefix}-maven-plugin
or maven-${prefix}-plugin
pattern for your plugin artifactid
, this will make the invocation easier without having to set a plugin prefix explicitly.
See also
- Guide to Developing Java Plugins
- Retrieving the Mojo Logger
- 11.4.3. Configuring a Plugin Prefix
- 11.4.4. Logging from a Plugin
精彩评论