You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/01/22 18:00:55 UTC

[maven-doxia-sitetools] 01/01: [DOXIASITETOOLS-241] Replace Plexus Container Default with Sisu Plexus Shim

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch DOXIASITETOOLS-241
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git

commit 7979f861901de9f31df3b1fb5d55d799cff1a98b
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Jan 22 18:55:14 2022 +0100

    [DOXIASITETOOLS-241] Replace Plexus Container Default with Sisu Plexus
    Shim
    
    This closes #23
---
 doxia-integration-tools/pom.xml                    | 15 +++-
 .../apache/maven/doxia/tools/DefaultSiteTool.java  | 90 +++++++++++-----------
 .../maven/doxia/tools/DefaultSiteToolTest.java     | 14 +---
 doxia-site-renderer/pom.xml                        | 21 ++++-
 .../doxia/siterenderer/DefaultSiteRenderer.java    | 42 +++++-----
 pom.xml                                            | 27 ++++++-
 6 files changed, 125 insertions(+), 84 deletions(-)

diff --git a/doxia-integration-tools/pom.xml b/doxia-integration-tools/pom.xml
index adc18f1..86dc10e 100644
--- a/doxia-integration-tools/pom.xml
+++ b/doxia-integration-tools/pom.xml
@@ -46,6 +46,11 @@
     </dependency>
 
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
+    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
@@ -87,9 +92,8 @@
 
     <!-- Plexus -->
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
-      <version>1.0-alpha-9</version>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -122,6 +126,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
       <version>1.1</version>
diff --git a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
index f7cea88..89772d2 100644
--- a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
+++ b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
@@ -64,7 +64,6 @@ import org.apache.maven.reporting.MavenReport;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
@@ -76,6 +75,8 @@ import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
 import org.codehaus.plexus.interpolation.PrefixedPropertiesValueSource;
 import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Default implementation of the site tool.
@@ -84,9 +85,10 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  */
 @Component( role = SiteTool.class )
 public class DefaultSiteTool
-    extends AbstractLogEnabled
     implements SiteTool
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger( DefaultSiteTool.class );
+
     // ----------------------------------------------------------------------
     // Components
     // ----------------------------------------------------------------------
@@ -182,7 +184,7 @@ public class DefaultSiteTool
 
     /**
      * This method is not implemented according to the URI specification and has many weird
-     * corner cases where it doesn't do the right thing. Please consider using a better 
+     * corner cases where it doesn't do the right thing. Please consider using a better
      * implemented method from a different library such as org.apache.http.client.utils.URIUtils#resolve.
      */
     @Deprecated
@@ -190,17 +192,17 @@ public class DefaultSiteTool
     {
         checkNotNull( "to", to );
         checkNotNull( "from", from );
-        
+
         if ( to.contains( ":" ) && from.contains( ":" ) )
         {
             String toScheme = to.substring( 0, to.lastIndexOf( ':' ) );
             String fromScheme = from.substring( 0, from.lastIndexOf( ':' ) );
-            if ( !toScheme.equals( fromScheme ) ) 
+            if ( !toScheme.equals( fromScheme ) )
             {
-                return to; 
+                return to;
             }
         }
-        
+
         URL toUrl = null;
         URL fromUrl = null;
 
@@ -219,7 +221,7 @@ public class DefaultSiteTool
             }
             catch ( MalformedURLException e1 )
             {
-                getLogger().warn( "Unable to load a URL for '" + to + "': " + e.getMessage() );
+                LOGGER.warn( "Unable to load a URL for '" + to + "': " + e.getMessage() );
                 return to;
             }
         }
@@ -236,7 +238,7 @@ public class DefaultSiteTool
             }
             catch ( MalformedURLException e1 )
             {
-                getLogger().warn( "Unable to load a URL for '" + from + "': " + e.getMessage() );
+                LOGGER.warn( "Unable to load a URL for '" + from + "': " + e.getMessage() );
                 return to;
             }
         }
@@ -279,9 +281,9 @@ public class DefaultSiteTool
             relativePath = to;
         }
 
