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

slachiewicz pushed a commit to branch DOXIATOOLS-73
in repository https://gitbox.apache.org/repos/asf/maven-doxia-converter.git

commit 70b7f604df5fa5c675685cffbc93e5d961cd39d8
Author: Sylwester Lachiewicz <slachiew...@apache.org>
AuthorDate: Sat Aug 20 21:36:13 2022 +0200

    [DOXIATOOLS-73] Drop support for Converting Confluence documents
---
 pom.xml                                            |  5 --
 .../org/apache/maven/doxia/DefaultConverter.java   | 13 +--
 src/main/resources/META-INF/plexus/components.xml  | 14 ----
 src/site/apt/index.apt                             |  4 +-
 src/site/apt/usage.apt.vm                          |  4 +-
 .../java/org/apache/maven/doxia/ConverterTest.java | 75 -----------------
 src/test/resources/unit/Doxia.htm                  |  2 +-
 src/test/resources/unit/confluence/test.confluence | 98 ----------------------
 8 files changed, 7 insertions(+), 208 deletions(-)

diff --git a/pom.xml b/pom.xml
index 66d3e13..e0d49e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,11 +99,6 @@ under the License.
       <artifactId>doxia-module-apt</artifactId>
       <version>${doxiaVersion}</version>
     </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>
