From cb844176fe299d60afab09f69896c3de885a922edc38ea67776659a9cb9ff335 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sat, 23 Sep 2023 09:21:13 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-doxia?expand=0&rev=23 --- 0001-Fix-itext-dependency.patch | 245 ------------------------------ 0002-Commons-configuration2.patch | 72 +++++++++ doxia-1.12.0-source-release.zip | 3 + doxia-1.9.1-source-release.zip | 3 - maven-doxia-build.tar.xz | 4 +- maven-doxia.spec | 22 +-- 6 files changed, 85 insertions(+), 264 deletions(-) delete mode 100644 0001-Fix-itext-dependency.patch create mode 100644 0002-Commons-configuration2.patch create mode 100644 doxia-1.12.0-source-release.zip delete mode 100644 doxia-1.9.1-source-release.zip diff --git a/0001-Fix-itext-dependency.patch b/0001-Fix-itext-dependency.patch deleted file mode 100644 index b4c4b00..0000000 --- a/0001-Fix-itext-dependency.patch +++ /dev/null @@ -1,245 +0,0 @@ -From 71a78088dff0081a290a860a184166bf993d04bf Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Mon, 29 Apr 2013 11:37:12 +0200 -Subject: [PATCH 1/4] Fix itext dependency - ---- - doxia-modules/doxia-module-itext/pom.xml | 2 +- - .../apache/maven/doxia/module/itext/ITextFont.java | 16 ++--- - .../apache/maven/doxia/module/itext/ITextSink.java | 6 +- - .../apache/maven/doxia/module/itext/ITextUtil.java | 69 +--------------------- - .../doxia/module/itext/ITextSinkTestCase.java | 22 ------- - 5 files changed, 13 insertions(+), 102 deletions(-) - -diff --git a/doxia-modules/doxia-module-itext/pom.xml b/doxia-modules/doxia-module-itext/pom.xml -index 94f94f3..8293f04 100644 ---- a/doxia-modules/doxia-module-itext/pom.xml -+++ b/doxia-modules/doxia-module-itext/pom.xml -@@ -58,7 +58,7 @@ under the License. - - com.lowagie - itext -- 1.4 -+ 2.1.7 - - - -diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java -index 2cc8ef1..5dfc882 100644 ---- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java -+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextFont.java -@@ -24,7 +24,7 @@ import java.awt.Color; - import com.lowagie.text.ExceptionConverter; - import com.lowagie.text.Font; - import com.lowagie.text.FontFactory; --import com.lowagie.text.markup.MarkupTags; -+import com.lowagie.text.html.Markup; - import com.lowagie.text.pdf.BaseFont; - - /** -@@ -38,16 +38,16 @@ import com.lowagie.text.pdf.BaseFont; - public class ITextFont - { - /** A normal font style */ -- public static final String NORMAL = MarkupTags.CSS_VALUE_NORMAL; -+ public static final String NORMAL = Markup.CSS_VALUE_NORMAL; - - /** A bold font style */ -- public static final String BOLD = MarkupTags.CSS_VALUE_BOLD; -+ public static final String BOLD = Markup.CSS_VALUE_BOLD; - - /** A italic font style */ -- public static final String ITALIC = MarkupTags.CSS_VALUE_ITALIC; -+ public static final String ITALIC = Markup.CSS_VALUE_ITALIC; - - /** An underline font style */ -- public static final String UNDERLINE = MarkupTags.CSS_VALUE_UNDERLINE; -+ public static final String UNDERLINE = Markup.CSS_VALUE_UNDERLINE; - - /** A default font name */ - public static final String DEFAULT_FONT_NAME = FontFactory.HELVETICA; -@@ -262,7 +262,7 @@ public class ITextFont - { - Font font = getCurrentFont(); - -- return String.valueOf( font.color().getBlue() ); -+ return String.valueOf( font.getColor().getBlue() ); - } - - /** -@@ -274,7 +274,7 @@ public class ITextFont - { - Font font = getCurrentFont(); - -- return String.valueOf( font.color().getGreen() ); -+ return String.valueOf( font.getColor().getGreen() ); - } - - /** -@@ -286,7 +286,7 @@ public class ITextFont - { - Font font = getCurrentFont(); - -- return String.valueOf( font.color().getRed() ); -+ return String.valueOf( font.getColor().getRed() ); - } - - /** -diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java -index 2847413..c85f81f 100644 ---- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java -+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java -@@ -1232,9 +1232,9 @@ public class ITextSink - try - { - Image image = Image.getInstance( new URL( urlName ) ); -- image.scaleToFit( ITextUtil.getDefaultPageSize().width() / 2, ITextUtil.getDefaultPageSize().height() / 2 ); -- width = image.plainWidth(); -- height = image.plainHeight(); -+ image.scaleToFit( ITextUtil.getDefaultPageSize().getWidth() / 2, ITextUtil.getDefaultPageSize().getHeight() / 2 ); -+ width = image.getPlainWidth(); -+ height = image.getPlainHeight(); - } - catch ( BadElementException e ) - { -diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java -index 4363413..141646c 100644 ---- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java -+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java -@@ -22,9 +22,6 @@ package org.apache.maven.doxia.module.itext; - import com.lowagie.text.DocumentException; - import com.lowagie.text.PageSize; - import com.lowagie.text.Rectangle; --import com.lowagie.text.xml.XmlToHtml; --import com.lowagie.text.xml.XmlToPdf; --import com.lowagie.text.xml.XmlToRtf; - - import java.io.InputStream; - import java.io.OutputStream; -@@ -77,7 +74,7 @@ public class ITextUtil - if ( currentField.getType().equals( Rectangle.class ) ) - { - Rectangle fPageSize = (Rectangle) currentField.get( null ); -- if ( ( rect.width() == fPageSize.width() ) && ( rect.height() == fPageSize.height() ) ) -+ if ( ( rect.getWidth() == fPageSize.getWidth() ) && ( rect.getHeight() == fPageSize.getHeight() ) ) - { - return currentField.getName(); - } -@@ -114,68 +111,4 @@ public class ITextUtil - - return false; - } -- -- /** -- * Parse an iText XML from the specified InputStream, writing an Pdf document -- * specified OutputStream. -- * -- * @param is the InputStream from which the XML is read. -- * @param os the OutputStream to which the result as Pdf is written. -- * @see com.lowagie.text.xml.XmlToPdf -- */ -- public static void writePdf( InputStream is, OutputStream os ) -- { -- try -- { -- XmlToPdf x = new XmlToPdf(); -- -- x.parse( is, os ); -- } -- catch ( DocumentException e ) -- { -- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); -- } -- } -- -- /** -- * Parse an iText XML from the specified InputStream, writing an rtf document -- * specified OutputStream. -- * -- * @param is the InputStream from which the XML is read. -- * @param os the OutputStream to which the result as RTF is written. -- * @see com.lowagie.text.xml.XmlToRtf -- */ -- public static void writeRtf( InputStream is, OutputStream os ) -- { -- try -- { -- XmlToRtf x = new XmlToRtf(); -- x.parse( is, os ); -- } -- catch ( DocumentException e ) -- { -- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); -- } -- } -- -- /** -- * Parse an iText XML from the specified InputStream, writing an html document -- * specified OutputStream. -- * -- * @param is the InputStream from which the XML is read. -- * @param os the OutputStream to which the result as Html is written. -- * @see com.lowagie.text.xml.XmlToHtml -- */ -- public static void writeHtml( InputStream is, OutputStream os ) -- { -- try -- { -- XmlToHtml x = new XmlToHtml(); -- x.parse( is, os ); -- } -- catch ( DocumentException e ) -- { -- throw new RuntimeException( "DocumentException : " + e.getMessage(), e ); -- } -- } - } -diff --git a/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java b/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java -index 6bcd2be..a9674a0 100644 ---- a/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java -+++ b/doxia-modules/doxia-module-itext/src/test/java/org/apache/maven/doxia/module/itext/ITextSinkTestCase.java -@@ -81,20 +81,6 @@ public class ITextSinkTestCase - } - - /** -- * Test PDF generation -- * -- * @throws Exception -- */ -- public void testGeneratingPDFFromITextXml() -- throws Exception -- { -- File f = new File( getBasedir(), "src/test/resources/itext/itext.xml" ); -- -- ITextUtil.writePdf( new FileInputStream( f ), -- new FileOutputStream( getGeneratedFile( "test_itext", "pdf" ) ) ); -- } -- -- /** - * Generate a pdf and a rtf from the standart test model. - * - * @throws Exception if any -@@ -107,11 +93,6 @@ public class ITextSinkTestCase - SinkTestDocument.generate( sink ); - - sink.close(); -- -- ITextUtil.writePdf( new FileInputStream( getGeneratedFile( "test_model", "xml" ) ), -- new FileOutputStream( getGeneratedFile( "test_model", "pdf" ) ) ); -- ITextUtil.writeRtf( new FileInputStream( getGeneratedFile( "test_model", "xml" ) ), -- new FileOutputStream( getGeneratedFile( "test_model", "rtf" ) ) ); - } - - /** -@@ -148,8 +129,5 @@ public class ITextSinkTestCase - - sink.flush(); - sink.close(); -- -- ITextUtil.writePdf( new FileInputStream( getGeneratedFile( "empty_anchor", "xml" ) ), -- new FileOutputStream( getGeneratedFile( "empty_anchor", "pdf" ) ) ); - } - } --- -2.5.5 - diff --git a/0002-Commons-configuration2.patch b/0002-Commons-configuration2.patch new file mode 100644 index 0000000..630b365 --- /dev/null +++ b/0002-Commons-configuration2.patch @@ -0,0 +1,72 @@ +--- doxia-1.12.0/doxia-modules/doxia-module-fo/pom.xml.orig 2023-01-09 21:09:18.000000000 -0700 ++++ doxia-1.12.0/doxia-modules/doxia-module-fo/pom.xml 2023-06-12 15:58:35.171254714 -0600 +@@ -71,9 +71,9 @@ under the License. + + + +- commons-configuration +- commons-configuration +- 1.10 ++ org.apache.commons ++ commons-configuration2 ++ 2.9.0 + + + commons-collections +--- doxia-1.12.0/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java.orig 2023-01-09 21:09:18.000000000 -0700 ++++ doxia-1.12.0/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java 2023-06-12 17:00:19.630450286 -0600 +@@ -20,14 +20,16 @@ package org.apache.maven.doxia.module.fo + */ + + import java.io.File; ++import java.io.FileReader; + import java.io.IOException; + import java.util.List; + + import javax.swing.text.MutableAttributeSet; + import javax.swing.text.SimpleAttributeSet; + +-import org.apache.commons.configuration.ConfigurationException; +-import org.apache.commons.configuration.XMLConfiguration; ++import org.apache.commons.configuration2.XMLConfiguration; ++import org.apache.commons.configuration2.ex.ConfigurationException; ++import org.apache.commons.configuration2.io.FileLocatorUtils; + import org.apache.maven.doxia.sink.impl.SinkUtils; + import org.codehaus.plexus.util.ReaderFactory; + +@@ -55,9 +57,6 @@ public class FoConfiguration + { + this.config = new XMLConfiguration(); + +- // necessary because some attributes contain commas: +- config.setDelimiterParsingDisabled( true ); +- + loadDefaultConfig(); + } + +@@ -75,10 +74,11 @@ public class FoConfiguration + throws IOException + { + config.clear(); ++ config.initFileLocator( FileLocatorUtils.fileLocator().basePath( configFile.getParent() ).fileName( configFile.getName() ).create() ); + + try + { +- config.load( configFile ); ++ config.read( new FileReader(configFile) ); + } + catch ( ConfigurationException cex ) + { +@@ -182,9 +182,11 @@ public class FoConfiguration + /** Load the default fo configuration file. */ + private void loadDefaultConfig() + { ++ config.initFileLocator( FileLocatorUtils.fileLocator().sourceURL( getClass().getResource( "/fo-styles.xslt" ) ).create() ); ++ + try + { +- config.load( ReaderFactory.newXmlReader( getClass().getResourceAsStream( "/fo-styles.xslt" ) ) ); ++ config.read( ReaderFactory.newXmlReader( getClass().getResourceAsStream( "/fo-styles.xslt" ) ) ); + } + catch ( ConfigurationException | IOException cex ) + { diff --git a/doxia-1.12.0-source-release.zip b/doxia-1.12.0-source-release.zip new file mode 100644 index 0000000..5330d15 --- /dev/null +++ b/doxia-1.12.0-source-release.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d22e25c0f8f687b0fc83ee2c78a118ad2f48cbda89d6c91a79f2cd4e9f87f755 +size 1336220 diff --git a/doxia-1.9.1-source-release.zip b/doxia-1.9.1-source-release.zip deleted file mode 100644 index 2f88caf..0000000 --- a/doxia-1.9.1-source-release.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:180e5fd472389dc1d63bddebdfeff2824eda9d55fce5ee8d91f08f487dc9c7cf -size 1302131 diff --git a/maven-doxia-build.tar.xz b/maven-doxia-build.tar.xz index cc561c5..7b7bf23 100644 --- a/maven-doxia-build.tar.xz +++ b/maven-doxia-build.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79831a6f62932d6f07acf21dc6d4eb15119e0d8f5467c9ac7f4171ad4ea1460c -size 5268 +oid sha256:ab05e18998e64d53317936318cbac5d2494ea4825f2d2cc025081889ab6fa285 +size 5136 diff --git a/maven-doxia.spec b/maven-doxia.spec index a51a005..4e3de53 100644 --- a/maven-doxia.spec +++ b/maven-doxia.spec @@ -1,7 +1,7 @@ # # spec file for package maven-doxia # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: maven-doxia -Version: 1.9.1 +Version: 1.12.0 Release: 0 Summary: Content generation framework License: Apache-2.0 @@ -25,14 +25,13 @@ Group: Development/Libraries/Java URL: https://maven.apache.org/doxia/ Source0: https://repo1.maven.org/maven2/org/apache/maven/doxia/doxia/%{version}/doxia-%{version}-source-release.zip Source1: %{name}-build.tar.xz -# Build against iText 2.x -# https://issues.apache.org/jira/browse/DOXIA-53 -Patch1: 0001-Fix-itext-dependency.patch +Patch0: 0002-Commons-configuration2.patch BuildRequires: ant BuildRequires: apache-commons-cli BuildRequires: apache-commons-collections -BuildRequires: apache-commons-configuration +BuildRequires: apache-commons-configuration2 BuildRequires: apache-commons-lang3 +BuildRequires: apache-commons-text BuildRequires: fdupes BuildRequires: guava BuildRequires: httpcomponents-client @@ -184,7 +183,7 @@ API documentation for %{name}. %prep %setup -q -n doxia-%{version} -a1 -%patch1 -p1 +%patch0 -p1 # we don't have clirr-maven-plugin %pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin pom.xml @@ -192,11 +191,6 @@ API documentation for %{name}. # complains %pom_remove_plugin :apache-rat-plugin -# use java 5 generics in modello plugin -%pom_xpath_inject "pom:plugin[pom:artifactId[text()='modello-maven-plugin']]"\ -"/pom:executions/pom:execution/pom:configuration" \ -"true" doxia-modules/doxia-module-fml/pom.xml - # requires network rm doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java @@ -211,9 +205,9 @@ rm doxia-core/src/test/java/org/apache/maven/doxia/util/XmlValidatorTest.java mkdir -p lib build-jar-repository -s lib \ apache-commons-lang3 \ - apache-commons-lang \ + apache-commons-text \ commons-cli \ - commons-configuration \ + commons-configuration2 \ guava/guava \ httpcomponents/httpclient \ httpcomponents/httpcore \