From b1dbec59abc3d68853271ee0b26e168f362ef457 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 18 Nov 2012 02:23:48 +0000 Subject: [PATCH] added developer documentation about logging APIs git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1410815 13f79535-47bb-0310-9956-ffa450edef68 --- maven-embedder/pom.xml | 2 +- maven-embedder/src/site/apt/index.apt | 6 +++- maven-embedder/src/site/apt/logging.apt | 39 +++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 maven-embedder/src/site/apt/logging.apt diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml index b0cee82675..587398f371 100644 --- a/maven-embedder/pom.xml +++ b/maven-embedder/pom.xml @@ -22,7 +22,7 @@ maven-embedder Maven Embedder - Maven embeddable component, with CLI support. + Maven embeddable component, with CLI and logging support. diff --git a/maven-embedder/src/site/apt/index.apt b/maven-embedder/src/site/apt/index.apt index 46422561f3..cde7affdf3 100644 --- a/maven-embedder/src/site/apt/index.apt +++ b/maven-embedder/src/site/apt/index.apt @@ -10,4 +10,8 @@ ${project.name} ${project.description} - See {{{./cli.html}CLI options}} reference. \ No newline at end of file +* References + + * {{{./cli.html}CLI options}}, + + * {{{./logging.html}logging API}}. diff --git a/maven-embedder/src/site/apt/logging.apt b/maven-embedder/src/site/apt/logging.apt new file mode 100644 index 0000000000..e2830c4c88 --- /dev/null +++ b/maven-embedder/src/site/apt/logging.apt @@ -0,0 +1,39 @@ + ----- + Maven Logging + ----- + Hervé Boutemy + ----- + 2012-04-29 + ----- + +Maven Logging + + Maven uses + {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/package-summary.html}Plexus + Container logging API}}, like any other Plexus components, ie + {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/LoggerManager.html}LoggerManager}} + / {{{http://plexus.codehaus.org/plexus-containers/plexus-container-default/apidocs/org/codehaus/plexus/logging/Logger.html}Logger}}. + + Starting with Maven 3.1.0, instead of implementing the API itself, + Maven maps to {{{http://slf4j.org/apidocs/}SLF4J API}}'s {{{http://slf4j.org/apidocs/org/slf4j/ILoggerFactory.html}ILoggerFactory}} + / {{{http://slf4j.org/apidocs/org/slf4j/Logger.html}Logger}} through + {{{./apidocs/org/apache/maven/cli/logging/Slf4jLoggerManager.html}Slf4jLoggerManager}} + / {{{./apidocs/org/apache/maven/cli/logging/Slf4jLogger.html}Slf4jLogger}}. + +* Getting Logger Instance + + Plexus Logger can be injected in Plexus component using Plexus annotations + ++------ +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.component.annotations.Component; +import org.codehaus.plexus.component.annotations.Requirement; + +@Component( role = MyComponent.class ) +public class DefaultMyComponent + implements MyComponent +{ + @Requirement + private Logger logger; +} ++------