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 17:25:22 UTC

[maven-doxia-sitetools] branch master updated: [DOXIASITETOOLS-240] Upgrade to Doxia 2.0.0-M1

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 36750ba  [DOXIASITETOOLS-240] Upgrade to Doxia 2.0.0-M1
36750ba is described below

commit 36750ba9faf235c12fafe5d27d6494cbc8b954c4
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Jan 22 18:24:40 2022 +0100

    [DOXIASITETOOLS-240] Upgrade to Doxia 2.0.0-M1
---
 doxia-integration-tools/pom.xml                    |   6 -
 .../apache/maven/doxia/tools/MojoLogWrapper.java   | 159 ---------------------
 doxia-site-renderer/pom.xml                        |  27 ++--
 .../doxia/siterenderer/DefaultSiteRenderer.java    |   4 +-
 .../doxia/siterenderer/sink/SiteRendererSink.java  |   4 +-
 .../siterenderer/DefaultSiteRendererTest.java      |  19 ---
 pom.xml                                            |  22 +--
 7 files changed, 21 insertions(+), 220 deletions(-)

diff --git a/doxia-integration-tools/pom.xml b/doxia-integration-tools/pom.xml
index 4f8499b..adc18f1 100644
--- a/doxia-integration-tools/pom.xml
+++ b/doxia-integration-tools/pom.xml
@@ -79,12 +79,6 @@
       <version>${mavenVersion}</version>
     </dependency>
 
-    <!-- doxia -->
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-logging-api</artifactId>
-    </dependency>
-
     <!-- doxia-sitetools -->
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
diff --git a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/MojoLogWrapper.java b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/MojoLogWrapper.java
deleted file mode 100644
index ad8b289..0000000
--- a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/MojoLogWrapper.java
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.apache.maven.doxia.tools;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.doxia.logging.Log;
-
-/**
- * Wrap a Mojo logger into a Doxia logger.
- *
- * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
- * @since 1.1
- * @see org.apache.maven.plugin.logging.Log
- */
-public class MojoLogWrapper
-    implements Log
-{
-    private final org.apache.maven.plugin.logging.Log mojoLog;
-
-    /**
-     * @param log a Mojo log
-     */
-    public MojoLogWrapper( org.apache.maven.plugin.logging.Log log )
-    {
-        this.mojoLog = log;
-    }
-
-    /** {@inheritDoc} */
-    public void setLogLevel( int level )
-    {
-        // nop
-    }
-
-    /** {@inheritDoc} */
-    public void debug( CharSequence content )
-    {
-        mojoLog.debug( toString( content ) );
-    }
-
-    /** {@inheritDoc} */
-    public void debug( CharSequence content, Throwable error )
-    {
-        mojoLog.debug( toString( content ), error );
-    }
-
-    /** {@inheritDoc} */
-    public void debug( Throwable error )
-    {
-        mojoLog.debug( "", error );
-    }
-
-    /** {@inheritDoc} */
-    public void info( CharSequence content )
-    {
-        mojoLog.info( toString( content ) );
-    }
-
-    /** {@inheritDoc} */
-    public void info( CharSequence content, Throwable error )
-    {
-        mojoLog.info( toString( content ), error );
-    }
-
-    /** {@inheritDoc} */
-    public void info( Throwable error )
-    {
-        mojoLog.info( "", error );
-    }
-
-    /** {@inheritDoc} */
-    public void warn( CharSequence content )
-    {
-        mojoLog.warn( toString( content ) );
-    }
-
-    /** {@inheritDoc} */
-    public void warn( CharSequence content, Throwable error )
-    {
-        mojoLog.warn( toString( content ), error );
-    }
-
-    /** {@inheritDoc} */
-    public void warn( Throwable error )
-    {
-        mojoLog.warn( "", error );
-    }
-
-    /** {@inheritDoc} */
-    public void error( CharSequence content )
-    {
-        mojoLog.error( toString( content ) );
-    }
-
-    /** {@inheritDoc} */
-    public void error( CharSequence content, Throwable error )
-    {
-        mojoLog.error( toString( content ), error );
-    }
-
-    /** {@inheritDoc} */
-    public void error( Throwable error )
-    {
-        mojoLog.error( "", error );
-    }
-
-    /** {@inheritDoc} */
-    public boolean isDebugEnabled()
-    {
-        return mojoLog.isDebugEnabled();
-    }
-
-    /** {@inheritDoc} */
-    public boolean isInfoEnabled()
-    {
-        return mojoLog.isInfoEnabled();
-    }
-
-    /** {@inheritDoc} */
-    public boolean isWarnEnabled()
-    {
-        return mojoLog.isWarnEnabled();
-    }
-
-    /** {@inheritDoc} */
-    public boolean isErrorEnabled()
-    {
-        return mojoLog.isErrorEnabled();
-    }
-
-    // ----------------------------------------------------------------------
-    // Private methods
-    // ----------------------------------------------------------------------
-
-    private String toString( CharSequence content )
-    {
-        if ( content == null )
-        {
-            return "";
-        }
-
-        return content.toString();
-    }
-}
diff --git a/doxia-site-renderer/pom.xml b/doxia-site-renderer/pom.xml
index a4aaff8..f2ee0e4 100644
--- a/doxia-site-renderer/pom.xml
+++ b/doxia-site-renderer/pom.xml
@@ -49,10 +49,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-logging-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-sink-api</artifactId>
     </dependency>
     <dependency>