-        if ( getLogger().isDebugEnabled() && !relativePath.toString().equals( to ) )
+        if ( LOGGER.isDebugEnabled() && !relativePath.toString().equals( to ) )
         {
-            getLogger().debug( "Mapped url: " + to + " to relative path: " + relativePath );
+            LOGGER.debug( "Mapped url: " + to + " to relative path: " + relativePath );
         }
 
         return relativePath;
@@ -385,7 +387,7 @@ public class DefaultSiteTool
         }
         catch ( ArtifactNotFoundException e )
         {
-            getLogger().debug( "ArtifactNotFoundException: Unable to locate site descriptor: " + e );
+            LOGGER.debug( "ArtifactNotFoundException: Unable to locate site descriptor: " + e );
             return null;
         }
         catch ( ArtifactResolutionException e )
@@ -404,7 +406,7 @@ public class DefaultSiteTool
      * <code>${parentProject}</code> and <code>${modules}</code> tags.
      *
      * @param reader
-     * @return the input content interpolated with deprecated tags 
+     * @return the input content interpolated with deprecated tags
      * @throws IOException
      */
     private String readSiteDescriptor( Reader reader, String projectId )
@@ -423,19 +425,19 @@ public class DefaultSiteTool
         {
             if ( siteDescriptorContent.contains( "$" + prop ) )
             {
-                getLogger().warn( "Site descriptor for " + projectId + " contains $" + prop
+                LOGGER.warn( "Site descriptor for " + projectId + " contains $" + prop
                     + ": should be replaced with " + props.getProperty( (String) prop ) );
             }
             if ( siteDescriptorContent.contains( "${" + prop + "}" ) )
             {
-                getLogger().warn( "Site descriptor for " + projectId + " contains ${" + prop
+                LOGGER.warn( "Site descriptor for " + projectId + " contains ${" + prop
                     + "}: should be replaced with " + props.getProperty( (String) prop ) );
             }
         }
 
         return StringUtils.interpolate( siteDescriptorContent, props );
     }
-    
+
     /** {@inheritDoc} */
     public DecorationModel getDecorationModel( File siteDirectory, Locale locale, MavenProject project,
                                                List<MavenProject> reactorProjects, ArtifactRepository localRepository,
@@ -449,7 +451,7 @@ public class DefaultSiteTool
 
         final Locale llocale = ( locale == null ) ? Locale.getDefault() : locale;
 
-        getLogger().debug( "Computing decoration model of " + project.getId() + " for locale " + llocale );
+        LOGGER.debug( "Computing decoration model of " + project.getId() + " for locale " + llocale );
 
         Map.Entry<DecorationModel, MavenProject> result =
             getDecorationModel( 0, siteDirectory, llocale, project, reactorProjects, localRepository, repositories );
@@ -458,7 +460,7 @@ public class DefaultSiteTool
 
         if ( decorationModel == null )
         {
-            getLogger().debug( "Using default site descriptor" );
+            LOGGER.debug( "Using default site descriptor" );
 
             String siteDescriptorContent;
 
@@ -594,7 +596,7 @@ public class DefaultSiteTool
                 {
                     parentProject = reactorProject;
 
-                    getLogger().debug( "Parent project " + origParent.getId() + " picked from reactor" );
+                    LOGGER.debug( "Parent project " + origParent.getId() + " picked from reactor" );
                     break;
                 }
             }
@@ -624,14 +626,14 @@ public class DefaultSiteTool
                         {
                             parentProject = mavenProject;
 
-                            getLogger().debug( "Parent project " + origParent.getId() + " loaded from a relative path: "
+                            LOGGER.debug( "Parent project " + origParent.getId() + " loaded from a relative path: "
                                 + relativePath );
                         }
                     }
                 }
                 catch ( ProjectBuildingException e )
                 {
-                    getLogger().info( "Unable to load parent project " + origParent.getId() + " from a relative path: "
+                    LOGGER.info( "Unable to load parent project " + origParent.getId() + " from a relative path: "
                         + e.getMessage() );
                 }
             }
@@ -643,11 +645,11 @@ public class DefaultSiteTool
                     parentProject = mavenProjectBuilder.buildFromRepository( aProject.getParentArtifact(), aProject
                         .getRemoteArtifactRepositories(), localRepository );
 
-                    getLogger().debug( "Parent project " + origParent.getId() + " loaded from repository" );
+                    LOGGER.debug( "Parent project " + origParent.getId() + " loaded from repository" );
                 }
                 catch ( ProjectBuildingException e )
                 {
-                    getLogger().warn( "Unable to load parent project " + origParent.getId() + " from repository: "
+                    LOGGER.warn( "Unable to load parent project " + origParent.getId() + " from repository: "
                         + e.getMessage() );
                 }
             }