diff --git a/src/main/java/org/apache/maven/doxia/DefaultConverter.java 
b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
index e6b7223..e7881e7 100644
--- a/src/main/java/org/apache/maven/doxia/DefaultConverter.java
+++ b/src/main/java/org/apache/maven/doxia/DefaultConverter.java
@@ -80,8 +80,6 @@ public class DefaultConverter
 {
     private static final String APT_PARSER = "apt";
 
-    private static final String CONFLUENCE_PARSER = "confluence";
-
     private static final String DOCBOOK_PARSER = "docbook";
 
     private static final String FML_PARSER = "fml";
@@ -96,13 +94,11 @@ public class DefaultConverter
 
     /** Supported input format, i.e. supported Doxia parser */
     public static final String[] SUPPORTED_FROM_FORMAT =
-        { APT_PARSER, CONFLUENCE_PARSER, DOCBOOK_PARSER, FML_PARSER, 
TWIKI_PARSER, XDOC_PARSER, XHTML_PARSER,
+        { APT_PARSER, DOCBOOK_PARSER, FML_PARSER, TWIKI_PARSER, XDOC_PARSER, 
XHTML_PARSER,
                 XHTML5_PARSER};
 
     private static final String APT_SINK = "apt";
 
-    private static final String CONFLUENCE_SINK = "confluence";
-
     private static final String DOCBOOK_SINK = "docbook";
 
     private static final String FO_SINK = "fo";
@@ -123,7 +119,7 @@ public class DefaultConverter
 
     /** Supported output format, i.e. supported Doxia Sink */
     public static final String[] SUPPORTED_TO_FORMAT =
-        { APT_SINK, CONFLUENCE_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, 
LATEX_SINK, RTF_SINK, TWIKI_SINK, XDOC_SINK,
+        { APT_SINK, DOCBOOK_SINK, FO_SINK, ITEXT_SINK, LATEX_SINK, RTF_SINK, 
TWIKI_SINK, XDOC_SINK,
             XHTML_SINK, XHTML5_SINK };
 
     /** Flag to format the generated files, actually only for XML based sinks. 
*/
@@ -593,11 +589,6 @@ public class DefaultConverter
             {
                 return supportedFromFormat;
             }
-            else if ( CONFLUENCE_PARSER.equalsIgnoreCase( supportedFromFormat 
) && isDoxiaFileName( f,
-                    supportedFromFormat ) )
-            {
-                return supportedFromFormat;
-            }
             else if ( TWIKI_PARSER.equalsIgnoreCase( supportedFromFormat ) && 
isDoxiaFileName( f,
                     supportedFromFormat ) )
             {
diff --git a/src/main/resources/META-INF/plexus/components.xml 
b/src/main/resources/META-INF/plexus/components.xml
index a843948..d217761 100644
--- a/src/main/resources/META-INF/plexus/components.xml
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -92,20 +92,6 @@
       <description>APT implementation of the Sink factory.</description>
     </component>
 
-    <!-- Doxia confluence -->
-    <component>
-      <role>org.apache.maven.doxia.parser.Parser</role>
-      <role-hint>confluence</role-hint>
-      
<implementation>org.apache.maven.doxia.module.confluence.ConfluenceParser</implementation>
-      <description>Parse the &lt;a href=&quot;http://www.</description>
-    </component>
-    <component>
-      <role>org.apache.maven.doxia.sink.SinkFactory</role>
-      <role-hint>confluence</role-hint>
-      
<implementation>org.apache.maven.doxia.module.confluence.ConfluenceSinkFactory</implementation>
-      <description>Confluence implementation of the Sink factory.</description>
-    </component>
-
     <!-- Doxia docbook -->
     <component>
       <role>org.apache.maven.doxia.parser.Parser</role>
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index dd9aeae..54d3d6b 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -33,9 +33,9 @@ Doxia Converter
 
   Currently, the supported Doxia formats are:
 
-    * input format: apt, confluence, docbook, fml, twiki, xdoc, xhtml, xhtml5 
or autodetect
+    * input format: apt, docbook, fml, twiki, xdoc, xhtml, xhtml5 or autodetect
 
-    * output format: apt, confluence, docbook, fo, itext, latex, rtf, twiki, 
xdoc, xhtml, xhtml5
+    * output format: apt, docbook, fo, itext, latex, rtf, twiki, xdoc, xhtml, 
xhtml5
 
     []
 
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
index 1153e78..1c7286c 100644
--- a/src/site/apt/usage.apt.vm
+++ b/src/site/apt/usage.apt.vm
@@ -54,8 +54,8 @@ Options:
 -X,--debug            Produce execution debug output.
 
 Supported Formats:
-from: apt, confluence, docbook, fml, twiki, xdoc, xhtml, xhtml5 or autodetect
-to:   apt, confluence, docbook, fo, itext, latex, rtf, twiki, xdoc, xhtml, 
xhtml5
+from: apt, docbook, fml, twiki, xdoc, xhtml, xhtml5 or autodetect
+to:   apt, docbook, fo, itext, latex, rtf, twiki, xdoc, xhtml, xhtml5
 
 Supported Encoding:
 UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, Shift_JIS, ISO-2022-JP, 
ISO-2022-CN, ISO-2022-KR, GB18030, EUC-JP, EUC-KR, Big5,
diff --git a/src/test/java/org/apache/maven/doxia/ConverterTest.java 
b/src/test/java/org/apache/maven/doxia/ConverterTest.java
index fc380f0..c642070 100644
--- a/src/test/java/org/apache/maven/doxia/ConverterTest.java
+++ b/src/test/java/org/apache/maven/doxia/ConverterTest.java
@@ -179,42 +179,6 @@ public class ConverterTest
         assertTrue( new File( out ).length() != 0 );
     }
 
-    /**
-     * Input confluence file / output file
-     *
-     * @see Converter#convert(InputFileWrapper, OutputFileWrapper)
-     * @throws Exception if any
-     */
-    public void testConfluenceFileConverter()
-        throws Exception
-    {
-        String in = getBasedir() + 
"/src/test/resources/unit/confluence/test.confluence";
-        String from = "confluence";
-        String out = getBasedir() + 
"/target/unit/file/confluence/test.confluence.xhtml";
-        String to = "xhtml";
-
-        InputFileWrapper input =
-            InputFileWrapper.valueOf( in, from, ReaderFactory.UTF_8, 
converter.getInputFormats() );
-        OutputFileWrapper output =
-            OutputFileWrapper.valueOf( out, to, WriterFactory.UTF_8, 
converter.getOutputFormats() );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-        assertTrue( new File( out ).exists() );
-        assertTrue( new File( out ).length() != 0 );
-
-        in = getBasedir() + 
"/target/unit/file/confluence/test.confluence.xhtml";
-        from = "xhtml";
-        out = getBasedir() + "/target/unit/file/confluence/test.confluence";
-        to = "confluence";
-
-        input = InputFileWrapper.valueOf( in, from, ReaderFactory.UTF_8, 
converter.getInputFormats() );
-        output = OutputFileWrapper.valueOf( out, to, WriterFactory.UTF_8, 
converter.getOutputFormats() );
-
-        converter.setFormatOutput( formatOutput );
-        converter.convert( input, output );
-    }
-
     /**
      * Input docbook file / output file
      *
@@ -494,43 +458,6 @@ public class ConverterTest
         assertTrue( outFile.length() != 0 );
     }
 
-    /**
-     * Input confluence reader / output writer
-     *
-     * @see Converter#convert(InputReaderWrapper, OutputStreamWrapper)
-     * @throws Exception if any
-     */
-    public void testConfluenceWriterConverter()
-        throws Exception
-    {
-        String in = getBasedir() + 
"/src/test/resources/unit/confluence/test.confluence";
-        String from = "confluence";
-        String out = getBasedir() + 
"/target/unit/writer/confluence/test.confluence.xhtml";
-        String to = "xhtml";
-
-        File inFile = new File( in );
-        File outFile = new File( out );
-        outFile.getParentFile().mkdirs();
-
-        try ( OutputStream fo = new FileOutputStream( outFile ) )
-        {
-            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
-            InputReaderWrapper input = InputReaderWrapper.valueOf( new 
FileReader( inFile ), from,
-                    converter.getInputFormats() );
-            OutputStreamWrapper output = OutputStreamWrapper.valueOf( 
outputStream, to, "UTF-8",
-                    converter.getOutputFormats() );
-
-            converter.setFormatOutput( formatOutput );
-            converter.convert( input, output );
-
-            IOUtil.copy( outputStream.toByteArray(), fo );
-        }
-
-        assertTrue( outFile.exists() );
-        assertTrue( outFile.length() != 0 );
-    }
-
     /**
      * Input xdoc (autodetect) reader / output writer
      *
@@ -662,7 +589,6 @@ public class ConverterTest
     public void testAutodetectEncoding()
     {
         assertEquals( "ISO-8859-1", autoDetectEncoding( "apt/test.apt" ) );
-        assertEquals( "ISO-8859-1", autoDetectEncoding( 
"confluence/test.confluence" ) );
         assertEquals( "UTF-8", autoDetectEncoding( "docbook/test.xml" ) );
         assertEquals( "UTF-8", autoDetectEncoding( "fml/test.fml" ) ); // 
plexus-utils should detect ISO-8859-1
         assertEquals( "ISO-8859-1", autoDetectEncoding( "twiki/test.twiki" ) );
@@ -697,7 +623,6 @@ public class ConverterTest
             assertTrue( true );
         }
 
-        assertEquals( autoDetectFormat( "confluence/test.confluence", "UTF-8" 
), "confluence" );
         assertEquals( autoDetectFormat( "docbook/test.xml", "UTF-8" ), 
"docbook" );
         assertEquals( autoDetectFormat( "fml/test.fml", "UTF-8" ), "fml" );
         assertEquals( autoDetectFormat( "twiki/test.twiki", "UTF-8" ), "twiki" 
);
diff --git a/src/test/resources/unit/Doxia.htm 
b/src/test/resources/unit/Doxia.htm
index 626c32e..6d26ae2 100644
--- a/src/test/resources/unit/Doxia.htm
+++ b/src/test/resources/unit/Doxia.htm
@@ -56,7 +56,7 @@ Vincent Siveton"/>
             <ul>
               <li>Developed in Java</li>
 
-              <li>Support of several markup formats: APT (Almost Plain Text), 
Confluence, DocBook,
+              <li>Support of several markup formats: APT (Almost Plain Text), 
DocBook,
                 FML (FAQ Markup Language), LaTeX, RTF, TWiki, XDoc (popular in 
Apache land), XHTML</li>
               <li>Easy to learn the syntax of the supported markup formats</li>
               <li>Macro support</li>
diff --git a/src/test/resources/unit/confluence/test.confluence 
b/src/test/resources/unit/confluence/test.confluence
deleted file mode 100644
index 71d3d10..0000000
--- a/src/test/resources/unit/confluence/test.confluence
+++ /dev/null
@@ -1,98 +0,0 @@
-This the way that we would like to *translate* sites that are primarily
-authored in confluence while at the same time having the site be rendered in
-a _standard way on a static website_.
-
-----
-
-Here is a link to [JIRA|http://jira.codehaus.org]
-
-Here is a link with no text [http://jira.codehaus.org]
-
-This is some {{monospaced}} text.
-
-* item one
-** foo
-** bar
-* item two
-* item three
-
-Some more text
-
-# number one
-# number two
-# number three
-
-||one||two||three||
-|foo|bar|baz|
-
-h1. I am h1
-
-this is how you would code a mojo!
-
-{code}
-public class MyMojo
-    extends AbstractMojo
-{
-    /**
-     * @parameter expression="${plugin.artifacts}"
-     * @required
-     */
-    private List pluginArtifacts;
-
-    public void execute()
-        throws MojoExecutionException
-    {
-        ...
-        for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); )
-        {
-            Artifact pluginArtifact = (Artifact) i.next();
-        }
-        ...
-    }
-}
-{code}
-
-h2. I am h2
-
-this is the way of the world
-
-{noformat}
-public class MyMojo
-    extends AbstractMojo
-{
-    /**
-     * @parameter expression="${plugin.artifacts}"
-     * @required
-     */
-    private List pluginArtifacts;
-
-    public void execute()
-        throws MojoExecutionException
-    {
-        ...
-        for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); )
-        {
-            Artifact pluginArtifact = (Artifact) i.next();
-        }
-        ...
-    }
-}
-{noformat}
-
-h3. I am h3
-
-this is the way of the world
-
-h4. I am h4
-
-this is the way of the world
-
-h5. I am h5
-
-this is the way of the world
-
-h1. Answered Questions
-
-h3. What can I do to get the Maven love?
-
-Well, you just have to be calm and the maven love will come your way.

Reply via email to