@@ -72,16 +68,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-confluence</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
-      <artifactId>doxia-module-docbook-simple</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-xdoc</artifactId>
       <scope>test</scope>
     </dependency>
@@ -176,6 +162,19 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
+      <classifier>no_aop</classifier>
+      <version>4.2.2</version>
+      <scope>test</scope>
+    </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-classworlds</artifactId>
+        <version>2.6.0</version>
+        <scope>test</scope>
+      </dependency>
+    <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <scope>test</scope>
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 d5dddc6..ea40df3 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
@@ -62,7 +62,6 @@ import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
 import org.apache.maven.artifact.versioning.Restriction;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.doxia.Doxia;
-import org.apache.maven.doxia.logging.PlexusLoggerWrapper;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
@@ -430,7 +429,6 @@ public class DefaultSiteRenderer
                         reader = ReaderFactory.newReader( doc, siteContext.getInputEncoding() );
                 }
             }
-            sink.enableLogging( new PlexusLoggerWrapper( getLogger() ) );
 
             doxia.parse( reader, docRenderingContext.getParserId(), sink, docRenderingContext.getInputName() );
         }
@@ -1138,7 +1136,7 @@ public class DefaultSiteRenderer
         {
             String content = IOUtil.toString( new BufferedReader( source ) );
 
-            new XmlValidator( new PlexusLoggerWrapper( getLogger() ) ).validate( content );
+            new XmlValidator( ).validate( content );
 
             return new StringReader( content );
         }
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.java
index 91a349b..7097052 100644
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.java
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.java
@@ -40,14 +40,14 @@ import org.codehaus.plexus.util.StringUtils;
 /**
  * Sink for site rendering of a document, to allow later merge document's output with a template.
  * During raw Doxia rendering, content is stored in multiple fields for later use when incorporating
- * into skin or template: title, date, authors, head, body 
+ * into skin or template: title, date, authors, head, body
  *
  * @author <a href="mailto:evenisse@codehaus.org">Emmanuel Venisse</a>
  */
 @SuppressWarnings( "checkstyle:methodname" )
 public class SiteRendererSink
     extends Xhtml5Sink