@@ -658,7 +660,7 @@ public class DefaultSiteTool
 
                 parentProject = origParent;
 
-                getLogger().debug( "Parent project " + origParent.getId() + " picked from original value" );
+                LOGGER.debug( "Parent project " + origParent.getId() + " picked from original value" );
             }
         }
         return parentProject;
@@ -727,7 +729,7 @@ public class DefaultSiteTool
         // Only add the parent menu if we were able to find a URL for it
         if ( parentUrl == null )
         {
-            getLogger().warn( "Unable to find a URL to the parent project. The parent menu will NOT be added." );
+            LOGGER.warn( "Unable to find a URL to the parent project. The parent menu will NOT be added." );
         }
         else
         {
@@ -754,7 +756,7 @@ public class DefaultSiteTool
      * @param localRepository the Maven local repository, not null.
      * @param keepInheritedRefs used for inherited references.
      * @throws SiteToolException if any
-     * @throws IOException 
+     * @throws IOException
      */
     private void populateModulesMenu( DecorationModel decorationModel, Locale locale, MavenProject project,
                                      List<MavenProject> reactorProjects, ArtifactRepository localRepository,
@@ -794,7 +796,7 @@ public class DefaultSiteTool
 
                 if ( moduleProject == null )
                 {
-                    getLogger().warn( "Module " + module
+                    LOGGER.warn( "Module " + module
                         + " not found in reactor: loading locally" );
 
                     File f = new File( project.getBasedir(), module + "/pom.xml" );
@@ -811,8 +813,8 @@ public class DefaultSiteTool
                     }
                     else
                     {
-                        getLogger().warn( "No filesystem module-POM available" );
-    
+                        LOGGER.warn( "No filesystem module-POM available" );
+
                         moduleProject = new MavenProject();
                         moduleProject.setName( module );
                         moduleProject.setDistributionManagement( new DistributionManagement() );
@@ -926,9 +928,9 @@ public class DefaultSiteTool
 
             if ( !Arrays.asList( Locale.getAvailableLocales() ).contains( locale ) )
             {
-                if ( getLogger().isWarnEnabled() )
+                if ( LOGGER.isWarnEnabled() )
                 {
-                    getLogger().warn( "The locale defined by '" + locale
+                    LOGGER.warn( "The locale defined by '" + locale
                         + "' is not available in this Java Virtual Machine ("
                         + System.getProperty( "java.version" )
                         + " from " + System.getProperty( "java.vendor" ) + ") - IGNORING" );
@@ -941,9 +943,9 @@ public class DefaultSiteTool
                 && ( !i18n.getBundle( "site-tool", locale ).getLocale().getLanguage()
                     .equals( locale.getLanguage() ) ) )
             {
-                if ( getLogger().isWarnEnabled() )
+                if ( LOGGER.isWarnEnabled() )
                 {
-                    getLogger().warn( "The locale '" + locale + "' (" + locale.getDisplayName( Locale.ENGLISH )
+                    LOGGER.warn( "The locale '" + locale + "' (" + locale.getDisplayName( Locale.ENGLISH )
                         + ") is not currently supported by Maven Site - IGNORING."
                         + "\nContributions are welcome and greatly appreciated!"
                         + "\nIf you want to contribute a new translation, please visit "
@@ -994,9 +996,9 @@ public class DefaultSiteTool
         final int maxTokens = 3;
         if ( tokenizer.countTokens() > maxTokens )
         {
-            if ( getLogger().isWarnEnabled() )
+            if ( LOGGER.isWarnEnabled() )
             {
-                getLogger().warn( "Invalid java.util.Locale format for '" + localeCode + "' entry - IGNORING" );
+                LOGGER.warn( "Invalid java.util.Locale format for '" + localeCode + "' entry - IGNORING" );
             }
             return null;
         }
@@ -1076,13 +1078,13 @@ public class DefaultSiteTool
             }
             else
             {
-                getLogger().debug( "No site descriptor found for " + project.getId() + " for locale "
+                LOGGER.debug( "No site descriptor found for " + project.getId() + " for locale "
                     + locale.getLanguage() + ", trying without locale..." );
             }
         }
         catch ( ArtifactNotFoundException e )
         {
-            getLogger().debug( "Unable to locate site descriptor for locale " + locale.getLanguage() + ": " + e );
+            LOGGER.debug( "Unable to locate site descriptor for locale " + locale.getLanguage() + ": " + e );
 
             // we can afford to write an empty descriptor here as we don't expect it to turn up later in the remote
             // repository, because the parent was already released (and snapshots are updated automatically if changed)
@@ -1114,7 +1116,7 @@ public class DefaultSiteTool
             // we use zero length files to avoid re-resolution (see below)
             if ( result.length() == 0 )
             {
-                getLogger().debug( "No site descriptor found for " + project.getId() + " without locale." );
+                LOGGER.debug( "No site descriptor found for " + project.getId() + " without locale." );
                 result = null;
             }
         }
@@ -1169,7 +1171,7 @@ public class DefaultSiteTool
         {
             if ( siteDescriptor != null && siteDescriptor.exists() )
             {
-                getLogger().debug( "Reading" + ( depth == 0 ? "" : ( " parent level " + depth ) )
+                LOGGER.debug( "Reading" + ( depth == 0 ? "" : ( " parent level " + depth ) )
                     + " site descriptor from " + siteDescriptor );
 
                 siteDescriptorReader = ReaderFactory.newXmlReader( siteDescriptor );
@@ -1184,7 +1186,7 @@ public class DefaultSiteTool
             }
             else
             {
-                getLogger().debug( "No" + ( depth == 0 ? "" : ( " parent level " + depth ) ) + " site descriptor." );
+                LOGGER.debug( "No" + ( depth == 0 ? "" : ( " parent level " + depth ) ) + " site descriptor." );
             }
         }
         catch ( IOException e )
@@ -1198,13 +1200,13 @@ public class DefaultSiteTool
         }
 
         // 3. look for parent project
-        MavenProject parentProject = getParentProject( project, reactorProjects, localRepository ); 
+        MavenProject parentProject = getParentProject( project, reactorProjects, localRepository );
 
         // 4. merge with parent project DecorationModel
         if ( parentProject != null && ( decoration == null || decoration.isMergeParent() ) )
         {
             depth++;
-            getLogger().debug( "Looking for site descriptor of level " + depth + " parent project: "
+            LOGGER.debug( "Looking for site descriptor of level " + depth + " parent project: "
                 + parentProject.getId() );
 
             File parentSiteDirectory = null;
@@ -1240,9 +1242,9 @@ public class DefaultSiteTool
             // Merge the parent and child DecorationModels
             String projectDistMgmnt = getDistMgmntSiteUrl( project );
             String parentDistMgmnt = getDistMgmntSiteUrl( parentProject );
-            if ( getLogger().isDebugEnabled() )
+            if ( LOGGER.isDebugEnabled() )
             {
-                getLogger().debug( "Site decoration model inheritance: assembling child with level " + depth
+                LOGGER.debug( "Site decoration model inheritance: assembling child with level " + depth
                     + " parent: distributionManagement.site.url child = " + projectDistMgmnt + " and parent = "
                     + parentDistMgmnt );
             }
diff --git a/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/DefaultSiteToolTest.java b/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/DefaultSiteToolTest.java
index 1698e2d..d2fdb36 100644
--- a/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/DefaultSiteToolTest.java
+++ b/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/DefaultSiteToolTest.java
@@ -27,24 +27,14 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 
-import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.logging.console.ConsoleLogger;
-import org.junit.Before;
-
 /**
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
  */
 public class DefaultSiteToolTest
 {
-	
+
     private DefaultSiteTool tool = new DefaultSiteTool();
-    
-    @Before 
-    public void setUp() {
-    	Logger logger =  new ConsoleLogger(Logger.LEVEL_WARN, "tool");
-        tool.enableLogging(logger);
-    }
-	
+
     /**
      * test getNormalizedPath().
      */
diff --git a/doxia-site-renderer/pom.xml b/doxia-site-renderer/pom.xml
index f2ee0e4..6feab55 100644
--- a/doxia-site-renderer/pom.xml
+++ b/doxia-site-renderer/pom.xml
@@ -42,6 +42,11 @@ under the License.
       <version>3.0</version>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
     <!-- doxia -->
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
@@ -95,12 +100,18 @@ under the License.
       <artifactId>plexus-i18n</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-container-default</artifactId>
+      <groupId>org.eclipse.sisu</groupId>
+      <artifactId>org.eclipse.sisu.plexus</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-velocity</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-container-default</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -165,7 +176,6 @@ under the License.
       <groupId>com.google.inject</groupId>
       <artifactId>guice</artifactId>
       <classifier>no_aop</classifier>
-      <version>4.2.2</version>
       <scope>test</scope>
     </dependency>
       <dependency>
@@ -198,6 +208,11 @@ under the License.
       <version>2.28.2</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <profiles>
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
index ea40df3..644eb0c 100644
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
@@ -104,7 +104,6 @@ import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.DirectoryScanner;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
@@ -115,6 +114,8 @@ import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.codehaus.plexus.velocity.VelocityComponent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <p>DefaultSiteRenderer class.</p>
@@ -125,9 +126,10 @@ import org.codehaus.plexus.velocity.VelocityComponent;
  */
 @Component( role = Renderer.class )
 public class DefaultSiteRenderer
-    extends AbstractLogEnabled
     implements Renderer
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger( DefaultSiteRenderer.class );
+
     // ----------------------------------------------------------------------
     // Requirements
     // ----------------------------------------------------------------------
@@ -296,9 +298,9 @@ public class DefaultSiteRenderer
                                 + doc + "' clashes with existing '" + originalDoc + "'." );
                         }
 
-                        if ( getLogger().isWarnEnabled() )
+                        if ( LOGGER.isWarnEnabled() )
                         {
-                            getLogger().warn( "File '" + module.getSourceDirectory() + File.separator + doc
+                            LOGGER.warn( "File '" + module.getSourceDirectory() + File.separator + doc
                                 + "' could clash with existing '" + originalDoc + "'." );
                         }
                     }
@@ -332,9 +334,9 @@ public class DefaultSiteRenderer
                     outputFile.getParentFile().mkdirs();
                 }
 
-                if ( getLogger().isDebugEnabled() )
+                if ( LOGGER.isDebugEnabled() )
                 {
-                    getLogger().debug( "Generating " + outputFile );
+                    LOGGER.debug( "Generating " + outputFile );
                 }
 
                 Writer writer = null;
@@ -353,9 +355,9 @@ public class DefaultSiteRenderer
             }
             else
             {
-                if ( getLogger().isDebugEnabled() )
+                if ( LOGGER.isDebugEnabled() )
                 {
-                    getLogger().debug( inputFile + " unchanged, not regenerating..." );
+                    LOGGER.debug( inputFile + " unchanged, not regenerating..." );
                 }
             }
         }
@@ -381,7 +383,7 @@ public class DefaultSiteRenderer
             // TODO: DOXIA-111: the filter used here must be checked generally.
             if ( docRenderingContext.getAttribute( "velocity" ) != null )
             {
-                getLogger().debug( "Processing Velocity for " + docRenderingContext.getDoxiaSourcePath() );
+                LOGGER.debug( "Processing Velocity for " + docRenderingContext.getDoxiaSourcePath() );
                 try
                 {
                     Context vc = createDocumentVelocityContext( docRenderingContext, siteContext );
@@ -573,7 +575,7 @@ public class DefaultSiteRenderer
             + "maven/org.apache.maven.doxia/doxia-site-renderer/pom.properties" );
         if ( inputStream == null )
         {
-            getLogger().debug( "pom.properties for doxia-site-renderer could not be found." );
+            LOGGER.debug( "pom.properties for doxia-site-renderer could not be found." );
         }
         else
         {
@@ -585,7 +587,7 @@ public class DefaultSiteRenderer
             }
             catch ( IOException e )
             {
-                getLogger().debug( "Failed to load pom.properties, so doxiaVersion is not available"
+                LOGGER.debug( "Failed to load pom.properties, so doxiaVersion is not available"
                         + " in the Velocity context." );
             }
         }
@@ -682,7 +684,7 @@ public class DefaultSiteRenderer
             }
             catch ( java.text.ParseException e )
             {
-                getLogger().warn( "Could not parse date '" + documentDate + "' from "
+                LOGGER.warn( "Could not parse date '" + documentDate + "' from "
                     + content.getRenderingContext().getInputName()
                     + " (expected yyyy-MM-dd format), ignoring!" );
             }
@@ -708,7 +710,7 @@ public class DefaultSiteRenderer
     {
         String templateName = siteRenderingContext.getTemplateName();
 
-        getLogger().debug( "Processing Velocity for template " + templateName + " on "
+        LOGGER.debug( "Processing Velocity for template " + templateName + " on "
             + content.getRenderingContext().getInputName() );
 
         Context context = createSiteTemplateVelocityContext( content, siteRenderingContext );
@@ -884,9 +886,9 @@ public class DefaultSiteRenderer
                 matched = ( compareTo <= 0 );
             }
 
-            if ( getLogger().isDebugEnabled() )
+            if ( LOGGER.isDebugEnabled() )
             {
-                getLogger().debug( "Skin doxia-sitetools prerequisite: " + prerequisite + ", current: " + current
+                LOGGER.debug( "Skin doxia-sitetools prerequisite: " + prerequisite + ", current: " + current
                     + ", matched = " + matched );
             }
 
@@ -1049,16 +1051,16 @@ public class DefaultSiteRenderer
             // Create the subdirectory css if it doesn't exist, DOXIA-151
             File cssDirectory = new File( outputDirectory, "/css/" );
             boolean created = cssDirectory.mkdirs();
-            if ( created && getLogger().isDebugEnabled() )
+            if ( created && LOGGER.isDebugEnabled() )
             {
-                getLogger().debug(
+                LOGGER.debug(
                     "The directory '" + cssDirectory.getAbsolutePath() + "' did not exist. It was created." );
             }
 
             // If the file is not there - create an empty file, DOXIA-86
-            if ( getLogger().isDebugEnabled() )
+            if ( LOGGER.isDebugEnabled() )
             {
-                getLogger().debug(
+                LOGGER.debug(
                     "The file '" + siteCssFile.getAbsolutePath() + "' does not exist. Creating an empty file." );
             }
             Writer writer = null;
@@ -1130,7 +1132,7 @@ public class DefaultSiteRenderer
     private Reader validate( Reader source, String resource )
             throws ParseException, IOException
     {
-        getLogger().debug( "Validating: " + resource );
+        LOGGER.debug( "Validating: " + resource );
 
         try
         {
diff --git a/pom.xml b/pom.xml
index 9747604..fa55bd1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,7 @@ under the License.
 
   <properties>
     <doxiaVersion>2.0.0-M1</doxiaVersion>
+    <slf4jVersion>1.7.32</slf4jVersion>
     <maven.site.path>doxia-sitetools-archives/doxia-sitetools-LATEST</maven.site.path>
     <project.build.outputTimestamp>2021-12-12T17:08:52Z</project.build.outputTimestamp>
   </properties>
@@ -134,9 +135,20 @@ under the License.
       </dependency>
       <!-- Plexus -->
       <dependency>
+        <groupId>org.eclipse.sisu</groupId>
+        <artifactId>org.eclipse.sisu.plexus</artifactId>
+        <version>0.3.5</version>
+      </dependency>
+      <dependency>
+        <groupId>com.google.inject</groupId>
+        <artifactId>guice</artifactId>
+        <version>4.2.2</version>
+        <classifier>no_aop</classifier>
+      </dependency>
+      <dependency>
         <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-container-default</artifactId>
-        <version>1.0-alpha-30</version>
+        <artifactId>plexus-component-annotations</artifactId>
+        <version>2.1.1</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
@@ -159,6 +171,17 @@ under the License.
         <artifactId>plexus-utils</artifactId>
         <version>3.3.0</version>
       </dependency>
+      <!--  SLF4J -->
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>${slf4jVersion}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-simple</artifactId>
+        <version>${slf4jVersion}</version>
+      </dependency>
       <!-- misc -->
       <dependency>
         <groupId>org.apache.velocity</groupId>