-    implements Sink, org.codehaus.doxia.sink.Sink, DocumentContent
+    implements Sink, DocumentContent
 {
     private String date = "";
 
diff --git a/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java b/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
index c72d90e..755e27e 100644
--- a/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
+++ b/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
@@ -258,7 +258,6 @@ public class DefaultSiteRendererTest
         verifyFaqPage();
         verifyAttributes();
         verifyMisc();
-        verifyDocbookPageExists();
         verifyApt();
         verifyExtensionInFilename();
         verifyNewlines();
@@ -519,17 +518,6 @@ public class DefaultSiteRendererTest
     /**
      * @throws Exception if something goes wrong.
      */
-    public void verifyDocbookPageExists()
-        throws Exception
-    {
-        File output = getTestFile( "target/output/docbook.html" );
-        assertNotNull( output );
-        assertTrue( output.exists() );
-    }
-
-    /**
-     * @throws Exception if something goes wrong.
-     */
     public void verifyApt()
         throws Exception
     {
@@ -561,13 +549,6 @@ public class DefaultSiteRendererTest
         checkNewlines( FileUtils.fileRead( getTestFile( "target/output/apt.html" ), "ISO-8859-1" ) );
         checkNewlines( FileUtils.fileRead( getTestFile( "target/output/cdc.html" ), "ISO-8859-1" ) );
         checkNewlines( FileUtils.fileRead( getTestFile( "target/output/interpolation.html" ), "ISO-8859-1" ) );
-        /* confluence */
-        checkNewlines( FileUtils.fileRead( getTestFile( "target/output/confluence/anchor.html" ), "ISO-8859-1" ) );
-        checkNewlines( FileUtils.fileRead( getTestFile( "target/output/confluence/code.html" ), "ISO-8859-1" ) );
-        checkNewlines( FileUtils.fileRead( getTestFile( "target/output/confluence/table.html" ), "ISO-8859-1" ) );
-        /* docbook */
-        checkNewlines( FileUtils.fileRead( getTestFile( "target/output/docbook.html" ), "ISO-8859-1" ) );
-        checkNewlines( FileUtils.fileRead( getTestFile( "target/output/sdocbook_full.html" ), "ISO-8859-1" ) );
         /* fml */
         checkNewlines( FileUtils.fileRead( getTestFile( "target/output/faq.html" ), "ISO-8859-1" ) );
         /* xdoc */
diff --git a/pom.xml b/pom.xml
index f3f1984..9747604 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,7 +68,7 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <doxiaVersion>1.11.1</doxiaVersion>
+    <doxiaVersion>2.0.0-M1</doxiaVersion>
     <maven.site.path>doxia-sitetools-archives/doxia-sitetools-LATEST</maven.site.path>
     <project.build.outputTimestamp>2021-12-12T17:08:52Z</project.build.outputTimestamp>
   </properties>
@@ -78,11 +78,6 @@ under the License.
       <!-- doxia -->
       <dependency>
         <groupId>org.apache.maven.doxia</groupId>
-        <artifactId>doxia-logging-api</artifactId>
-        <version>${doxiaVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.doxia</groupId>
         <artifactId>doxia-sink-api</artifactId>
         <version>${doxiaVersion}</version>
       </dependency>
@@ -98,16 +93,6 @@ under the License.
       </dependency>
       <dependency>
         <groupId>org.apache.maven.doxia</groupId>
-        <artifactId>doxia-module-confluence</artifactId>
-        <version>${doxiaVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.doxia</groupId>
-        <artifactId>doxia-module-docbook-simple</artifactId>
-        <version>${doxiaVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.doxia</groupId>
         <artifactId>doxia-module-fml</artifactId>
         <version>${doxiaVersion}</version>
       </dependency>
@@ -204,6 +189,7 @@ under the License.
     <pluginManagement>
       <plugins>
         <!-- TODO need to upgrade to last version or Maven parent version -->
+        <!--
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>clirr-maven-plugin</artifactId>
@@ -211,6 +197,7 @@ under the License.
             <comparisonVersion>1.9</comparisonVersion>
           </configuration>
         </plugin>
+         -->
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-site-plugin</artifactId>
@@ -263,6 +250,7 @@ under the License.
           </execution>
         </executions>
       </plugin>
+      <!--
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>clirr-maven-plugin</artifactId>
@@ -278,7 +266,7 @@ under the License.
             </configuration>
           </execution>
         </executions>
-      </plugin>
+      </plugin> -->
     </plugins>
   </build>