From 62f87c8ed049d638ebfc2acc16903006cfef1b72 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Nov 2018 12:42:46 +0000 Subject: [PATCH 01/21] Expand conditionals --- velocity.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/velocity.spec b/velocity.spec index c6b97eb..a83558d 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,4 +1,3 @@ -%bcond_without hsqldb Name: velocity Version: 1.7 @@ -29,9 +28,6 @@ BuildRequires: ant BuildRequires: antlr BuildRequires: junit BuildRequires: ant-junit -%if %{with hsqldb} -BuildRequires: hsqldb-lib -%endif BuildRequires: apache-commons-collections BuildRequires: apache-commons-logging BuildRequires: apache-commons-lang @@ -132,9 +128,7 @@ cp %{SOURCE1} ./pom.xml # Remove werken-xpath Import/Export refences in OSGi manifest file %patch7 -p1 -%if %{without hsqldb} rm -r src/test/org/apache/velocity/test/sql -%endif # ----------------------------------------------------------------------------- From 1987b20f01408b1430a1b149700d92577a459a5d Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Nov 2018 13:02:12 +0000 Subject: [PATCH 02/21] Remove explicit Epoch --- velocity.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/velocity.spec b/velocity.spec index a83558d..0a1e496 100644 --- a/velocity.spec +++ b/velocity.spec @@ -2,7 +2,6 @@ Name: velocity Version: 1.7 Release: 24%{?dist} -Epoch: 0 Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ @@ -77,7 +76,7 @@ Javadoc for %{name}. %package demo Summary: Demo for %{name} -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name} = %{version}-%{release} %description demo Demonstrations and samples for %{name}. From 1a00e6ccec502c7c84f0844c47ff7ec1cf21e1ac Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 24 May 2019 17:01:45 +0200 Subject: [PATCH 03/21] Mass rebuild for javapackages-tools 201901 --- velocity.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/velocity.spec b/velocity.spec index 0a1e496..944e7a0 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,7 +1,7 @@ Name: velocity Version: 1.7 -Release: 24%{?dist} +Release: 25%{?dist} Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ @@ -188,6 +188,9 @@ cp -pr examples test %{buildroot}%{_datadir}/%{name} %{_datadir}/%{name} %changelog +* Fri May 24 2019 Mikolaj Izdebski - 1.7-25 +- Mass rebuild for javapackages-tools 201901 + * Tue Jul 31 2018 Michael Simacek - 0:1.7-24 - Repack the tarball without binaries From 982f6ca32710fdc266353b91aaf15a6107aca5b4 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Fri, 7 Jun 2019 09:55:07 +0200 Subject: [PATCH 04/21] Update to upstream version 2.1 --- 0001-Don-t-use-Werken-XPath.patch | 165 ----------- 0001-Remove-avalon-logkit.patch | 62 ---- 0001-Remove-parent-velocity-master.patch | 31 ++ 0002-Fix-javacc-template-keyword.patch | 49 ++++ 0003-Use-system-jars.patch | 197 ------------- 0004-JDBC-41-compat.patch | 19 -- 0004-Use-log4j-1.2.17.patch | 25 -- 0006-Skip-Java-8-incompatible-test.patch | 26 -- generate-tarball.sh | 21 -- velocity-1.7-doclint.patch | 11 - velocity-1.7-osgi.patch | 43 --- velocity-1.7.pom | 346 ----------------------- velocity.spec | 119 ++------ 13 files changed, 96 insertions(+), 1018 deletions(-) delete mode 100644 0001-Don-t-use-Werken-XPath.patch delete mode 100644 0001-Remove-avalon-logkit.patch create mode 100644 0001-Remove-parent-velocity-master.patch create mode 100644 0002-Fix-javacc-template-keyword.patch delete mode 100644 0003-Use-system-jars.patch delete mode 100644 0004-JDBC-41-compat.patch delete mode 100644 0004-Use-log4j-1.2.17.patch delete mode 100644 0006-Skip-Java-8-incompatible-test.patch delete mode 100755 generate-tarball.sh delete mode 100644 velocity-1.7-doclint.patch delete mode 100644 velocity-1.7-osgi.patch delete mode 100644 velocity-1.7.pom diff --git a/0001-Don-t-use-Werken-XPath.patch b/0001-Don-t-use-Werken-XPath.patch deleted file mode 100644 index b754573..0000000 --- a/0001-Don-t-use-Werken-XPath.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 8a9344f55d74a5b809051ae144b3c028499fec0d Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Sat, 27 Sep 2013 10:53:46 +0200 -Subject: [PATCH] Don't use Werken XPath - ---- - src/java/org/apache/velocity/anakia/AnakiaElement.java | 7 +++++-- - src/java/org/apache/velocity/anakia/NodeList.java | 6 ++++-- - src/java/org/apache/velocity/anakia/XPathCache.java | 9 ++++++--- - src/java/org/apache/velocity/anakia/XPathTool.java | 16 ++++++++++------ - 4 files changed, 25 insertions(+), 13 deletions(-) - -diff --git a/src/java/org/apache/velocity/anakia/AnakiaElement.java b/src/java/org/apache/velocity/anakia/AnakiaElement.java -index c72b653..df13153 100644 ---- a/src/java/org/apache/velocity/anakia/AnakiaElement.java -+++ b/src/java/org/apache/velocity/anakia/AnakiaElement.java -@@ -20,8 +20,10 @@ package org.apache.velocity.anakia; - */ - - import org.jdom.Element; -+import org.jdom.JDOMException; - import org.jdom.Namespace; - import org.jdom.output.XMLOutputter; -+ - import java.util.List; - - /** -@@ -126,10 +128,11 @@ public class AnakiaElement extends Element - * @param xpathExpression the XPath expression you wish to apply - * @return a NodeList representing the nodes that are the result of - * application of the XPath to the current element. It can be empty. -+ * @throws JDOMException - */ -- public NodeList selectNodes(String xpathExpression) -+ public NodeList selectNodes(String xpathExpression) throws JDOMException - { -- return new NodeList(XPathCache.getXPath(xpathExpression).applyTo(this), false); -+ return new NodeList(XPathCache.getXPath(xpathExpression).selectNodes(this), false); - } - - /** -diff --git a/src/java/org/apache/velocity/anakia/NodeList.java b/src/java/org/apache/velocity/anakia/NodeList.java -index daf611d..b303bda 100644 ---- a/src/java/org/apache/velocity/anakia/NodeList.java -+++ b/src/java/org/apache/velocity/anakia/NodeList.java -@@ -35,6 +35,7 @@ import org.jdom.DocType; - import org.jdom.Document; - import org.jdom.Element; - import org.jdom.EntityRef; -+import org.jdom.JDOMException; - import org.jdom.ProcessingInstruction; - import org.jdom.Text; - import org.jdom.output.XMLOutputter; -@@ -289,10 +290,11 @@ public class NodeList implements List, Cloneable - * @param xpathString the XPath expression you wish to apply - * @return a NodeList representing the nodes that are the result of - * application of the XPath to the current node list. It can be empty. -+ * @throws JDOMException - */ -- public NodeList selectNodes(String xpathString) -+ public NodeList selectNodes(String xpathString) throws JDOMException - { -- return new NodeList(XPathCache.getXPath(xpathString).applyTo(nodes), false); -+ return new NodeList(XPathCache.getXPath(xpathString).selectNodes(nodes), false); - } - - // List methods implemented hereafter -diff --git a/src/java/org/apache/velocity/anakia/XPathCache.java b/src/java/org/apache/velocity/anakia/XPathCache.java -index cef43d9..0d633b0 100644 ---- a/src/java/org/apache/velocity/anakia/XPathCache.java -+++ b/src/java/org/apache/velocity/anakia/XPathCache.java -@@ -19,7 +19,9 @@ package org.apache.velocity.anakia; - * under the License. - */ - --import com.werken.xpath.XPath; -+import org.jdom.JDOMException; -+import org.jdom.xpath.XPath; -+ - import java.util.Map; - import java.util.WeakHashMap; - -@@ -46,8 +48,9 @@ class XPathCache - * A cached object is returned if it already exists for the requested expression. - * @param xpathString the XPath expression to parse - * @return the XPath object that represents the parsed XPath expression. -+ * @throws JDOMException - */ -- static XPath getXPath(String xpathString) -+ static XPath getXPath(String xpathString) throws JDOMException - { - XPath xpath = null; - synchronized(XPATH_CACHE) -@@ -55,7 +58,7 @@ class XPathCache - xpath = (XPath)XPATH_CACHE.get(xpathString); - if(xpath == null) - { -- xpath = new XPath(xpathString); -+ xpath = XPath.newInstance(xpathString); - XPATH_CACHE.put(xpathString, xpath); - } - } -diff --git a/src/java/org/apache/velocity/anakia/XPathTool.java b/src/java/org/apache/velocity/anakia/XPathTool.java -index c9e6178..f85d2c1 100644 ---- a/src/java/org/apache/velocity/anakia/XPathTool.java -+++ b/src/java/org/apache/velocity/anakia/XPathTool.java -@@ -23,6 +23,7 @@ import java.util.List; - - import org.jdom.Document; - import org.jdom.Element; -+import org.jdom.JDOMException; - - /** - * This class adds an entrypoint into XPath functionality, -@@ -88,12 +89,13 @@ public class XPathTool - * @param doc The Document context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- Document doc) -+ Document doc) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, Document)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( doc ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( doc ), false); - } - - /** -@@ -103,12 +105,13 @@ public class XPathTool - * @param elem The Element context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- Element elem) -+ Element elem) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, Element)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( elem ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( elem ), false); - } - - /** -@@ -118,12 +121,13 @@ public class XPathTool - * @param nodeSet The nodeset context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- List nodeSet) -+ List nodeSet) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, List)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( nodeSet ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( nodeSet ), false); - } - } - --- -1.8.3.1 - diff --git a/0001-Remove-avalon-logkit.patch b/0001-Remove-avalon-logkit.patch deleted file mode 100644 index 2f09b03..0000000 --- a/0001-Remove-avalon-logkit.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1d2f89cb3e954b943751fa8dd587fdb404eb9338 Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Mon, 21 Feb 2011 15:53:34 +0100 -Subject: [PATCH 1/3] Remove avalon-logkit - -we don't have it packaged so change defaults and remove it from pom.xml ---- - pom.xml | 6 ------ - .../velocity/runtime/defaults/velocity.properties | 4 ++-- - .../apache/velocity/runtime/log/LogManager.java | 2 +- - 3 files changed, 3 insertions(+), 9 deletions(-) - -diff --git a/pom.xml b/pom.xml -index 77a8e38..f453208 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -197,12 +197,6 @@ - provided - - -- logkit -- logkit -- 2.0 -- provided -- -- - ant - ant - 1.6 -diff --git a/src/java/org/apache/velocity/runtime/defaults/velocity.properties b/src/java/org/apache/velocity/runtime/defaults/velocity.properties -index 750a59a..7fac119 100644 ---- a/src/java/org/apache/velocity/runtime/defaults/velocity.properties -+++ b/src/java/org/apache/velocity/runtime/defaults/velocity.properties -@@ -20,10 +20,10 @@ - # ---------------------------------------------------------------------------- - - # ---------------------------------------------------------------------------- --# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute -+# default LogChute to use: default: Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute - # ---------------------------------------------------------------------------- - --runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute -+runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute - - # --------------------------------------------------------------------------- - # This is the location of the Velocity Runtime log. -diff --git a/src/java/org/apache/velocity/runtime/log/LogManager.java b/src/java/org/apache/velocity/runtime/log/LogManager.java -index 19d1016..97dceef 100644 ---- a/src/java/org/apache/velocity/runtime/log/LogManager.java -+++ b/src/java/org/apache/velocity/runtime/log/LogManager.java -@@ -119,7 +119,7 @@ public class LogManager - * classes, and we use the first one we find. - * - * Note that the default value of this property contains the -- * AvalonLogChute, the Log4JLogChute, CommonsLogLogChute, -+ * Log4JLogChute, CommonsLogLogChute, - * ServletLogChute, and the JdkLogChute for - * convenience - so we use whichever we works first. - */ --- -1.7.4 - diff --git a/0001-Remove-parent-velocity-master.patch b/0001-Remove-parent-velocity-master.patch new file mode 100644 index 0000000..1d12af8 --- /dev/null +++ b/0001-Remove-parent-velocity-master.patch @@ -0,0 +1,31 @@ +From f324b264d31a0225566f9e2a33fd7ffe661c866b Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Fri, 7 Jun 2019 08:52:02 +0200 +Subject: [PATCH] Remove parent velocity-master + +--- + pom.xml | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/pom.xml b/pom.xml +index ee7b1e5..7c408cc 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -23,13 +23,7 @@ + + 4.0.0 + +- +- org.apache.velocity +- velocity-master +- 2 +- +- +- ++ org.apache.velocity + velocity-engine-parent + 2.1 + +-- +2.20.1 + diff --git a/0002-Fix-javacc-template-keyword.patch b/0002-Fix-javacc-template-keyword.patch new file mode 100644 index 0000000..607f6fa --- /dev/null +++ b/0002-Fix-javacc-template-keyword.patch @@ -0,0 +1,49 @@ +From 3244501d1dd7906a9421ed3acba1fc5e2d1ac21c Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Fri, 7 Jun 2019 09:47:34 +0200 +Subject: [PATCH 2/2] Fix javacc template keyword + +--- + velocity-engine-core/src/main/parser/Parser.jjt | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/velocity-engine-core/src/main/parser/Parser.jjt b/velocity-engine-core/src/main/parser/Parser.jjt +index 720643d..2e7f6b3 100644 +--- a/velocity-engine-core/src/main/parser/Parser.jjt ++++ b/velocity-engine-core/src/main/parser/Parser.jjt +@@ -211,12 +211,12 @@ public class Parser + * method and re-initializing the lexer with + * the new stream that we want parsed. + */ +- public SimpleNode parse( Reader reader, Template template ) ++ public SimpleNode parse( Reader reader, Template templateInput ) + throws ParseException + { + SimpleNode sn = null; + +- currentTemplate = template; ++ currentTemplate = templateInput; + + try + { +@@ -244,7 +244,7 @@ public class Parser + * thrown by the Macro class when something is amiss in the + * Macro specification + */ +- log.error("{}: {}", template.getName(), mee.getMessage(), mee); ++ log.error("{}: {}", templateInput.getName(), mee.getMessage(), mee); + throw mee; + } + catch (ParseException pe) +@@ -259,7 +259,7 @@ public class Parser + } + catch (Exception e) + { +- String msg = template.getName() + ": " + e.getMessage(); ++ String msg = templateInput.getName() + ": " + e.getMessage(); + log.error(msg, e); + throw new VelocityException(msg, e); + } +-- +2.20.1 + diff --git a/0003-Use-system-jars.patch b/0003-Use-system-jars.patch deleted file mode 100644 index 3d37ee8..0000000 --- a/0003-Use-system-jars.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 813085c72e9906a53bec5954bcce7305a7c320d1 Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Mon, 21 Feb 2011 17:58:39 +0100 -Subject: [PATCH 3/3] Use system jars - ---- - build/build.xml | 56 +++++++++++---------------------------------------- - build/testcases.xml | 6 ----- - 2 files changed, 12 insertions(+), 50 deletions(-) - -diff --git a/build/build.xml b/build/build.xml -index c667553..479ef2d 100644 ---- a/build/build.xml -+++ b/build/build.xml -@@ -140,28 +140,6 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -@@ -174,12 +152,11 @@ - - - -- -+ - - - -- - - - -@@ -210,10 +187,9 @@ - - - -- -+ - -- - - - -@@ -248,7 +224,7 @@ - - - -- - -+ optimize="${optimize}"/> - - - -@@ -268,7 +243,7 @@ - - - -- - - -- -- - - - -@@ -561,7 +534,7 @@ - - - -- - - -@@ -585,8 +558,7 @@ - encoding="UTF-8" - debug="${debug}" - deprecation="${deprecation}" -- optimize="${optimize}" -- classpathref="velocity.run.classpath"/> -+ optimize="${optimize}"/> - - - -@@ -604,7 +576,7 @@ - - - -- - - -@@ -620,8 +592,7 @@ - doctitle="${name} ${version} API" - encoding="UTF-8" - docencoding="UTF-8" -- bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved." -- classpathref="velocity.build.classpath"> -+ bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> - - - -@@ -1024,12 +995,11 @@ - - - -- - - -+ classname="org.apache.velocity.anakia.AnakiaTask"/> - - - ####################################################### -@@ -1231,7 +1201,7 @@ - - - -- - - -@@ -1264,8 +1234,6 @@ - - - -- -- - - - -diff --git a/build/testcases.xml b/build/testcases.xml -index 06bb36e..f3749bc 100644 ---- a/build/testcases.xml -+++ b/build/testcases.xml -@@ -36,12 +36,6 @@ - - - -- -- -- -- -- -- - - - --- -1.7.4 - diff --git a/0004-JDBC-41-compat.patch b/0004-JDBC-41-compat.patch deleted file mode 100644 index c137bac..0000000 --- a/0004-JDBC-41-compat.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:49:20.202936454 -0500 -+++ b/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:52:35.062574871 -0500 -@@ -23,6 +23,7 @@ - import java.sql.Connection; - import java.sql.DriverManager; - import java.sql.SQLException; -+import java.sql.SQLFeatureNotSupportedException; - - import javax.sql.DataSource; - -@@ -73,5 +74,8 @@ - public Object unwrap(final Class iface) throws SQLException { - throw new SQLException("Not implemented"); - } -+ public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { -+ throw new SQLFeatureNotSupportedException("getParentLogger() not supported"); -+ } - - } diff --git a/0004-Use-log4j-1.2.17.patch b/0004-Use-log4j-1.2.17.patch deleted file mode 100644 index 62602a0..0000000 --- a/0004-Use-log4j-1.2.17.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cec42bf7ae8b4b72850c3cdea74a07603f11786f Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Wed, 18 Jun 2014 07:25:12 +0200 -Subject: [PATCH 4/4] Use log4j 1.2.17 - ---- - pom.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pom.xml b/pom.xml -index e35d72d..c8d48fd 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -187,7 +187,7 @@ - - log4j - log4j -- 1.2.12 -+ 1.2.17 - provided - - --- -1.9.3 - diff --git a/0006-Skip-Java-8-incompatible-test.patch b/0006-Skip-Java-8-incompatible-test.patch deleted file mode 100644 index 3577fa0..0000000 --- a/0006-Skip-Java-8-incompatible-test.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6060e6ef497bddc4a9aeac343e584ff324746d58 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Wed, 18 Jun 2014 08:11:48 +0200 -Subject: [PATCH 6/6] Skip Java 8 incompatible test - ---- - src/test/org/apache/velocity/test/issues/VelTools66TestCase.java | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -index 00bb0b1..6fb7260 100644 ---- a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -+++ b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -@@ -87,7 +87,8 @@ public class VelTools66TestCase - - Method testMethod = introspector.getMethod(TestObject.class, "getTestValue", new Object[0]); - assertNotNull(testMethod); -- assertEquals("Method object does not match!", verifyMethod, testMethod); -+ // Java 8 incompatibility -+ // assertEquals("Method object does not match!", verifyMethod, testMethod); - } - - public static interface TestInterface --- -1.9.3 - diff --git a/generate-tarball.sh b/generate-tarball.sh deleted file mode 100755 index a86a470..0000000 --- a/generate-tarball.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -e - -name=velocity -version="$(sed -n 's/Version:\s*//p' *.spec)" - -# RETRIEVE -wget "http://www.apache.org/dist/${name}/engine/${version}/${name}-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" - -rm -rf tarball-tmp -mkdir tarball-tmp -cd tarball-tmp -tar xf "../${name}-${version}.orig.tar.gz" - -# CLEAN TARBALL -rm -r */*.jar -rm -r */lib - -tar cf "../${name}-${version}.tar.gz" * -cd .. -rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/velocity-1.7-doclint.patch b/velocity-1.7-doclint.patch deleted file mode 100644 index 7895b60..0000000 --- a/velocity-1.7-doclint.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nru velocity-1.7/build/build.xml velocity-1.7.doclint/build/build.xml ---- velocity-1.7/build/build.xml 2015-07-22 12:13:51.566920750 +0200 -+++ velocity-1.7.doclint/build/build.xml 2015-07-22 12:13:14.929703544 +0200 -@@ -592,6 +592,7 @@ - doctitle="${name} ${version} API" - encoding="UTF-8" - docencoding="UTF-8" -+ additionalparam="-Xdoclint:none" - bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> - - diff --git a/velocity-1.7-osgi.patch b/velocity-1.7-osgi.patch deleted file mode 100644 index 2d6ac05..0000000 --- a/velocity-1.7-osgi.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -Nru velocity-1.7/build/build.properties velocity-1.7.osgi/build/build.properties ---- velocity-1.7/build/build.properties 2010-11-19 21:16:21.000000000 +0100 -+++ velocity-1.7.osgi/build/build.properties 2015-07-22 12:21:19.627117810 +0200 -@@ -166,8 +166,7 @@ - - ######################################################################## - # OSGi stuff --import=com.werken.xpath;resolution:=optional,\ -- javax.naming,\ -+import=javax.naming,\ - javax.servlet;resolution:=optional,\ - javax.servlet.http;resolution:=optional,\ - javax.sql,\ -@@ -188,8 +187,7 @@ - org.jdom.input;resolution:=optional,\ - org.jdom.output;resolution:=optional,\ - org.xml.sax --dep.import=com.werken.xpath;resolution:=optional,\ -- javax.naming,\ -+dep.import=javax.naming,\ - javax.servlet;resolution:=optional,\ - javax.servlet.http;resolution:=optional,\ - javax.sql,\ -@@ -207,8 +205,7 @@ - export=org.apache.velocity;uses:="org.apache.velocity.context,\ - org.apache.velocity.exception,\ - org.apache.velocity.runtime.resource",\ -- org.apache.velocity.anakia;uses:="com.werken.xpath,\ -- org.apache.tools.ant,\ -+ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ - org.apache.tools.ant.taskdefs,\ - org.jdom,\ - org.jdom.output",\ -@@ -327,8 +324,7 @@ - org.apache.velocity;uses:="org.apache.velocity.context,\ - org.apache.velocity.exception,\ - org.apache.velocity.runtime.resource",\ -- org.apache.velocity.anakia;uses:="com.werken.xpath,\ -- org.apache.tools.ant,\ -+ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ - org.apache.tools.ant.taskdefs,\ - org.jdom,\ - org.jdom.output",\ diff --git a/velocity-1.7.pom b/velocity-1.7.pom deleted file mode 100644 index 77a8e38..0000000 --- a/velocity-1.7.pom +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - 4.0.0 - - - org.apache - apache - 4 - - - org.apache.velocity - velocity - 1.7 - - Apache Velocity - http://velocity.apache.org/engine/devel/ - Apache Velocity is a general purpose template engine. - 2000 - jar - - - 2.0.9 - - - - install - src/java - src/test - - - org.apache.maven.plugins - maven-site-plugin - - UTF-8 - UTF-8 - ${basedir}/xdocs/docs - - - - - - src/java - - **/*.java - - - - - - - - velocity.apache.org - scpexe://people.apache.org/www/velocity.apache.org/engine/releases/velocity-1.7 - - - apache.releases - Apache Release Distribution Repository - scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository - - - apache.snapshots - Apache Development Snapshot Repository - scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository - - - - - - Will Glass-Husain - wglass - wglass@forio.com - Forio Business Simulations - - Java Developer - - - - - Geir Magnusson Jr. - geirm - geirm@optonline.net - Independent (DVSL Maven) - - Java Developer - - - - - Daniel Rall - dlr - dlr@finemaltcoding.com - CollabNet, Inc. - - Java Developer - - - - - Henning P. Schmiedehausen - henning - hps@intermeta.de - INTERMETA - Gesellschaft für Mehrwertdienste mbH - - Java Developer - - 2 - - - - Nathan Bubna - nbubna - nathan@esha.com - ESHA Research - - Java Developer - - - - - - - - commons-collections - commons-collections - 3.2.1 - - - commons-lang - commons-lang - 2.4 - - - oro - oro - 2.0.8 - true - - - jdom - jdom - 1.0 - provided - - - commons-logging - commons-logging - 1.1 - provided - - - avalon-framework - avalon-framework - - - log4j - log4j - - - javax.servlet - servlet-api - - - - - log4j - log4j - 1.2.12 - provided - - - javax.servlet - servlet-api - 2.3 - provided - - - logkit - logkit - 2.0 - provided - - - ant - ant - 1.6 - provided - - - werken-xpath - werken-xpath - 0.9.4 - provided - - - junit - junit - 3.8.1 - test - - - hsqldb - hsqldb - 1.7.1 - test - - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.1 - - - - dependencies - issue-tracking - license - summary - scm - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.0 - - - - changes-report - jira-report - - - - - ${jira.browse.url}/%ISSUE% - - 12311337 - - fixfor=12310290&sorter/field=issuekey&sorter/order=ASC - 100 - http://velocity.apache.org/who-we-are.html - - - - org.codehaus.mojo - taglist-maven-plugin - 2.2 - - TODO - FIXME - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.5 - - - http://java.sun.com/j2se/1.4.2/docs/api - http://jakarta.apache.org/oro/api - http://jakarta.apache.org/commons/lang/api-release - http://jakarta.apache.org/commons/collections/api-release - - http://www.jdom.org/docs/apidocs - http://logging.apache.org/log4j/docs/api - http://excalibur.apache.org/apidocs - http://tomcat.apache.org/tomcat-4.1-doc/servletapi - - - - - org.apache.maven.plugins - maven-changelog-plugin - 2.1 - - - org.codehaus.mojo - findbugs-maven-plugin - 1.2 - - true - Low - Max - build/findbugs-exclude.xml - xdocs - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.4 - 1.4 - - - - - - - scm:svn:http://svn.apache.org/repos/asf/velocity/engine/trunk - scm:svn:https://svn.apache.org/repos/asf/velocity/engine/trunk - HEAD - http://svn.apache.org/viewvc/velocity/engine/trunk - - - - https://issues.apache.org/jira/browse - - - - JIRA - ${jira.browse.url}/VELOCITY - - diff --git a/velocity.spec b/velocity.spec index 944e7a0..e6a70d3 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,45 +1,19 @@ - Name: velocity -Version: 1.7 -Release: 25%{?dist} +Version: 2.1 +Release: 1%{?dist} Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ BuildArch: noarch -# ./generate-tarball.sh -Source0: %{name}-%{version}.tar.gz -Source1: http://repo1.maven.org/maven2/org/apache/%{name}/%{name}/%{version}/%{name}-%{version}.pom -# Remove bundled binaries which cannot be easily verified for licensing -Source2: generate-tarball.sh +Source0: http://central.maven.org/maven2/org/apache/velocity/velocity-engine-parent/%{version}/velocity-engine-parent-%{version}-source-release.zip -Patch0: 0001-Remove-avalon-logkit.patch -Patch1: 0004-Use-log4j-1.2.17.patch -Patch2: 0003-Use-system-jars.patch -Patch3: 0004-JDBC-41-compat.patch -Patch4: 0001-Don-t-use-Werken-XPath.patch -Patch5: 0006-Skip-Java-8-incompatible-test.patch -Patch6: velocity-1.7-doclint.patch -Patch7: velocity-1.7-osgi.patch +Patch0: 0001-Remove-parent-velocity-master.patch +Patch1: 0002-Fix-javacc-template-keyword.patch BuildRequires: javapackages-local -BuildRequires: ant -BuildRequires: antlr -BuildRequires: junit -BuildRequires: ant-junit -BuildRequires: apache-commons-collections -BuildRequires: apache-commons-logging -BuildRequires: apache-commons-lang -BuildRequires: glassfish-servlet-api -BuildRequires: jakarta-oro -BuildRequires: jaxen -BuildRequires: jdom -BuildRequires: bcel -BuildRequires: log4j12 -BuildRequires: apache-parent - -# It fails one of the arithmetic test cases with gcj -BuildRequires: java-devel >= 1:1.6.0 +BuildRequires: maven-local +BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin) %description Velocity is a Java-based template engine. It permits anyone to use the @@ -81,83 +55,19 @@ Requires: %{name} = %{version}-%{release} %description demo Demonstrations and samples for %{name}. -# ----------------------------------------------------------------------------- - %prep -%setup -q +%setup -q -n velocity-engine-parent-%{version} -# remove bundled libs/classes (except those used for testing) -find . -name '*.jar' ! -name 'test*.jar' -print -delete -find . -name '*.class' ! -name 'Foo.class' -print -delete - -# Remove dependency on avalon-logkit -rm -f src/java/org/apache/velocity/runtime/log/AvalonLogChute.java -rm -f src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java -rm -f src/java/org/apache/velocity/runtime/log/VelocityFormatter.java - -# need porting to new servlet API. We would just add a lot of empty functions -rm src/test/org/apache/velocity/test/VelocityServletTestCase.java - -# This test doesn't work with new hsqldb -rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java - -cp %{SOURCE1} ./pom.xml - -# remove rest of avalon logkit refences %patch0 -p1 - -# Use log4j 1.2.17 %patch1 -p1 -# Use system jar files instead of downloading from net -%patch2 -p1 - -%patch3 -p1 - -# Use jdom instead of werken-xpath -%patch4 -p1 -%pom_remove_dep werken-xpath: - -# Skip Java 8 incompatible test -%patch5 -p1 - -# Disable Java8 doclint -%patch6 -p1 - -# Remove werken-xpath Import/Export refences in OSGi manifest file -%patch7 -p1 - -rm -r src/test/org/apache/velocity/test/sql - -# ----------------------------------------------------------------------------- +%pom_remove_plugin :maven-javadoc-plugin +%pom_remove_plugin :maven-enforcer-plugin +%pom_remove_plugin :maven-shade-plugin velocity-engine-core %build - -export CLASSPATH=$(build-classpath \ -antlr \ -apache-commons-collections \ -commons-lang \ -commons-logging \ -glassfish-servlet-api \ -junit \ -jakarta-oro \ -log4j:log4j:1.2.17 \ -jaxen \ -jdom \ -bcel \ -hsqldb \ -junit) -ant \ - -buildfile build/build.xml \ - -Dbuild.sysclasspath=first \ - -Djavac.target=1.6 \ - -Djavac.source=1.6 \ - jar javadocs test - -# fix line-endings in generated files -sed -i 's/\r//' docs/api/stylesheet.css docs/api/package-list - -# ----------------------------------------------------------------------------- +# Tests require hsqldb +%mvn_build -f %install %mvn_file : %{name} @@ -188,6 +98,9 @@ cp -pr examples test %{buildroot}%{_datadir}/%{name} %{_datadir}/%{name} %changelog +* Thu Jun 06 2019 Marian Koncek - 2.1-1 +- Update to upstream version 2.1 + * Fri May 24 2019 Mikolaj Izdebski - 1.7-25 - Mass rebuild for javapackages-tools 201901 From fcf964c0673e70a6be770282bc7c40bd7008028b Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Fri, 7 Jun 2019 10:09:56 +0200 Subject: [PATCH 05/21] Upload sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 57d2359..2658f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ velocity-1.6.3.tar.gz /velocity-1.6.4.tar.gz /velocity-1.7.tar.gz +/velocity-engine-parent-2.1-source-release.zip diff --git a/sources b/sources index 7928f22..f3af018 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (velocity-1.7.tar.gz) = d305642aab3c837ad250deaa46b516561fb68f92d04fc205fd4f40eb774ba6286ed3b239ee6352bc4411bd11cb4d1d5b39ce9ab8467f0e1ffceed9f9fc5a228d +SHA512 (velocity-engine-parent-2.1-source-release.zip) = ee5969e62fb1e32816dbfe34ee96edcb569414df4fcf2fbbef4cba34a96eead59e4f173b558eff23d308f9b62ee5c5cec79104054b2e32f3bf0e6e5aed95ccdc From d5b08e3229cf74ac17091ae20e6559b76b444283 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 7 Jun 2019 10:15:51 +0200 Subject: [PATCH 06/21] Don't install manual and demos --- velocity.spec | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/velocity.spec b/velocity.spec index e6a70d3..9b13aa9 100644 --- a/velocity.spec +++ b/velocity.spec @@ -11,7 +11,6 @@ Source0: http://central.maven.org/maven2/org/apache/velocity/velocity-eng Patch0: 0001-Remove-parent-velocity-master.patch Patch1: 0002-Fix-javacc-template-keyword.patch -BuildRequires: javapackages-local BuildRequires: maven-local BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin) @@ -36,28 +35,14 @@ template services for the Turbine web application framework. Velocity+Turbine provides a template service that will allow web applications to be developed according to a true MVC model. -%package manual -Summary: Manual for %{name} - -%description manual -Documentation for %{name}. - %package javadoc Summary: Javadoc for %{name} %description javadoc Javadoc for %{name}. -%package demo -Summary: Demo for %{name} -Requires: %{name} = %{version}-%{release} - -%description demo -Demonstrations and samples for %{name}. - %prep %setup -q -n velocity-engine-parent-%{version} - %patch0 -p1 %patch1 -p1 @@ -70,33 +55,15 @@ Demonstrations and samples for %{name}. %mvn_build -f %install -%mvn_file : %{name} -%mvn_alias : %{name}:%{name} -%mvn_artifact pom.xml bin/%{name}-%{version}.jar -%mvn_install -J docs/api - -# zero-length file -rm -r test/issues/velocity-537/compare/velocity537.vm.cmp -# data -install -d -m 755 %{buildroot}%{_datadir}/%{name} -cp -pr examples test %{buildroot}%{_datadir}/%{name} - +%mvn_install %files -f .mfiles %doc README.txt %license LICENSE NOTICE -%files manual -%license LICENSE NOTICE -%doc docs/* - %files javadoc -f .mfiles-javadoc %license LICENSE NOTICE -%files demo -%license LICENSE NOTICE -%{_datadir}/%{name} - %changelog * Thu Jun 06 2019 Marian Koncek - 2.1-1 - Update to upstream version 2.1 From 181e17359c2bf3cd57f4e8617e3b3710b9819f2f Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Fri, 7 Jun 2019 10:26:08 +0200 Subject: [PATCH 07/21] Fix build --- velocity.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/velocity.spec b/velocity.spec index 9b13aa9..5e2c9f2 100644 --- a/velocity.spec +++ b/velocity.spec @@ -12,7 +12,10 @@ Patch0: 0001-Remove-parent-velocity-master.patch Patch1: 0002-Fix-javacc-template-keyword.patch BuildRequires: maven-local +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin) BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin) +BuildRequires: mvn(org.jdom:jdom) %description Velocity is a Java-based template engine. It permits anyone to use the @@ -58,7 +61,7 @@ Javadoc for %{name}. %mvn_install %files -f .mfiles -%doc README.txt +%doc README.md %license LICENSE NOTICE %files javadoc -f .mfiles-javadoc From 400fd08b908780d5baf4cd6d06563f46ad7e1b98 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 7 Jun 2019 10:52:38 +0200 Subject: [PATCH 08/21] Add alias for org.apache.velocity:velocity --- velocity.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/velocity.spec b/velocity.spec index 5e2c9f2..fade512 100644 --- a/velocity.spec +++ b/velocity.spec @@ -53,6 +53,8 @@ Javadoc for %{name}. %pom_remove_plugin :maven-enforcer-plugin %pom_remove_plugin :maven-shade-plugin velocity-engine-core +%mvn_alias :velocity-engine-core :velocity + %build # Tests require hsqldb %mvn_build -f From 34fb8566e63405b978e025a8fe849461aa475407 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 10 Jun 2019 08:20:36 +0200 Subject: [PATCH 09/21] Revert "Update to upstream version 2.1" This reverts commit 982f6ca32710fdc266353b91aaf15a6107aca5b4. This reverts commit fcf964c0673e70a6be770282bc7c40bd7008028b. This reverts commit d5b08e3229cf74ac17091ae20e6559b76b444283. This reverts commit 181e17359c2bf3cd57f4e8617e3b3710b9819f2f. This reverts commit 400fd08b908780d5baf4cd6d06563f46ad7e1b98. --- .gitignore | 1 - 0001-Don-t-use-Werken-XPath.patch | 165 +++++++++++ 0001-Remove-avalon-logkit.patch | 62 ++++ 0001-Remove-parent-velocity-master.patch | 31 -- 0002-Fix-javacc-template-keyword.patch | 49 ---- 0003-Use-system-jars.patch | 197 +++++++++++++ 0004-JDBC-41-compat.patch | 19 ++ 0004-Use-log4j-1.2.17.patch | 25 ++ 0006-Skip-Java-8-incompatible-test.patch | 26 ++ generate-tarball.sh | 21 ++ sources | 2 +- velocity-1.7-doclint.patch | 11 + velocity-1.7-osgi.patch | 43 +++ velocity-1.7.pom | 346 +++++++++++++++++++++++ velocity.spec | 159 +++++++++-- 15 files changed, 1053 insertions(+), 104 deletions(-) create mode 100644 0001-Don-t-use-Werken-XPath.patch create mode 100644 0001-Remove-avalon-logkit.patch delete mode 100644 0001-Remove-parent-velocity-master.patch delete mode 100644 0002-Fix-javacc-template-keyword.patch create mode 100644 0003-Use-system-jars.patch create mode 100644 0004-JDBC-41-compat.patch create mode 100644 0004-Use-log4j-1.2.17.patch create mode 100644 0006-Skip-Java-8-incompatible-test.patch create mode 100755 generate-tarball.sh create mode 100644 velocity-1.7-doclint.patch create mode 100644 velocity-1.7-osgi.patch create mode 100644 velocity-1.7.pom diff --git a/.gitignore b/.gitignore index 2658f2a..57d2359 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ velocity-1.6.3.tar.gz /velocity-1.6.4.tar.gz /velocity-1.7.tar.gz -/velocity-engine-parent-2.1-source-release.zip diff --git a/0001-Don-t-use-Werken-XPath.patch b/0001-Don-t-use-Werken-XPath.patch new file mode 100644 index 0000000..b754573 --- /dev/null +++ b/0001-Don-t-use-Werken-XPath.patch @@ -0,0 +1,165 @@ +From 8a9344f55d74a5b809051ae144b3c028499fec0d Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Sat, 27 Sep 2013 10:53:46 +0200 +Subject: [PATCH] Don't use Werken XPath + +--- + src/java/org/apache/velocity/anakia/AnakiaElement.java | 7 +++++-- + src/java/org/apache/velocity/anakia/NodeList.java | 6 ++++-- + src/java/org/apache/velocity/anakia/XPathCache.java | 9 ++++++--- + src/java/org/apache/velocity/anakia/XPathTool.java | 16 ++++++++++------ + 4 files changed, 25 insertions(+), 13 deletions(-) + +diff --git a/src/java/org/apache/velocity/anakia/AnakiaElement.java b/src/java/org/apache/velocity/anakia/AnakiaElement.java +index c72b653..df13153 100644 +--- a/src/java/org/apache/velocity/anakia/AnakiaElement.java ++++ b/src/java/org/apache/velocity/anakia/AnakiaElement.java +@@ -20,8 +20,10 @@ package org.apache.velocity.anakia; + */ + + import org.jdom.Element; ++import org.jdom.JDOMException; + import org.jdom.Namespace; + import org.jdom.output.XMLOutputter; ++ + import java.util.List; + + /** +@@ -126,10 +128,11 @@ public class AnakiaElement extends Element + * @param xpathExpression the XPath expression you wish to apply + * @return a NodeList representing the nodes that are the result of + * application of the XPath to the current element. It can be empty. ++ * @throws JDOMException + */ +- public NodeList selectNodes(String xpathExpression) ++ public NodeList selectNodes(String xpathExpression) throws JDOMException + { +- return new NodeList(XPathCache.getXPath(xpathExpression).applyTo(this), false); ++ return new NodeList(XPathCache.getXPath(xpathExpression).selectNodes(this), false); + } + + /** +diff --git a/src/java/org/apache/velocity/anakia/NodeList.java b/src/java/org/apache/velocity/anakia/NodeList.java +index daf611d..b303bda 100644 +--- a/src/java/org/apache/velocity/anakia/NodeList.java ++++ b/src/java/org/apache/velocity/anakia/NodeList.java +@@ -35,6 +35,7 @@ import org.jdom.DocType; + import org.jdom.Document; + import org.jdom.Element; + import org.jdom.EntityRef; ++import org.jdom.JDOMException; + import org.jdom.ProcessingInstruction; + import org.jdom.Text; + import org.jdom.output.XMLOutputter; +@@ -289,10 +290,11 @@ public class NodeList implements List, Cloneable + * @param xpathString the XPath expression you wish to apply + * @return a NodeList representing the nodes that are the result of + * application of the XPath to the current node list. It can be empty. ++ * @throws JDOMException + */ +- public NodeList selectNodes(String xpathString) ++ public NodeList selectNodes(String xpathString) throws JDOMException + { +- return new NodeList(XPathCache.getXPath(xpathString).applyTo(nodes), false); ++ return new NodeList(XPathCache.getXPath(xpathString).selectNodes(nodes), false); + } + + // List methods implemented hereafter +diff --git a/src/java/org/apache/velocity/anakia/XPathCache.java b/src/java/org/apache/velocity/anakia/XPathCache.java +index cef43d9..0d633b0 100644 +--- a/src/java/org/apache/velocity/anakia/XPathCache.java ++++ b/src/java/org/apache/velocity/anakia/XPathCache.java +@@ -19,7 +19,9 @@ package org.apache.velocity.anakia; + * under the License. + */ + +-import com.werken.xpath.XPath; ++import org.jdom.JDOMException; ++import org.jdom.xpath.XPath; ++ + import java.util.Map; + import java.util.WeakHashMap; + +@@ -46,8 +48,9 @@ class XPathCache + * A cached object is returned if it already exists for the requested expression. + * @param xpathString the XPath expression to parse + * @return the XPath object that represents the parsed XPath expression. ++ * @throws JDOMException + */ +- static XPath getXPath(String xpathString) ++ static XPath getXPath(String xpathString) throws JDOMException + { + XPath xpath = null; + synchronized(XPATH_CACHE) +@@ -55,7 +58,7 @@ class XPathCache + xpath = (XPath)XPATH_CACHE.get(xpathString); + if(xpath == null) + { +- xpath = new XPath(xpathString); ++ xpath = XPath.newInstance(xpathString); + XPATH_CACHE.put(xpathString, xpath); + } + } +diff --git a/src/java/org/apache/velocity/anakia/XPathTool.java b/src/java/org/apache/velocity/anakia/XPathTool.java +index c9e6178..f85d2c1 100644 +--- a/src/java/org/apache/velocity/anakia/XPathTool.java ++++ b/src/java/org/apache/velocity/anakia/XPathTool.java +@@ -23,6 +23,7 @@ import java.util.List; + + import org.jdom.Document; + import org.jdom.Element; ++import org.jdom.JDOMException; + + /** + * This class adds an entrypoint into XPath functionality, +@@ -88,12 +89,13 @@ public class XPathTool + * @param doc The Document context + * + * @return A list of selected nodes ++ * @throws JDOMException + */ + public NodeList applyTo(String xpathSpec, +- Document doc) ++ Document doc) throws JDOMException + { + //RuntimeSingleton.info("XPathTool::applyTo(String, Document)"); +- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( doc ), false); ++ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( doc ), false); + } + + /** +@@ -103,12 +105,13 @@ public class XPathTool + * @param elem The Element context + * + * @return A list of selected nodes ++ * @throws JDOMException + */ + public NodeList applyTo(String xpathSpec, +- Element elem) ++ Element elem) throws JDOMException + { + //RuntimeSingleton.info("XPathTool::applyTo(String, Element)"); +- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( elem ), false); ++ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( elem ), false); + } + + /** +@@ -118,12 +121,13 @@ public class XPathTool + * @param nodeSet The nodeset context + * + * @return A list of selected nodes ++ * @throws JDOMException + */ + public NodeList applyTo(String xpathSpec, +- List nodeSet) ++ List nodeSet) throws JDOMException + { + //RuntimeSingleton.info("XPathTool::applyTo(String, List)"); +- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( nodeSet ), false); ++ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( nodeSet ), false); + } + } + +-- +1.8.3.1 + diff --git a/0001-Remove-avalon-logkit.patch b/0001-Remove-avalon-logkit.patch new file mode 100644 index 0000000..2f09b03 --- /dev/null +++ b/0001-Remove-avalon-logkit.patch @@ -0,0 +1,62 @@ +From 1d2f89cb3e954b943751fa8dd587fdb404eb9338 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Mon, 21 Feb 2011 15:53:34 +0100 +Subject: [PATCH 1/3] Remove avalon-logkit + +we don't have it packaged so change defaults and remove it from pom.xml +--- + pom.xml | 6 ------ + .../velocity/runtime/defaults/velocity.properties | 4 ++-- + .../apache/velocity/runtime/log/LogManager.java | 2 +- + 3 files changed, 3 insertions(+), 9 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 77a8e38..f453208 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -197,12 +197,6 @@ + provided + + +- logkit +- logkit +- 2.0 +- provided +- +- + ant + ant + 1.6 +diff --git a/src/java/org/apache/velocity/runtime/defaults/velocity.properties b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +index 750a59a..7fac119 100644 +--- a/src/java/org/apache/velocity/runtime/defaults/velocity.properties ++++ b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +@@ -20,10 +20,10 @@ + # ---------------------------------------------------------------------------- + + # ---------------------------------------------------------------------------- +-# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute ++# default LogChute to use: default: Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute + # ---------------------------------------------------------------------------- + +-runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute ++runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute + + # --------------------------------------------------------------------------- + # This is the location of the Velocity Runtime log. +diff --git a/src/java/org/apache/velocity/runtime/log/LogManager.java b/src/java/org/apache/velocity/runtime/log/LogManager.java +index 19d1016..97dceef 100644 +--- a/src/java/org/apache/velocity/runtime/log/LogManager.java ++++ b/src/java/org/apache/velocity/runtime/log/LogManager.java +@@ -119,7 +119,7 @@ public class LogManager + * classes, and we use the first one we find. + * + * Note that the default value of this property contains the +- * AvalonLogChute, the Log4JLogChute, CommonsLogLogChute, ++ * Log4JLogChute, CommonsLogLogChute, + * ServletLogChute, and the JdkLogChute for + * convenience - so we use whichever we works first. + */ +-- +1.7.4 + diff --git a/0001-Remove-parent-velocity-master.patch b/0001-Remove-parent-velocity-master.patch deleted file mode 100644 index 1d12af8..0000000 --- a/0001-Remove-parent-velocity-master.patch +++ /dev/null @@ -1,31 +0,0 @@ -From f324b264d31a0225566f9e2a33fd7ffe661c866b Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Fri, 7 Jun 2019 08:52:02 +0200 -Subject: [PATCH] Remove parent velocity-master - ---- - pom.xml | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/pom.xml b/pom.xml -index ee7b1e5..7c408cc 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -23,13 +23,7 @@ - - 4.0.0 - -- -- org.apache.velocity -- velocity-master -- 2 -- -- -- -+ org.apache.velocity - velocity-engine-parent - 2.1 - --- -2.20.1 - diff --git a/0002-Fix-javacc-template-keyword.patch b/0002-Fix-javacc-template-keyword.patch deleted file mode 100644 index 607f6fa..0000000 --- a/0002-Fix-javacc-template-keyword.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3244501d1dd7906a9421ed3acba1fc5e2d1ac21c Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Fri, 7 Jun 2019 09:47:34 +0200 -Subject: [PATCH 2/2] Fix javacc template keyword - ---- - velocity-engine-core/src/main/parser/Parser.jjt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/velocity-engine-core/src/main/parser/Parser.jjt b/velocity-engine-core/src/main/parser/Parser.jjt -index 720643d..2e7f6b3 100644 ---- a/velocity-engine-core/src/main/parser/Parser.jjt -+++ b/velocity-engine-core/src/main/parser/Parser.jjt -@@ -211,12 +211,12 @@ public class Parser - * method and re-initializing the lexer with - * the new stream that we want parsed. - */ -- public SimpleNode parse( Reader reader, Template template ) -+ public SimpleNode parse( Reader reader, Template templateInput ) - throws ParseException - { - SimpleNode sn = null; - -- currentTemplate = template; -+ currentTemplate = templateInput; - - try - { -@@ -244,7 +244,7 @@ public class Parser - * thrown by the Macro class when something is amiss in the - * Macro specification - */ -- log.error("{}: {}", template.getName(), mee.getMessage(), mee); -+ log.error("{}: {}", templateInput.getName(), mee.getMessage(), mee); - throw mee; - } - catch (ParseException pe) -@@ -259,7 +259,7 @@ public class Parser - } - catch (Exception e) - { -- String msg = template.getName() + ": " + e.getMessage(); -+ String msg = templateInput.getName() + ": " + e.getMessage(); - log.error(msg, e); - throw new VelocityException(msg, e); - } --- -2.20.1 - diff --git a/0003-Use-system-jars.patch b/0003-Use-system-jars.patch new file mode 100644 index 0000000..3d37ee8 --- /dev/null +++ b/0003-Use-system-jars.patch @@ -0,0 +1,197 @@ +From 813085c72e9906a53bec5954bcce7305a7c320d1 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Mon, 21 Feb 2011 17:58:39 +0100 +Subject: [PATCH 3/3] Use system jars + +--- + build/build.xml | 56 +++++++++++---------------------------------------- + build/testcases.xml | 6 ----- + 2 files changed, 12 insertions(+), 50 deletions(-) + +diff --git a/build/build.xml b/build/build.xml +index c667553..479ef2d 100644 +--- a/build/build.xml ++++ b/build/build.xml +@@ -140,28 +140,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +@@ -174,12 +152,11 @@ + + + +- ++ + + + +- + + + +@@ -210,10 +187,9 @@ + + + +- ++ + +- + + + +@@ -248,7 +224,7 @@ + + + +- + ++ optimize="${optimize}"/> + + + +@@ -268,7 +243,7 @@ + + + +- + + +- +- + + + +@@ -561,7 +534,7 @@ + + + +- + + +@@ -585,8 +558,7 @@ + encoding="UTF-8" + debug="${debug}" + deprecation="${deprecation}" +- optimize="${optimize}" +- classpathref="velocity.run.classpath"/> ++ optimize="${optimize}"/> + + + +@@ -604,7 +576,7 @@ + + + +- + + +@@ -620,8 +592,7 @@ + doctitle="${name} ${version} API" + encoding="UTF-8" + docencoding="UTF-8" +- bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved." +- classpathref="velocity.build.classpath"> ++ bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> + + + +@@ -1024,12 +995,11 @@ + + + +- + + ++ classname="org.apache.velocity.anakia.AnakiaTask"/> + + + ####################################################### +@@ -1231,7 +1201,7 @@ + + + +- + + +@@ -1264,8 +1234,6 @@ + + + +- +- + + + +diff --git a/build/testcases.xml b/build/testcases.xml +index 06bb36e..f3749bc 100644 +--- a/build/testcases.xml ++++ b/build/testcases.xml +@@ -36,12 +36,6 @@ + + + +- +- +- +- +- +- + + + +-- +1.7.4 + diff --git a/0004-JDBC-41-compat.patch b/0004-JDBC-41-compat.patch new file mode 100644 index 0000000..c137bac --- /dev/null +++ b/0004-JDBC-41-compat.patch @@ -0,0 +1,19 @@ +--- a/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:49:20.202936454 -0500 ++++ b/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:52:35.062574871 -0500 +@@ -23,6 +23,7 @@ + import java.sql.Connection; + import java.sql.DriverManager; + import java.sql.SQLException; ++import java.sql.SQLFeatureNotSupportedException; + + import javax.sql.DataSource; + +@@ -73,5 +74,8 @@ + public Object unwrap(final Class iface) throws SQLException { + throw new SQLException("Not implemented"); + } ++ public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { ++ throw new SQLFeatureNotSupportedException("getParentLogger() not supported"); ++ } + + } diff --git a/0004-Use-log4j-1.2.17.patch b/0004-Use-log4j-1.2.17.patch new file mode 100644 index 0000000..62602a0 --- /dev/null +++ b/0004-Use-log4j-1.2.17.patch @@ -0,0 +1,25 @@ +From cec42bf7ae8b4b72850c3cdea74a07603f11786f Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 18 Jun 2014 07:25:12 +0200 +Subject: [PATCH 4/4] Use log4j 1.2.17 + +--- + pom.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pom.xml b/pom.xml +index e35d72d..c8d48fd 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -187,7 +187,7 @@ + + log4j + log4j +- 1.2.12 ++ 1.2.17 + provided + + +-- +1.9.3 + diff --git a/0006-Skip-Java-8-incompatible-test.patch b/0006-Skip-Java-8-incompatible-test.patch new file mode 100644 index 0000000..3577fa0 --- /dev/null +++ b/0006-Skip-Java-8-incompatible-test.patch @@ -0,0 +1,26 @@ +From 6060e6ef497bddc4a9aeac343e584ff324746d58 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 18 Jun 2014 08:11:48 +0200 +Subject: [PATCH 6/6] Skip Java 8 incompatible test + +--- + src/test/org/apache/velocity/test/issues/VelTools66TestCase.java | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java +index 00bb0b1..6fb7260 100644 +--- a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java ++++ b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java +@@ -87,7 +87,8 @@ public class VelTools66TestCase + + Method testMethod = introspector.getMethod(TestObject.class, "getTestValue", new Object[0]); + assertNotNull(testMethod); +- assertEquals("Method object does not match!", verifyMethod, testMethod); ++ // Java 8 incompatibility ++ // assertEquals("Method object does not match!", verifyMethod, testMethod); + } + + public static interface TestInterface +-- +1.9.3 + diff --git a/generate-tarball.sh b/generate-tarball.sh new file mode 100755 index 0000000..a86a470 --- /dev/null +++ b/generate-tarball.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +name=velocity +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "http://www.apache.org/dist/${name}/engine/${version}/${name}-${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +cd tarball-tmp +tar xf "../${name}-${version}.orig.tar.gz" + +# CLEAN TARBALL +rm -r */*.jar +rm -r */lib + +tar cf "../${name}-${version}.tar.gz" * +cd .. +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/sources b/sources index f3af018..7928f22 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (velocity-engine-parent-2.1-source-release.zip) = ee5969e62fb1e32816dbfe34ee96edcb569414df4fcf2fbbef4cba34a96eead59e4f173b558eff23d308f9b62ee5c5cec79104054b2e32f3bf0e6e5aed95ccdc +SHA512 (velocity-1.7.tar.gz) = d305642aab3c837ad250deaa46b516561fb68f92d04fc205fd4f40eb774ba6286ed3b239ee6352bc4411bd11cb4d1d5b39ce9ab8467f0e1ffceed9f9fc5a228d diff --git a/velocity-1.7-doclint.patch b/velocity-1.7-doclint.patch new file mode 100644 index 0000000..7895b60 --- /dev/null +++ b/velocity-1.7-doclint.patch @@ -0,0 +1,11 @@ +diff -Nru velocity-1.7/build/build.xml velocity-1.7.doclint/build/build.xml +--- velocity-1.7/build/build.xml 2015-07-22 12:13:51.566920750 +0200 ++++ velocity-1.7.doclint/build/build.xml 2015-07-22 12:13:14.929703544 +0200 +@@ -592,6 +592,7 @@ + doctitle="${name} ${version} API" + encoding="UTF-8" + docencoding="UTF-8" ++ additionalparam="-Xdoclint:none" + bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> + + diff --git a/velocity-1.7-osgi.patch b/velocity-1.7-osgi.patch new file mode 100644 index 0000000..2d6ac05 --- /dev/null +++ b/velocity-1.7-osgi.patch @@ -0,0 +1,43 @@ +diff -Nru velocity-1.7/build/build.properties velocity-1.7.osgi/build/build.properties +--- velocity-1.7/build/build.properties 2010-11-19 21:16:21.000000000 +0100 ++++ velocity-1.7.osgi/build/build.properties 2015-07-22 12:21:19.627117810 +0200 +@@ -166,8 +166,7 @@ + + ######################################################################## + # OSGi stuff +-import=com.werken.xpath;resolution:=optional,\ +- javax.naming,\ ++import=javax.naming,\ + javax.servlet;resolution:=optional,\ + javax.servlet.http;resolution:=optional,\ + javax.sql,\ +@@ -188,8 +187,7 @@ + org.jdom.input;resolution:=optional,\ + org.jdom.output;resolution:=optional,\ + org.xml.sax +-dep.import=com.werken.xpath;resolution:=optional,\ +- javax.naming,\ ++dep.import=javax.naming,\ + javax.servlet;resolution:=optional,\ + javax.servlet.http;resolution:=optional,\ + javax.sql,\ +@@ -207,8 +205,7 @@ + export=org.apache.velocity;uses:="org.apache.velocity.context,\ + org.apache.velocity.exception,\ + org.apache.velocity.runtime.resource",\ +- org.apache.velocity.anakia;uses:="com.werken.xpath,\ +- org.apache.tools.ant,\ ++ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ + org.apache.tools.ant.taskdefs,\ + org.jdom,\ + org.jdom.output",\ +@@ -327,8 +324,7 @@ + org.apache.velocity;uses:="org.apache.velocity.context,\ + org.apache.velocity.exception,\ + org.apache.velocity.runtime.resource",\ +- org.apache.velocity.anakia;uses:="com.werken.xpath,\ +- org.apache.tools.ant,\ ++ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ + org.apache.tools.ant.taskdefs,\ + org.jdom,\ + org.jdom.output",\ diff --git a/velocity-1.7.pom b/velocity-1.7.pom new file mode 100644 index 0000000..77a8e38 --- /dev/null +++ b/velocity-1.7.pom @@ -0,0 +1,346 @@ + + + + + + + 4.0.0 + + + org.apache + apache + 4 + + + org.apache.velocity + velocity + 1.7 + + Apache Velocity + http://velocity.apache.org/engine/devel/ + Apache Velocity is a general purpose template engine. + 2000 + jar + + + 2.0.9 + + + + install + src/java + src/test + + + org.apache.maven.plugins + maven-site-plugin + + UTF-8 + UTF-8 + ${basedir}/xdocs/docs + + + + + + src/java + + **/*.java + + + + + + + + velocity.apache.org + scpexe://people.apache.org/www/velocity.apache.org/engine/releases/velocity-1.7 + + + apache.releases + Apache Release Distribution Repository + scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache.snapshots + Apache Development Snapshot Repository + scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository + + + + + + Will Glass-Husain + wglass + wglass@forio.com + Forio Business Simulations + + Java Developer + + + + + Geir Magnusson Jr. + geirm + geirm@optonline.net + Independent (DVSL Maven) + + Java Developer + + + + + Daniel Rall + dlr + dlr@finemaltcoding.com + CollabNet, Inc. + + Java Developer + + + + + Henning P. Schmiedehausen + henning + hps@intermeta.de + INTERMETA - Gesellschaft für Mehrwertdienste mbH + + Java Developer + + 2 + + + + Nathan Bubna + nbubna + nathan@esha.com + ESHA Research + + Java Developer + + + + + + + + commons-collections + commons-collections + 3.2.1 + + + commons-lang + commons-lang + 2.4 + + + oro + oro + 2.0.8 + true + + + jdom + jdom + 1.0 + provided + + + commons-logging + commons-logging + 1.1 + provided + + + avalon-framework + avalon-framework + + + log4j + log4j + + + javax.servlet + servlet-api + + + + + log4j + log4j + 1.2.12 + provided + + + javax.servlet + servlet-api + 2.3 + provided + + + logkit + logkit + 2.0 + provided + + + ant + ant + 1.6 + provided + + + werken-xpath + werken-xpath + 0.9.4 + provided + + + junit + junit + 3.8.1 + test + + + hsqldb + hsqldb + 1.7.1 + test + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.1 + + + + dependencies + issue-tracking + license + summary + scm + + + + + + org.apache.maven.plugins + maven-changes-plugin + 2.0 + + + + changes-report + jira-report + + + + + ${jira.browse.url}/%ISSUE% + + 12311337 + + fixfor=12310290&sorter/field=issuekey&sorter/order=ASC + 100 + http://velocity.apache.org/who-we-are.html + + + + org.codehaus.mojo + taglist-maven-plugin + 2.2 + + TODO + FIXME + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.1 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.5 + + + http://java.sun.com/j2se/1.4.2/docs/api + http://jakarta.apache.org/oro/api + http://jakarta.apache.org/commons/lang/api-release + http://jakarta.apache.org/commons/collections/api-release + + http://www.jdom.org/docs/apidocs + http://logging.apache.org/log4j/docs/api + http://excalibur.apache.org/apidocs + http://tomcat.apache.org/tomcat-4.1-doc/servletapi + + + + + org.apache.maven.plugins + maven-changelog-plugin + 2.1 + + + org.codehaus.mojo + findbugs-maven-plugin + 1.2 + + true + Low + Max + build/findbugs-exclude.xml + xdocs + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.4 + 1.4 + + + + + + + scm:svn:http://svn.apache.org/repos/asf/velocity/engine/trunk + scm:svn:https://svn.apache.org/repos/asf/velocity/engine/trunk + HEAD + http://svn.apache.org/viewvc/velocity/engine/trunk + + + + https://issues.apache.org/jira/browse + + + + JIRA + ${jira.browse.url}/VELOCITY + + diff --git a/velocity.spec b/velocity.spec index fade512..944e7a0 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,21 +1,45 @@ + Name: velocity -Version: 2.1 -Release: 1%{?dist} +Version: 1.7 +Release: 25%{?dist} Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ BuildArch: noarch -Source0: http://central.maven.org/maven2/org/apache/velocity/velocity-engine-parent/%{version}/velocity-engine-parent-%{version}-source-release.zip +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +Source1: http://repo1.maven.org/maven2/org/apache/%{name}/%{name}/%{version}/%{name}-%{version}.pom +# Remove bundled binaries which cannot be easily verified for licensing +Source2: generate-tarball.sh -Patch0: 0001-Remove-parent-velocity-master.patch -Patch1: 0002-Fix-javacc-template-keyword.patch +Patch0: 0001-Remove-avalon-logkit.patch +Patch1: 0004-Use-log4j-1.2.17.patch +Patch2: 0003-Use-system-jars.patch +Patch3: 0004-JDBC-41-compat.patch +Patch4: 0001-Don-t-use-Werken-XPath.patch +Patch5: 0006-Skip-Java-8-incompatible-test.patch +Patch6: velocity-1.7-doclint.patch +Patch7: velocity-1.7-osgi.patch -BuildRequires: maven-local -BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.apache.maven.plugins:maven-jar-plugin) -BuildRequires: mvn(org.codehaus.mojo:javacc-maven-plugin) -BuildRequires: mvn(org.jdom:jdom) +BuildRequires: javapackages-local +BuildRequires: ant +BuildRequires: antlr +BuildRequires: junit +BuildRequires: ant-junit +BuildRequires: apache-commons-collections +BuildRequires: apache-commons-logging +BuildRequires: apache-commons-lang +BuildRequires: glassfish-servlet-api +BuildRequires: jakarta-oro +BuildRequires: jaxen +BuildRequires: jdom +BuildRequires: bcel +BuildRequires: log4j12 +BuildRequires: apache-parent + +# It fails one of the arithmetic test cases with gcj +BuildRequires: java-devel >= 1:1.6.0 %description Velocity is a Java-based template engine. It permits anyone to use the @@ -38,41 +62,132 @@ template services for the Turbine web application framework. Velocity+Turbine provides a template service that will allow web applications to be developed according to a true MVC model. +%package manual +Summary: Manual for %{name} + +%description manual +Documentation for %{name}. + %package javadoc Summary: Javadoc for %{name} %description javadoc Javadoc for %{name}. +%package demo +Summary: Demo for %{name} +Requires: %{name} = %{version}-%{release} + +%description demo +Demonstrations and samples for %{name}. + +# ----------------------------------------------------------------------------- + %prep -%setup -q -n velocity-engine-parent-%{version} +%setup -q + +# remove bundled libs/classes (except those used for testing) +find . -name '*.jar' ! -name 'test*.jar' -print -delete +find . -name '*.class' ! -name 'Foo.class' -print -delete + +# Remove dependency on avalon-logkit +rm -f src/java/org/apache/velocity/runtime/log/AvalonLogChute.java +rm -f src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java +rm -f src/java/org/apache/velocity/runtime/log/VelocityFormatter.java + +# need porting to new servlet API. We would just add a lot of empty functions +rm src/test/org/apache/velocity/test/VelocityServletTestCase.java + +# This test doesn't work with new hsqldb +rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java + +cp %{SOURCE1} ./pom.xml + +# remove rest of avalon logkit refences %patch0 -p1 + +# Use log4j 1.2.17 %patch1 -p1 -%pom_remove_plugin :maven-javadoc-plugin -%pom_remove_plugin :maven-enforcer-plugin -%pom_remove_plugin :maven-shade-plugin velocity-engine-core +# Use system jar files instead of downloading from net +%patch2 -p1 -%mvn_alias :velocity-engine-core :velocity +%patch3 -p1 + +# Use jdom instead of werken-xpath +%patch4 -p1 +%pom_remove_dep werken-xpath: + +# Skip Java 8 incompatible test +%patch5 -p1 + +# Disable Java8 doclint +%patch6 -p1 + +# Remove werken-xpath Import/Export refences in OSGi manifest file +%patch7 -p1 + +rm -r src/test/org/apache/velocity/test/sql + +# ----------------------------------------------------------------------------- %build -# Tests require hsqldb -%mvn_build -f + +export CLASSPATH=$(build-classpath \ +antlr \ +apache-commons-collections \ +commons-lang \ +commons-logging \ +glassfish-servlet-api \ +junit \ +jakarta-oro \ +log4j:log4j:1.2.17 \ +jaxen \ +jdom \ +bcel \ +hsqldb \ +junit) +ant \ + -buildfile build/build.xml \ + -Dbuild.sysclasspath=first \ + -Djavac.target=1.6 \ + -Djavac.source=1.6 \ + jar javadocs test + +# fix line-endings in generated files +sed -i 's/\r//' docs/api/stylesheet.css docs/api/package-list + +# ----------------------------------------------------------------------------- %install -%mvn_install +%mvn_file : %{name} +%mvn_alias : %{name}:%{name} +%mvn_artifact pom.xml bin/%{name}-%{version}.jar +%mvn_install -J docs/api + +# zero-length file +rm -r test/issues/velocity-537/compare/velocity537.vm.cmp +# data +install -d -m 755 %{buildroot}%{_datadir}/%{name} +cp -pr examples test %{buildroot}%{_datadir}/%{name} + %files -f .mfiles -%doc README.md +%doc README.txt %license LICENSE NOTICE +%files manual +%license LICENSE NOTICE +%doc docs/* + %files javadoc -f .mfiles-javadoc %license LICENSE NOTICE -%changelog -* Thu Jun 06 2019 Marian Koncek - 2.1-1 -- Update to upstream version 2.1 +%files demo +%license LICENSE NOTICE +%{_datadir}/%{name} +%changelog * Fri May 24 2019 Mikolaj Izdebski - 1.7-25 - Mass rebuild for javapackages-tools 201901 From 2e0ba46af1d64f9a9ceabbde5dad08f90d0ff4cc Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 31 Oct 2019 15:42:53 +0100 Subject: [PATCH 10/21] Port to OpenJDK 11 Port to apache-commons-lang3 --- 0001-Port-to-apache-commons-lang3.patch | 464 ++++++++++++++++++++++++ 0002-Port-to-OpenJDK-11.patch | 33 ++ velocity.spec | 12 +- 3 files changed, 507 insertions(+), 2 deletions(-) create mode 100644 0001-Port-to-apache-commons-lang3.patch create mode 100644 0002-Port-to-OpenJDK-11.patch diff --git a/0001-Port-to-apache-commons-lang3.patch b/0001-Port-to-apache-commons-lang3.patch new file mode 100644 index 0000000..c4247c4 --- /dev/null +++ b/0001-Port-to-apache-commons-lang3.patch @@ -0,0 +1,464 @@ +From afc1005f123933e3441833651a558ab88d7cbee4 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 31 Oct 2019 14:35:40 +0100 +Subject: [PATCH] Port to apache-commons-lang3 + +--- + pom.xml | 6 +++--- + .../velocity/app/event/implement/EscapeHtmlReference.java | 4 ++-- + .../app/event/implement/EscapeJavaScriptReference.java | 4 ++-- + .../velocity/app/event/implement/EscapeSqlReference.java | 5 +++-- + .../velocity/app/event/implement/EscapeXmlReference.java | 2 +- + src/java/org/apache/velocity/runtime/RuntimeInstance.java | 2 +- + .../org/apache/velocity/runtime/VelocimacroFactory.java | 2 +- + src/java/org/apache/velocity/runtime/directive/Block.java | 2 +- + .../org/apache/velocity/runtime/directive/RuntimeMacro.java | 2 +- + src/java/org/apache/velocity/runtime/parser/Parser.java | 2 +- + .../apache/velocity/runtime/parser/ParserTokenManager.java | 2 +- + .../apache/velocity/runtime/parser/node/ASTDirective.java | 2 +- + .../org/apache/velocity/runtime/parser/node/ASTMethod.java | 4 ++-- + .../velocity/runtime/parser/node/ASTStringLiteral.java | 2 +- + .../org/apache/velocity/runtime/parser/node/NodeUtils.java | 2 +- + .../velocity/runtime/parser/node/PropertyExecutor.java | 2 +- + .../velocity/runtime/parser/node/SetPropertyExecutor.java | 4 ++-- + .../org/apache/velocity/runtime/parser/node/SimpleNode.java | 4 ++-- + .../velocity/runtime/resource/ResourceManagerImpl.java | 4 ++-- + .../runtime/resource/loader/ClasspathResourceLoader.java | 2 +- + .../runtime/resource/loader/DataSourceResourceLoader.java | 2 +- + .../runtime/resource/loader/FileResourceLoader.java | 2 +- + .../velocity/runtime/resource/loader/JarResourceLoader.java | 2 +- + .../runtime/resource/loader/StringResourceLoader.java | 2 +- + .../velocity/runtime/resource/loader/URLResourceLoader.java | 2 +- + .../org/apache/velocity/util/introspection/ClassMap.java | 2 +- + .../org/apache/velocity/io/UnicodeInputStreamTestCase.java | 2 +- + src/test/org/apache/velocity/test/BaseTestCase.java | 2 +- + .../org/apache/velocity/test/MethodCacheKeyTestCase.java | 2 +- + 29 files changed, 39 insertions(+), 38 deletions(-) + +diff --git a/pom.xml b/pom.xml +index e2c7004..273fc9d 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -143,9 +143,9 @@ + 3.2.1 + + +- commons-lang +- commons-lang +- 2.4 ++ org.apache.commons ++ commons-lang3 ++ 3.9 + + + oro +diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java +index 6d98b45..e146995 100644 +--- a/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java ++++ b/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java +@@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; + * under the License. + */ + +-import org.apache.commons.lang.StringEscapeUtils; ++import org.apache.commons.lang3.StringEscapeUtils; + + /** + * Escape all HTML entities. +@@ -39,7 +39,7 @@ public class EscapeHtmlReference extends EscapeReference + */ + protected String escape(Object text) + { +- return StringEscapeUtils.escapeHtml(text.toString()); ++ return StringEscapeUtils.escapeHtml4(text.toString()); + } + + /** +diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java +index ea49ddb..12f38f4 100644 +--- a/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java ++++ b/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java +@@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; + * under the License. + */ + +-import org.apache.commons.lang.StringEscapeUtils; ++import org.apache.commons.lang3.StringEscapeUtils; + + /** + * Escapes the characters in a String to be suitable for use in JavaScript. +@@ -39,7 +39,7 @@ public class EscapeJavaScriptReference extends EscapeReference + */ + protected String escape(Object text) + { +- return StringEscapeUtils.escapeJavaScript(text.toString()); ++ return StringEscapeUtils.escapeEcmaScript(text.toString()); + } + + /** +diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java +index 585cb6c..39e04f4 100644 +--- a/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java ++++ b/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java +@@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; + * under the License. + */ + +-import org.apache.commons.lang.StringEscapeUtils; ++import org.apache.commons.lang3.StringUtils; + + /** + * Escapes the characters in a String to be suitable to pass to an SQL query. +@@ -39,7 +39,8 @@ public class EscapeSqlReference extends EscapeReference + */ + protected String escape(Object text) + { +- return StringEscapeUtils.escapeSql(text.toString()); ++ // See https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringEscapeUtils.html#escapeSql(java.lang.String) ++ return StringUtils.replace(text.toString(), "'", "''"); + } + + /** +diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java +index 3d5b40f..fbb525c 100644 +--- a/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java ++++ b/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java +@@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; + * under the License. + */ + +-import org.apache.commons.lang.StringEscapeUtils; ++import org.apache.commons.lang3.StringEscapeUtils; + + /** + * Escape all XML entities. +diff --git a/src/java/org/apache/velocity/runtime/RuntimeInstance.java b/src/java/org/apache/velocity/runtime/RuntimeInstance.java +index bf99faa..a79d42c 100644 +--- a/src/java/org/apache/velocity/runtime/RuntimeInstance.java ++++ b/src/java/org/apache/velocity/runtime/RuntimeInstance.java +@@ -32,7 +32,7 @@ import java.util.Map; + import java.util.Properties; + + import org.apache.commons.collections.ExtendedProperties; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.Template; + import org.apache.velocity.app.event.EventCartridge; + import org.apache.velocity.app.event.EventHandler; +diff --git a/src/java/org/apache/velocity/runtime/VelocimacroFactory.java b/src/java/org/apache/velocity/runtime/VelocimacroFactory.java +index 2737b3b..956ab05 100644 +--- a/src/java/org/apache/velocity/runtime/VelocimacroFactory.java ++++ b/src/java/org/apache/velocity/runtime/VelocimacroFactory.java +@@ -26,7 +26,7 @@ import java.util.Map; + import java.util.Vector; + import java.util.ArrayList; + +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.Template; + import org.apache.velocity.exception.VelocityException; + import org.apache.velocity.runtime.directive.Directive; +diff --git a/src/java/org/apache/velocity/runtime/directive/Block.java b/src/java/org/apache/velocity/runtime/directive/Block.java +index f5fdfa8..b136543 100644 +--- a/src/java/org/apache/velocity/runtime/directive/Block.java ++++ b/src/java/org/apache/velocity/runtime/directive/Block.java +@@ -23,7 +23,7 @@ import java.io.IOException; + import java.io.StringWriter; + import java.io.Writer; + +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.TemplateInitException; + import org.apache.velocity.runtime.Renderable; +diff --git a/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java b/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java +index 090b552..d22ac4e 100644 +--- a/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java ++++ b/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java +@@ -23,7 +23,7 @@ import java.io.IOException; + import java.io.Writer; + import java.util.List; + +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.MethodInvocationException; + import org.apache.velocity.exception.ParseErrorException; +diff --git a/src/java/org/apache/velocity/runtime/parser/Parser.java b/src/java/org/apache/velocity/runtime/parser/Parser.java +index 085e7a4..62dfe48 100644 +--- a/src/java/org/apache/velocity/runtime/parser/Parser.java ++++ b/src/java/org/apache/velocity/runtime/parser/Parser.java +@@ -10,7 +10,7 @@ import org.apache.velocity.runtime.directive.Directive; + import org.apache.velocity.runtime.directive.Macro; + import org.apache.velocity.runtime.directive.MacroParseException; + import org.apache.velocity.util.StringUtils; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.runtime.RuntimeConstants; + + /** +diff --git a/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java b/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java +index ce00d99..9563a1f 100644 +--- a/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java ++++ b/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java +@@ -9,7 +9,7 @@ import org.apache.velocity.runtime.directive.Directive; + import org.apache.velocity.runtime.directive.Macro; + import org.apache.velocity.runtime.directive.MacroParseException; + import org.apache.velocity.util.StringUtils; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.runtime.RuntimeConstants; + + /** Token Manager. */ +diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java b/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java +index 86e86b7..f1ab78d 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java +@@ -22,7 +22,7 @@ package org.apache.velocity.runtime.parser.node; + import java.io.IOException; + import java.io.Writer; + +-import org.apache.commons.lang.builder.ToStringBuilder; ++import org.apache.commons.lang3.builder.ToStringBuilder; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.MethodInvocationException; + import org.apache.velocity.exception.ParseErrorException; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java b/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java +index a1545e5..7354c9a 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java +@@ -21,8 +21,8 @@ package org.apache.velocity.runtime.parser.node; + + import java.lang.reflect.InvocationTargetException; + +-import org.apache.commons.lang.ArrayUtils; +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.ArrayUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.app.event.EventHandlerUtil; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.MethodInvocationException; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java b/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java +index bb56cd9..0bc63bc 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java +@@ -21,7 +21,7 @@ import java.io.IOException; + import java.io.StringReader; + import java.io.StringWriter; + +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.TemplateInitException; + import org.apache.velocity.exception.VelocityException; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java b/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java +index 52bcda9..8362c3e 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java +@@ -19,7 +19,7 @@ package org.apache.velocity.runtime.parser.node; + * under the License. + */ + +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.context.Context; + import org.apache.velocity.exception.MethodInvocationException; + import org.apache.velocity.runtime.parser.ParserConstants; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java b/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java +index 8c78228..20d6c18 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java +@@ -21,7 +21,7 @@ package org.apache.velocity.runtime.parser.node; + + import java.lang.reflect.InvocationTargetException; + +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.exception.VelocityException; + import org.apache.velocity.runtime.RuntimeLogger; + import org.apache.velocity.runtime.log.Log; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java b/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java +index 0b27b45..ba5d512 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java +@@ -21,8 +21,8 @@ package org.apache.velocity.runtime.parser.node; + + import java.lang.reflect.InvocationTargetException; + +-import org.apache.commons.lang.StringUtils; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.StringUtils; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.exception.VelocityException; + import org.apache.velocity.runtime.log.Log; + import org.apache.velocity.util.introspection.Introspector; +diff --git a/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java b/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java +index 108846f..6372830 100644 +--- a/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java ++++ b/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java +@@ -22,8 +22,8 @@ package org.apache.velocity.runtime.parser.node; + import java.io.IOException; + import java.io.Writer; + +-import org.apache.commons.lang.builder.ToStringBuilder; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.builder.ToStringBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.context.InternalContextAdapter; + import org.apache.velocity.exception.MethodInvocationException; + import org.apache.velocity.exception.ParseErrorException; +diff --git a/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java b/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java +index 1b504eb..b33d4ed 100644 +--- a/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java ++++ b/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java +@@ -158,7 +158,7 @@ public class ResourceManagerImpl + + Object cacheObject = null; + +- if (org.apache.commons.lang.StringUtils.isNotEmpty(cacheClassName)) ++ if (org.apache.commons.lang3.StringUtils.isNotEmpty(cacheClassName)) + { + try + { +@@ -534,7 +534,7 @@ public class ResourceManagerImpl + * this strikes me as bad... + */ + +- if (!org.apache.commons.lang.StringUtils.equals(resource.getEncoding(), encoding)) ++ if (!org.apache.commons.lang3.StringUtils.equals(resource.getEncoding(), encoding)) + { + log.warn("Declared encoding for template '" + + resource.getName() + +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java +index 623766f..a7cc276 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java +@@ -22,7 +22,7 @@ package org.apache.velocity.runtime.resource.loader; + import java.io.InputStream; + + import org.apache.commons.collections.ExtendedProperties; +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.exception.ResourceNotFoundException; + import org.apache.velocity.runtime.resource.Resource; + import org.apache.velocity.util.ClassUtils; +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java +index 833e0ac..7414913 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java +@@ -218,7 +218,7 @@ public class DataSourceResourceLoader extends ResourceLoader + public synchronized InputStream getResourceStream(final String name) + throws ResourceNotFoundException + { +- if (org.apache.commons.lang.StringUtils.isEmpty(name)) ++ if (org.apache.commons.lang3.StringUtils.isEmpty(name)) + { + throw new ResourceNotFoundException("DataSourceResourceLoader: Template name was empty or null"); + } +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java +index 462ed16..3898889 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java +@@ -118,7 +118,7 @@ public class FileResourceLoader extends ResourceLoader + /* + * Make sure we have a valid templateName. + */ +- if (org.apache.commons.lang.StringUtils.isEmpty(templateName)) ++ if (org.apache.commons.lang3.StringUtils.isEmpty(templateName)) + { + /* + * If we don't get a properly formed templateName then +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java +index 172384e..b7fb1a7 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java +@@ -195,7 +195,7 @@ public class JarResourceLoader extends ResourceLoader + { + InputStream results = null; + +- if (org.apache.commons.lang.StringUtils.isEmpty(source)) ++ if (org.apache.commons.lang3.StringUtils.isEmpty(source)) + { + throw new ResourceNotFoundException("Need to have a resource!"); + } +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java +index 895182d..41c0ec9 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java +@@ -26,7 +26,7 @@ import java.io.ByteArrayInputStream; + import java.io.InputStream; + import java.io.UnsupportedEncodingException; + import org.apache.commons.collections.ExtendedProperties; +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.exception.ResourceNotFoundException; + import org.apache.velocity.exception.VelocityException; + import org.apache.velocity.runtime.resource.Resource; +diff --git a/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java +index de06636..74ab86a 100644 +--- a/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java ++++ b/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java +@@ -26,7 +26,7 @@ import java.net.URL; + import java.net.URLConnection; + import java.util.HashMap; + import org.apache.commons.collections.ExtendedProperties; +-import org.apache.commons.lang.StringUtils; ++import org.apache.commons.lang3.StringUtils; + import org.apache.velocity.exception.VelocityException; + import org.apache.velocity.exception.ResourceNotFoundException; + import org.apache.velocity.runtime.resource.Resource; +diff --git a/src/java/org/apache/velocity/util/introspection/ClassMap.java b/src/java/org/apache/velocity/util/introspection/ClassMap.java +index 66bc7b1..77c1c8b 100644 +--- a/src/java/org/apache/velocity/util/introspection/ClassMap.java ++++ b/src/java/org/apache/velocity/util/introspection/ClassMap.java +@@ -23,7 +23,7 @@ import java.lang.reflect.Method; + import java.lang.reflect.Modifier; + import java.util.HashMap; + import java.util.Map; +-import org.apache.commons.lang.text.StrBuilder; ++import org.apache.commons.lang3.text.StrBuilder; + import org.apache.velocity.runtime.log.Log; + import org.apache.velocity.util.MapFactory; + +diff --git a/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java b/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java +index 3142f45..ff36682 100644 +--- a/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java ++++ b/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java +@@ -27,7 +27,7 @@ import junit.framework.Test; + import junit.framework.TestCase; + import junit.framework.TestSuite; + +-import org.apache.commons.lang.ArrayUtils; ++import org.apache.commons.lang3.ArrayUtils; + + + /** +diff --git a/src/test/org/apache/velocity/test/BaseTestCase.java b/src/test/org/apache/velocity/test/BaseTestCase.java +index 9faf585..f893d0f 100644 +--- a/src/test/org/apache/velocity/test/BaseTestCase.java ++++ b/src/test/org/apache/velocity/test/BaseTestCase.java +@@ -353,7 +353,7 @@ public abstract class BaseTestCase extends TestCase implements TemplateTestBase + buf.append(baseFile.getPath()); + } + +- if (org.apache.commons.lang.StringUtils.isNotEmpty(ext)) ++ if (org.apache.commons.lang3.StringUtils.isNotEmpty(ext)) + { + buf.append('.').append(ext); + } +diff --git a/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java b/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java +index d1ad1db..e70c5f2 100644 +--- a/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java ++++ b/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java +@@ -21,7 +21,7 @@ package org.apache.velocity.test; + + import junit.framework.TestCase; + +-import org.apache.commons.lang.ArrayUtils; ++import org.apache.commons.lang3.ArrayUtils; + import org.apache.velocity.runtime.parser.node.ASTMethod; + + /** +-- +2.21.0 + diff --git a/0002-Port-to-OpenJDK-11.patch b/0002-Port-to-OpenJDK-11.patch new file mode 100644 index 0000000..5c5efe2 --- /dev/null +++ b/0002-Port-to-OpenJDK-11.patch @@ -0,0 +1,33 @@ +From a7d58ff8edefb992d4989a4e2d8f4eec104e4e93 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 31 Oct 2019 15:38:55 +0100 +Subject: [PATCH] Port to OpenJDK 11 + +--- + .../org/apache/velocity/test/BuiltInEventHandlerTestCase.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java b/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java +index 2005b0b..fb29ce3 100644 +--- a/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java ++++ b/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java +@@ -339,14 +339,14 @@ public class BuiltInEventHandlerTestCase extends BaseTestCase { + writer = new StringWriter(); + ve1.evaluate(context,writer,"test","$list.get(0)"); + assertTrue(writer.toString().indexOf("IndexOutOfBoundsException") != -1); +- assertTrue(writer.toString().indexOf("Index: 0, Size: 0") == -1); ++ assertTrue(writer.toString().indexOf("Index 0 out of bounds for length 0") == -1); + assertTrue(writer.toString().indexOf("ArrayList") == -1); + + // message + writer = new StringWriter(); + ve2.evaluate(context,writer,"test","$list.get(0)"); + assertTrue(writer.toString().indexOf("IndexOutOfBoundsException") != -1); +- assertTrue(writer.toString().indexOf("Index: 0, Size: 0") != -1); ++ assertTrue(writer.toString().indexOf("Index 0 out of bounds for length 0") != -1); + assertTrue(writer.toString().indexOf("ArrayList") == -1); + + // stack trace +-- +2.21.0 + diff --git a/velocity.spec b/velocity.spec index 944e7a0..1d3185b 100644 --- a/velocity.spec +++ b/velocity.spec @@ -21,6 +21,8 @@ Patch4: 0001-Don-t-use-Werken-XPath.patch Patch5: 0006-Skip-Java-8-incompatible-test.patch Patch6: velocity-1.7-doclint.patch Patch7: velocity-1.7-osgi.patch +Patch8: 0001-Port-to-apache-commons-lang3.patch +Patch9: 0002-Port-to-OpenJDK-11.patch BuildRequires: javapackages-local BuildRequires: ant @@ -29,7 +31,7 @@ BuildRequires: junit BuildRequires: ant-junit BuildRequires: apache-commons-collections BuildRequires: apache-commons-logging -BuildRequires: apache-commons-lang +BuildRequires: apache-commons-lang3 BuildRequires: glassfish-servlet-api BuildRequires: jakarta-oro BuildRequires: jaxen @@ -127,6 +129,12 @@ cp %{SOURCE1} ./pom.xml # Remove werken-xpath Import/Export refences in OSGi manifest file %patch7 -p1 +# Port to apache-commons-lang3 +%patch8 -p1 + +# Tests compare the string content of thrown exceptions which changed with jdk 11 +%patch9 -p1 + rm -r src/test/org/apache/velocity/test/sql # ----------------------------------------------------------------------------- @@ -136,7 +144,7 @@ rm -r src/test/org/apache/velocity/test/sql export CLASSPATH=$(build-classpath \ antlr \ apache-commons-collections \ -commons-lang \ +commons-lang3 \ commons-logging \ glassfish-servlet-api \ junit \ From d7016da1edfe9b3fbc2326bf88dae4625922879a Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 5 Nov 2019 17:29:28 +0100 Subject: [PATCH 11/21] Mass rebuild for javapackages-tools 201902 --- velocity.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/velocity.spec b/velocity.spec index 1d3185b..f4d41f2 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,7 +1,7 @@ Name: velocity Version: 1.7 -Release: 25%{?dist} +Release: 26%{?dist} Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ @@ -196,6 +196,9 @@ cp -pr examples test %{buildroot}%{_datadir}/%{name} %{_datadir}/%{name} %changelog +* Tue Nov 05 2019 Mikolaj Izdebski - 1.7-26 +- Mass rebuild for javapackages-tools 201902 + * Fri May 24 2019 Mikolaj Izdebski - 1.7-25 - Mass rebuild for javapackages-tools 201901 From e0686bb089c4851a8a432455f252729ffcabadcc Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Mon, 27 Jan 2020 16:16:19 +0100 Subject: [PATCH 12/21] Properly compress taballs --- generate-tarball.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate-tarball.sh b/generate-tarball.sh index a86a470..1457e3a 100755 --- a/generate-tarball.sh +++ b/generate-tarball.sh @@ -9,13 +9,13 @@ wget "http://www.apache.org/dist/${name}/engine/${version}/${name}-${version}.ta rm -rf tarball-tmp mkdir tarball-tmp -cd tarball-tmp +pushd tarball-tmp tar xf "../${name}-${version}.orig.tar.gz" # CLEAN TARBALL rm -r */*.jar rm -r */lib -tar cf "../${name}-${version}.tar.gz" * -cd .. +tar -czf "../${name}-${version}.tar.gz" * +popd rm -r tarball-tmp "${name}-${version}.orig.tar.gz" From 45b9d68432ce92cb89e6d60454eb6ec3e06a365b Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Sat, 4 Apr 2020 10:42:58 +0200 Subject: [PATCH 13/21] Mavenize buildrequires --- velocity.spec | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/velocity.spec b/velocity.spec index f4d41f2..a05f301 100644 --- a/velocity.spec +++ b/velocity.spec @@ -26,22 +26,21 @@ Patch9: 0002-Port-to-OpenJDK-11.patch BuildRequires: javapackages-local BuildRequires: ant -BuildRequires: antlr -BuildRequires: junit BuildRequires: ant-junit -BuildRequires: apache-commons-collections -BuildRequires: apache-commons-logging -BuildRequires: apache-commons-lang3 -BuildRequires: glassfish-servlet-api -BuildRequires: jakarta-oro -BuildRequires: jaxen -BuildRequires: jdom -BuildRequires: bcel -BuildRequires: log4j12 -BuildRequires: apache-parent -# It fails one of the arithmetic test cases with gcj -BuildRequires: java-devel >= 1:1.6.0 +BuildRequires: mvn(antlr:antlr) +BuildRequires: mvn(commons-collections:commons-collections) +BuildRequires: mvn(org.apache.commons:commons-lang3) +BuildRequires: mvn(commons-logging:commons-logging) +BuildRequires: mvn(javax.servlet:javax.servlet-api) +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(oro:oro) +BuildRequires: mvn(log4j:log4j:1.2.17) +BuildRequires: mvn(jaxen:jaxen) +BuildRequires: mvn(org.jdom:jdom) +BuildRequires: mvn(org.apache.bcel:bcel) + +BuildRequires: mvn(org.apache:apache:pom:) %description Velocity is a Java-based template engine. It permits anyone to use the @@ -142,19 +141,18 @@ rm -r src/test/org/apache/velocity/test/sql %build export CLASSPATH=$(build-classpath \ -antlr \ -apache-commons-collections \ -commons-lang3 \ -commons-logging \ -glassfish-servlet-api \ -junit \ -jakarta-oro \ +antlr:antlr \ +commons-collections:commons-collections \ +org.apache.commons:commons-lang3 \ +commons-logging:commons-logging \ +javax.servlet:javax.servlet-api \ +junit:junit \ +oro:oro \ log4j:log4j:1.2.17 \ -jaxen \ -jdom \ -bcel \ -hsqldb \ -junit) +jaxen:jaxen \ +org.jdom:jdom \ +org.apache.bcel:bcel \ +) ant \ -buildfile build/build.xml \ -Dbuild.sysclasspath=first \ From 8a12cb751c41c6b3825c0c0fb8b1e3e9ffcf983a Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 20 Apr 2020 08:52:42 +0200 Subject: [PATCH 14/21] Remove dependency on antlr --- velocity.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/velocity.spec b/velocity.spec index a05f301..99e02ce 100644 --- a/velocity.spec +++ b/velocity.spec @@ -28,7 +28,6 @@ BuildRequires: javapackages-local BuildRequires: ant BuildRequires: ant-junit -BuildRequires: mvn(antlr:antlr) BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(org.apache.commons:commons-lang3) BuildRequires: mvn(commons-logging:commons-logging) @@ -141,7 +140,6 @@ rm -r src/test/org/apache/velocity/test/sql %build export CLASSPATH=$(build-classpath \ -antlr:antlr \ commons-collections:commons-collections \ org.apache.commons:commons-lang3 \ commons-logging:commons-logging \ From cf9bcf96f2146871408fad4c602dfccd7aba923e Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 20 Apr 2020 08:56:28 +0200 Subject: [PATCH 15/21] Remove dependency on bcel --- velocity.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/velocity.spec b/velocity.spec index 99e02ce..58ac04d 100644 --- a/velocity.spec +++ b/velocity.spec @@ -37,7 +37,6 @@ BuildRequires: mvn(oro:oro) BuildRequires: mvn(log4j:log4j:1.2.17) BuildRequires: mvn(jaxen:jaxen) BuildRequires: mvn(org.jdom:jdom) -BuildRequires: mvn(org.apache.bcel:bcel) BuildRequires: mvn(org.apache:apache:pom:) @@ -149,7 +148,6 @@ oro:oro \ log4j:log4j:1.2.17 \ jaxen:jaxen \ org.jdom:jdom \ -org.apache.bcel:bcel \ ) ant \ -buildfile build/build.xml \ From 6c1da3dc147ba8cd213a6dac114823daeebfd29e Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 21 Apr 2020 11:12:45 +0200 Subject: [PATCH 16/21] Remove Anakia and Texen --- velocity.spec | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/velocity.spec b/velocity.spec index 58ac04d..fe6acc1 100644 --- a/velocity.spec +++ b/velocity.spec @@ -32,11 +32,8 @@ BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(org.apache.commons:commons-lang3) BuildRequires: mvn(commons-logging:commons-logging) BuildRequires: mvn(javax.servlet:javax.servlet-api) -BuildRequires: mvn(junit:junit) BuildRequires: mvn(oro:oro) BuildRequires: mvn(log4j:log4j:1.2.17) -BuildRequires: mvn(jaxen:jaxen) -BuildRequires: mvn(org.jdom:jdom) BuildRequires: mvn(org.apache:apache:pom:) @@ -100,6 +97,10 @@ rm src/test/org/apache/velocity/test/VelocityServletTestCase.java # This test doesn't work with new hsqldb rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java +# Anakia and Texen are not needed +rm -rf src/java/org/apache/velocity/anakia/ +rm -rf src/java/org/apache/velocity/texen/ + cp %{SOURCE1} ./pom.xml # remove rest of avalon logkit refences @@ -114,7 +115,7 @@ cp %{SOURCE1} ./pom.xml %patch3 -p1 # Use jdom instead of werken-xpath -%patch4 -p1 +#%patch4 -p1 %pom_remove_dep werken-xpath: # Skip Java 8 incompatible test @@ -143,18 +144,15 @@ commons-collections:commons-collections \ org.apache.commons:commons-lang3 \ commons-logging:commons-logging \ javax.servlet:javax.servlet-api \ -junit:junit \ oro:oro \ log4j:log4j:1.2.17 \ -jaxen:jaxen \ -org.jdom:jdom \ ) ant \ -buildfile build/build.xml \ -Dbuild.sysclasspath=first \ -Djavac.target=1.6 \ -Djavac.source=1.6 \ - jar javadocs test + jar javadocs test-main # fix line-endings in generated files sed -i 's/\r//' docs/api/stylesheet.css docs/api/package-list From b9a03489ffc7375a284ed3811dadfd614002f6f2 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 15 May 2020 07:49:02 +0200 Subject: [PATCH 17/21] Reduce dependencies --- velocity.spec | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/velocity.spec b/velocity.spec index fe6acc1..c865d57 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,4 +1,3 @@ - Name: velocity Version: 1.7 Release: 26%{?dist} @@ -30,10 +29,6 @@ BuildRequires: ant-junit BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(org.apache.commons:commons-lang3) -BuildRequires: mvn(commons-logging:commons-logging) -BuildRequires: mvn(javax.servlet:javax.servlet-api) -BuildRequires: mvn(oro:oro) -BuildRequires: mvn(log4j:log4j:1.2.17) BuildRequires: mvn(org.apache:apache:pom:) @@ -86,21 +81,6 @@ Demonstrations and samples for %{name}. find . -name '*.jar' ! -name 'test*.jar' -print -delete find . -name '*.class' ! -name 'Foo.class' -print -delete -# Remove dependency on avalon-logkit -rm -f src/java/org/apache/velocity/runtime/log/AvalonLogChute.java -rm -f src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java -rm -f src/java/org/apache/velocity/runtime/log/VelocityFormatter.java - -# need porting to new servlet API. We would just add a lot of empty functions -rm src/test/org/apache/velocity/test/VelocityServletTestCase.java - -# This test doesn't work with new hsqldb -rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java - -# Anakia and Texen are not needed -rm -rf src/java/org/apache/velocity/anakia/ -rm -rf src/java/org/apache/velocity/texen/ - cp %{SOURCE1} ./pom.xml # remove rest of avalon logkit refences @@ -133,6 +113,17 @@ cp %{SOURCE1} ./pom.xml # Tests compare the string content of thrown exceptions which changed with jdk 11 %patch9 -p1 +# Disable unneeded features +rm -r src/java/org/apache/velocity/{anakia,texen,servlet,convert} +rm src/java/org/apache/velocity/runtime/log/{Avalon,Log4J}Log{Chute,System}.java +rm src/java/org/apache/velocity/runtime/log/{CommonsLog,Servlet}LogChute.java +rm src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java +rm src/java/org/apache/velocity/runtime/log/VelocityFormatter.java +rm src/java/org/apache/velocity/app/event/implement/Escape{Html,JavaScript,Sql,Xml,}Reference.java + +# Disable failing tests +rm src/test/org/apache/velocity/test/VelocityServletTestCase.java +rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java rm -r src/test/org/apache/velocity/test/sql # ----------------------------------------------------------------------------- @@ -152,7 +143,7 @@ ant \ -Dbuild.sysclasspath=first \ -Djavac.target=1.6 \ -Djavac.source=1.6 \ - jar javadocs test-main + jar javadocs # fix line-endings in generated files sed -i 's/\r//' docs/api/stylesheet.css docs/api/package-list From 07a7640f658037c2a1f39816b0641bc495932b54 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 15 May 2020 10:04:13 +0200 Subject: [PATCH 18/21] Build with Maven --- .gitignore | 1 + 0001-Don-t-use-Werken-XPath.patch | 165 ----------- 0001-Port-to-apache-commons-lang3.patch | 66 ++--- 0001-Remove-avalon-logkit.patch | 62 ---- 0002-Force-use-of-JDK-log-chute.patch | 25 ++ 0002-Port-to-OpenJDK-11.patch | 33 --- 0003-Use-system-jars.patch | 197 ------------- 0004-JDBC-41-compat.patch | 19 -- 0004-Use-log4j-1.2.17.patch | 25 -- 0006-Skip-Java-8-incompatible-test.patch | 26 -- sources | 1 + velocity-1.7-doclint.patch | 11 - velocity-1.7-osgi.patch | 43 --- velocity-1.7.pom | 346 ----------------------- velocity.spec | 127 ++------- 15 files changed, 80 insertions(+), 1067 deletions(-) delete mode 100644 0001-Don-t-use-Werken-XPath.patch delete mode 100644 0001-Remove-avalon-logkit.patch create mode 100644 0002-Force-use-of-JDK-log-chute.patch delete mode 100644 0002-Port-to-OpenJDK-11.patch delete mode 100644 0003-Use-system-jars.patch delete mode 100644 0004-JDBC-41-compat.patch delete mode 100644 0004-Use-log4j-1.2.17.patch delete mode 100644 0006-Skip-Java-8-incompatible-test.patch delete mode 100644 velocity-1.7-doclint.patch delete mode 100644 velocity-1.7-osgi.patch delete mode 100644 velocity-1.7.pom diff --git a/.gitignore b/.gitignore index 57d2359..788b806 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ velocity-1.6.3.tar.gz /velocity-1.6.4.tar.gz /velocity-1.7.tar.gz +/velocity-1.7.pom diff --git a/0001-Don-t-use-Werken-XPath.patch b/0001-Don-t-use-Werken-XPath.patch deleted file mode 100644 index b754573..0000000 --- a/0001-Don-t-use-Werken-XPath.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 8a9344f55d74a5b809051ae144b3c028499fec0d Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Sat, 27 Sep 2013 10:53:46 +0200 -Subject: [PATCH] Don't use Werken XPath - ---- - src/java/org/apache/velocity/anakia/AnakiaElement.java | 7 +++++-- - src/java/org/apache/velocity/anakia/NodeList.java | 6 ++++-- - src/java/org/apache/velocity/anakia/XPathCache.java | 9 ++++++--- - src/java/org/apache/velocity/anakia/XPathTool.java | 16 ++++++++++------ - 4 files changed, 25 insertions(+), 13 deletions(-) - -diff --git a/src/java/org/apache/velocity/anakia/AnakiaElement.java b/src/java/org/apache/velocity/anakia/AnakiaElement.java -index c72b653..df13153 100644 ---- a/src/java/org/apache/velocity/anakia/AnakiaElement.java -+++ b/src/java/org/apache/velocity/anakia/AnakiaElement.java -@@ -20,8 +20,10 @@ package org.apache.velocity.anakia; - */ - - import org.jdom.Element; -+import org.jdom.JDOMException; - import org.jdom.Namespace; - import org.jdom.output.XMLOutputter; -+ - import java.util.List; - - /** -@@ -126,10 +128,11 @@ public class AnakiaElement extends Element - * @param xpathExpression the XPath expression you wish to apply - * @return a NodeList representing the nodes that are the result of - * application of the XPath to the current element. It can be empty. -+ * @throws JDOMException - */ -- public NodeList selectNodes(String xpathExpression) -+ public NodeList selectNodes(String xpathExpression) throws JDOMException - { -- return new NodeList(XPathCache.getXPath(xpathExpression).applyTo(this), false); -+ return new NodeList(XPathCache.getXPath(xpathExpression).selectNodes(this), false); - } - - /** -diff --git a/src/java/org/apache/velocity/anakia/NodeList.java b/src/java/org/apache/velocity/anakia/NodeList.java -index daf611d..b303bda 100644 ---- a/src/java/org/apache/velocity/anakia/NodeList.java -+++ b/src/java/org/apache/velocity/anakia/NodeList.java -@@ -35,6 +35,7 @@ import org.jdom.DocType; - import org.jdom.Document; - import org.jdom.Element; - import org.jdom.EntityRef; -+import org.jdom.JDOMException; - import org.jdom.ProcessingInstruction; - import org.jdom.Text; - import org.jdom.output.XMLOutputter; -@@ -289,10 +290,11 @@ public class NodeList implements List, Cloneable - * @param xpathString the XPath expression you wish to apply - * @return a NodeList representing the nodes that are the result of - * application of the XPath to the current node list. It can be empty. -+ * @throws JDOMException - */ -- public NodeList selectNodes(String xpathString) -+ public NodeList selectNodes(String xpathString) throws JDOMException - { -- return new NodeList(XPathCache.getXPath(xpathString).applyTo(nodes), false); -+ return new NodeList(XPathCache.getXPath(xpathString).selectNodes(nodes), false); - } - - // List methods implemented hereafter -diff --git a/src/java/org/apache/velocity/anakia/XPathCache.java b/src/java/org/apache/velocity/anakia/XPathCache.java -index cef43d9..0d633b0 100644 ---- a/src/java/org/apache/velocity/anakia/XPathCache.java -+++ b/src/java/org/apache/velocity/anakia/XPathCache.java -@@ -19,7 +19,9 @@ package org.apache.velocity.anakia; - * under the License. - */ - --import com.werken.xpath.XPath; -+import org.jdom.JDOMException; -+import org.jdom.xpath.XPath; -+ - import java.util.Map; - import java.util.WeakHashMap; - -@@ -46,8 +48,9 @@ class XPathCache - * A cached object is returned if it already exists for the requested expression. - * @param xpathString the XPath expression to parse - * @return the XPath object that represents the parsed XPath expression. -+ * @throws JDOMException - */ -- static XPath getXPath(String xpathString) -+ static XPath getXPath(String xpathString) throws JDOMException - { - XPath xpath = null; - synchronized(XPATH_CACHE) -@@ -55,7 +58,7 @@ class XPathCache - xpath = (XPath)XPATH_CACHE.get(xpathString); - if(xpath == null) - { -- xpath = new XPath(xpathString); -+ xpath = XPath.newInstance(xpathString); - XPATH_CACHE.put(xpathString, xpath); - } - } -diff --git a/src/java/org/apache/velocity/anakia/XPathTool.java b/src/java/org/apache/velocity/anakia/XPathTool.java -index c9e6178..f85d2c1 100644 ---- a/src/java/org/apache/velocity/anakia/XPathTool.java -+++ b/src/java/org/apache/velocity/anakia/XPathTool.java -@@ -23,6 +23,7 @@ import java.util.List; - - import org.jdom.Document; - import org.jdom.Element; -+import org.jdom.JDOMException; - - /** - * This class adds an entrypoint into XPath functionality, -@@ -88,12 +89,13 @@ public class XPathTool - * @param doc The Document context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- Document doc) -+ Document doc) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, Document)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( doc ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( doc ), false); - } - - /** -@@ -103,12 +105,13 @@ public class XPathTool - * @param elem The Element context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- Element elem) -+ Element elem) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, Element)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( elem ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( elem ), false); - } - - /** -@@ -118,12 +121,13 @@ public class XPathTool - * @param nodeSet The nodeset context - * - * @return A list of selected nodes -+ * @throws JDOMException - */ - public NodeList applyTo(String xpathSpec, -- List nodeSet) -+ List nodeSet) throws JDOMException - { - //RuntimeSingleton.info("XPathTool::applyTo(String, List)"); -- return new NodeList(XPathCache.getXPath(xpathSpec).applyTo( nodeSet ), false); -+ return new NodeList(XPathCache.getXPath(xpathSpec).selectNodes( nodeSet ), false); - } - } - --- -1.8.3.1 - diff --git a/0001-Port-to-apache-commons-lang3.patch b/0001-Port-to-apache-commons-lang3.patch index c4247c4..191611a 100644 --- a/0001-Port-to-apache-commons-lang3.patch +++ b/0001-Port-to-apache-commons-lang3.patch @@ -1,7 +1,7 @@ -From afc1005f123933e3441833651a558ab88d7cbee4 Mon Sep 17 00:00:00 2001 +From bf0462e3c293863947dde1c22a62c3d4a187a70c Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 31 Oct 2019 14:35:40 +0100 -Subject: [PATCH] Port to apache-commons-lang3 +Subject: [PATCH 1/2] Port to apache-commons-lang3 --- pom.xml | 6 +++--- @@ -36,10 +36,10 @@ Subject: [PATCH] Port to apache-commons-lang3 29 files changed, 39 insertions(+), 38 deletions(-) diff --git a/pom.xml b/pom.xml -index e2c7004..273fc9d 100644 +index 77a8e383..eee15b34 100644 --- a/pom.xml +++ b/pom.xml -@@ -143,9 +143,9 @@ +@@ -148,9 +148,9 @@ 3.2.1 @@ -53,7 +53,7 @@ index e2c7004..273fc9d 100644 oro diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java -index 6d98b45..e146995 100644 +index 6d98b45c..e1469957 100644 --- a/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java +++ b/src/java/org/apache/velocity/app/event/implement/EscapeHtmlReference.java @@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; @@ -75,7 +75,7 @@ index 6d98b45..e146995 100644 /** diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java -index ea49ddb..12f38f4 100644 +index ea49ddbf..12f38f47 100644 --- a/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java +++ b/src/java/org/apache/velocity/app/event/implement/EscapeJavaScriptReference.java @@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; @@ -97,7 +97,7 @@ index ea49ddb..12f38f4 100644 /** diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java -index 585cb6c..39e04f4 100644 +index 585cb6c6..39e04f43 100644 --- a/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java +++ b/src/java/org/apache/velocity/app/event/implement/EscapeSqlReference.java @@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; @@ -120,7 +120,7 @@ index 585cb6c..39e04f4 100644 /** diff --git a/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java b/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java -index 3d5b40f..fbb525c 100644 +index 3d5b40f0..fbb525cb 100644 --- a/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java +++ b/src/java/org/apache/velocity/app/event/implement/EscapeXmlReference.java @@ -19,7 +19,7 @@ package org.apache.velocity.app.event.implement; @@ -133,7 +133,7 @@ index 3d5b40f..fbb525c 100644 /** * Escape all XML entities. diff --git a/src/java/org/apache/velocity/runtime/RuntimeInstance.java b/src/java/org/apache/velocity/runtime/RuntimeInstance.java -index bf99faa..a79d42c 100644 +index 670c083d..f877114d 100644 --- a/src/java/org/apache/velocity/runtime/RuntimeInstance.java +++ b/src/java/org/apache/velocity/runtime/RuntimeInstance.java @@ -32,7 +32,7 @@ import java.util.Map; @@ -146,7 +146,7 @@ index bf99faa..a79d42c 100644 import org.apache.velocity.app.event.EventCartridge; import org.apache.velocity.app.event.EventHandler; diff --git a/src/java/org/apache/velocity/runtime/VelocimacroFactory.java b/src/java/org/apache/velocity/runtime/VelocimacroFactory.java -index 2737b3b..956ab05 100644 +index 8756b66f..70e3d489 100644 --- a/src/java/org/apache/velocity/runtime/VelocimacroFactory.java +++ b/src/java/org/apache/velocity/runtime/VelocimacroFactory.java @@ -26,7 +26,7 @@ import java.util.Map; @@ -159,7 +159,7 @@ index 2737b3b..956ab05 100644 import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.directive.Directive; diff --git a/src/java/org/apache/velocity/runtime/directive/Block.java b/src/java/org/apache/velocity/runtime/directive/Block.java -index f5fdfa8..b136543 100644 +index f5fdfa85..b136543d 100755 --- a/src/java/org/apache/velocity/runtime/directive/Block.java +++ b/src/java/org/apache/velocity/runtime/directive/Block.java @@ -23,7 +23,7 @@ import java.io.IOException; @@ -172,7 +172,7 @@ index f5fdfa8..b136543 100644 import org.apache.velocity.exception.TemplateInitException; import org.apache.velocity.runtime.Renderable; diff --git a/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java b/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java -index 090b552..d22ac4e 100644 +index 090b5522..d22ac4ed 100644 --- a/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java +++ b/src/java/org/apache/velocity/runtime/directive/RuntimeMacro.java @@ -23,7 +23,7 @@ import java.io.IOException; @@ -185,7 +185,7 @@ index 090b552..d22ac4e 100644 import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.ParseErrorException; diff --git a/src/java/org/apache/velocity/runtime/parser/Parser.java b/src/java/org/apache/velocity/runtime/parser/Parser.java -index 085e7a4..62dfe48 100644 +index 1253381f..b8e7112e 100644 --- a/src/java/org/apache/velocity/runtime/parser/Parser.java +++ b/src/java/org/apache/velocity/runtime/parser/Parser.java @@ -10,7 +10,7 @@ import org.apache.velocity.runtime.directive.Directive; @@ -198,7 +198,7 @@ index 085e7a4..62dfe48 100644 /** diff --git a/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java b/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java -index ce00d99..9563a1f 100644 +index ce00d99d..9563a1fb 100644 --- a/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java +++ b/src/java/org/apache/velocity/runtime/parser/ParserTokenManager.java @@ -9,7 +9,7 @@ import org.apache.velocity.runtime.directive.Directive; @@ -211,7 +211,7 @@ index ce00d99..9563a1f 100644 /** Token Manager. */ diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java b/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java -index 86e86b7..f1ab78d 100644 +index 74727729..8fc59737 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java +++ b/src/java/org/apache/velocity/runtime/parser/node/ASTDirective.java @@ -22,7 +22,7 @@ package org.apache.velocity.runtime.parser.node; @@ -224,7 +224,7 @@ index 86e86b7..f1ab78d 100644 import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.ParseErrorException; diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java b/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java -index a1545e5..7354c9a 100644 +index 489429bb..df54dd93 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java +++ b/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java @@ -21,8 +21,8 @@ package org.apache.velocity.runtime.parser.node; @@ -239,7 +239,7 @@ index a1545e5..7354c9a 100644 import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.MethodInvocationException; diff --git a/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java b/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java -index bb56cd9..0bc63bc 100644 +index 2267993c..82cca27a 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java +++ b/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java @@ -21,7 +21,7 @@ import java.io.IOException; @@ -252,7 +252,7 @@ index bb56cd9..0bc63bc 100644 import org.apache.velocity.exception.TemplateInitException; import org.apache.velocity.exception.VelocityException; diff --git a/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java b/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java -index 52bcda9..8362c3e 100644 +index 713a86ae..0ac03fbc 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java +++ b/src/java/org/apache/velocity/runtime/parser/node/NodeUtils.java @@ -19,7 +19,7 @@ package org.apache.velocity.runtime.parser.node; @@ -265,7 +265,7 @@ index 52bcda9..8362c3e 100644 import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.runtime.parser.ParserConstants; diff --git a/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java b/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java -index 8c78228..20d6c18 100644 +index 8c78228e..20d6c185 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java +++ b/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java @@ -21,7 +21,7 @@ package org.apache.velocity.runtime.parser.node; @@ -278,7 +278,7 @@ index 8c78228..20d6c18 100644 import org.apache.velocity.runtime.RuntimeLogger; import org.apache.velocity.runtime.log.Log; diff --git a/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java b/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java -index 0b27b45..ba5d512 100644 +index 0078d023..80887fad 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java +++ b/src/java/org/apache/velocity/runtime/parser/node/SetPropertyExecutor.java @@ -21,8 +21,8 @@ package org.apache.velocity.runtime.parser.node; @@ -293,7 +293,7 @@ index 0b27b45..ba5d512 100644 import org.apache.velocity.runtime.log.Log; import org.apache.velocity.util.introspection.Introspector; diff --git a/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java b/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java -index 108846f..6372830 100644 +index 108846f8..6372830f 100644 --- a/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java +++ b/src/java/org/apache/velocity/runtime/parser/node/SimpleNode.java @@ -22,8 +22,8 @@ package org.apache.velocity.runtime.parser.node; @@ -308,7 +308,7 @@ index 108846f..6372830 100644 import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.ParseErrorException; diff --git a/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java b/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java -index 1b504eb..b33d4ed 100644 +index 778b42a9..a396e42f 100644 --- a/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java +++ b/src/java/org/apache/velocity/runtime/resource/ResourceManagerImpl.java @@ -158,7 +158,7 @@ public class ResourceManagerImpl @@ -330,7 +330,7 @@ index 1b504eb..b33d4ed 100644 log.warn("Declared encoding for template '" + resource.getName() + diff --git a/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java -index 623766f..a7cc276 100644 +index 52d09a98..bf48aa45 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java @@ -22,7 +22,7 @@ package org.apache.velocity.runtime.resource.loader; @@ -343,7 +343,7 @@ index 623766f..a7cc276 100644 import org.apache.velocity.runtime.resource.Resource; import org.apache.velocity.util.ClassUtils; diff --git a/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java -index 833e0ac..7414913 100644 +index f85b6d62..38ec30dc 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java @@ -218,7 +218,7 @@ public class DataSourceResourceLoader extends ResourceLoader @@ -356,7 +356,7 @@ index 833e0ac..7414913 100644 throw new ResourceNotFoundException("DataSourceResourceLoader: Template name was empty or null"); } diff --git a/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java -index 462ed16..3898889 100644 +index 923274a7..8580caeb 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java @@ -118,7 +118,7 @@ public class FileResourceLoader extends ResourceLoader @@ -369,7 +369,7 @@ index 462ed16..3898889 100644 /* * If we don't get a properly formed templateName then diff --git a/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java -index 172384e..b7fb1a7 100644 +index 054d890e..71d6c083 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java @@ -195,7 +195,7 @@ public class JarResourceLoader extends ResourceLoader @@ -382,7 +382,7 @@ index 172384e..b7fb1a7 100644 throw new ResourceNotFoundException("Need to have a resource!"); } diff --git a/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java -index 895182d..41c0ec9 100644 +index 245c10b8..86a08b9d 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/StringResourceLoader.java @@ -26,7 +26,7 @@ import java.io.ByteArrayInputStream; @@ -395,7 +395,7 @@ index 895182d..41c0ec9 100644 import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.resource.Resource; diff --git a/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java b/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java -index de06636..74ab86a 100644 +index de066367..74ab86a6 100644 --- a/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java +++ b/src/java/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java @@ -26,7 +26,7 @@ import java.net.URL; @@ -408,7 +408,7 @@ index de06636..74ab86a 100644 import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.resource.Resource; diff --git a/src/java/org/apache/velocity/util/introspection/ClassMap.java b/src/java/org/apache/velocity/util/introspection/ClassMap.java -index 66bc7b1..77c1c8b 100644 +index 00512892..2e128b7e 100644 --- a/src/java/org/apache/velocity/util/introspection/ClassMap.java +++ b/src/java/org/apache/velocity/util/introspection/ClassMap.java @@ -23,7 +23,7 @@ import java.lang.reflect.Method; @@ -421,7 +421,7 @@ index 66bc7b1..77c1c8b 100644 import org.apache.velocity.util.MapFactory; diff --git a/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java b/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java -index 3142f45..ff36682 100644 +index 02499985..4b0b254f 100644 --- a/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java +++ b/src/test/org/apache/velocity/io/UnicodeInputStreamTestCase.java @@ -27,7 +27,7 @@ import junit.framework.Test; @@ -434,7 +434,7 @@ index 3142f45..ff36682 100644 /** diff --git a/src/test/org/apache/velocity/test/BaseTestCase.java b/src/test/org/apache/velocity/test/BaseTestCase.java -index 9faf585..f893d0f 100644 +index 0ea00cbd..798a322b 100644 --- a/src/test/org/apache/velocity/test/BaseTestCase.java +++ b/src/test/org/apache/velocity/test/BaseTestCase.java @@ -353,7 +353,7 @@ public abstract class BaseTestCase extends TestCase implements TemplateTestBase @@ -447,7 +447,7 @@ index 9faf585..f893d0f 100644 buf.append('.').append(ext); } diff --git a/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java b/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java -index d1ad1db..e70c5f2 100644 +index 77dfc54e..4befc6ef 100644 --- a/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java +++ b/src/test/org/apache/velocity/test/MethodCacheKeyTestCase.java @@ -21,7 +21,7 @@ package org.apache.velocity.test; @@ -460,5 +460,5 @@ index d1ad1db..e70c5f2 100644 /** -- -2.21.0 +2.25.4 diff --git a/0001-Remove-avalon-logkit.patch b/0001-Remove-avalon-logkit.patch deleted file mode 100644 index 2f09b03..0000000 --- a/0001-Remove-avalon-logkit.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1d2f89cb3e954b943751fa8dd587fdb404eb9338 Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Mon, 21 Feb 2011 15:53:34 +0100 -Subject: [PATCH 1/3] Remove avalon-logkit - -we don't have it packaged so change defaults and remove it from pom.xml ---- - pom.xml | 6 ------ - .../velocity/runtime/defaults/velocity.properties | 4 ++-- - .../apache/velocity/runtime/log/LogManager.java | 2 +- - 3 files changed, 3 insertions(+), 9 deletions(-) - -diff --git a/pom.xml b/pom.xml -index 77a8e38..f453208 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -197,12 +197,6 @@ - provided - - -- logkit -- logkit -- 2.0 -- provided -- -- - ant - ant - 1.6 -diff --git a/src/java/org/apache/velocity/runtime/defaults/velocity.properties b/src/java/org/apache/velocity/runtime/defaults/velocity.properties -index 750a59a..7fac119 100644 ---- a/src/java/org/apache/velocity/runtime/defaults/velocity.properties -+++ b/src/java/org/apache/velocity/runtime/defaults/velocity.properties -@@ -20,10 +20,10 @@ - # ---------------------------------------------------------------------------- - - # ---------------------------------------------------------------------------- --# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute -+# default LogChute to use: default: Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute - # ---------------------------------------------------------------------------- - --runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute -+runtime.log.logsystem.class = org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute - - # --------------------------------------------------------------------------- - # This is the location of the Velocity Runtime log. -diff --git a/src/java/org/apache/velocity/runtime/log/LogManager.java b/src/java/org/apache/velocity/runtime/log/LogManager.java -index 19d1016..97dceef 100644 ---- a/src/java/org/apache/velocity/runtime/log/LogManager.java -+++ b/src/java/org/apache/velocity/runtime/log/LogManager.java -@@ -119,7 +119,7 @@ public class LogManager - * classes, and we use the first one we find. - * - * Note that the default value of this property contains the -- * AvalonLogChute, the Log4JLogChute, CommonsLogLogChute, -+ * Log4JLogChute, CommonsLogLogChute, - * ServletLogChute, and the JdkLogChute for - * convenience - so we use whichever we works first. - */ --- -1.7.4 - diff --git a/0002-Force-use-of-JDK-log-chute.patch b/0002-Force-use-of-JDK-log-chute.patch new file mode 100644 index 0000000..c3c2235 --- /dev/null +++ b/0002-Force-use-of-JDK-log-chute.patch @@ -0,0 +1,25 @@ +From b2eee6ccc6ef24e084567a0a38d21fa3765df6ad Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 15 May 2020 09:56:26 +0200 +Subject: [PATCH 2/2] Force use of JDK log chute + +--- + .../org/apache/velocity/runtime/defaults/velocity.properties | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/java/org/apache/velocity/runtime/defaults/velocity.properties b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +index 750a59af..855118b9 100644 +--- a/src/java/org/apache/velocity/runtime/defaults/velocity.properties ++++ b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +@@ -23,7 +23,7 @@ + # default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute + # ---------------------------------------------------------------------------- + +-runtime.log.logsystem.class = org.apache.velocity.runtime.log.AvalonLogChute,org.apache.velocity.runtime.log.Log4JLogChute,org.apache.velocity.runtime.log.CommonsLogLogChute,org.apache.velocity.runtime.log.ServletLogChute,org.apache.velocity.runtime.log.JdkLogChute ++runtime.log.logsystem.class = org.apache.velocity.runtime.log.JdkLogChute + + # --------------------------------------------------------------------------- + # This is the location of the Velocity Runtime log. +-- +2.25.4 + diff --git a/0002-Port-to-OpenJDK-11.patch b/0002-Port-to-OpenJDK-11.patch deleted file mode 100644 index 5c5efe2..0000000 --- a/0002-Port-to-OpenJDK-11.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a7d58ff8edefb992d4989a4e2d8f4eec104e4e93 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Thu, 31 Oct 2019 15:38:55 +0100 -Subject: [PATCH] Port to OpenJDK 11 - ---- - .../org/apache/velocity/test/BuiltInEventHandlerTestCase.java | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java b/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java -index 2005b0b..fb29ce3 100644 ---- a/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java -+++ b/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java -@@ -339,14 +339,14 @@ public class BuiltInEventHandlerTestCase extends BaseTestCase { - writer = new StringWriter(); - ve1.evaluate(context,writer,"test","$list.get(0)"); - assertTrue(writer.toString().indexOf("IndexOutOfBoundsException") != -1); -- assertTrue(writer.toString().indexOf("Index: 0, Size: 0") == -1); -+ assertTrue(writer.toString().indexOf("Index 0 out of bounds for length 0") == -1); - assertTrue(writer.toString().indexOf("ArrayList") == -1); - - // message - writer = new StringWriter(); - ve2.evaluate(context,writer,"test","$list.get(0)"); - assertTrue(writer.toString().indexOf("IndexOutOfBoundsException") != -1); -- assertTrue(writer.toString().indexOf("Index: 0, Size: 0") != -1); -+ assertTrue(writer.toString().indexOf("Index 0 out of bounds for length 0") != -1); - assertTrue(writer.toString().indexOf("ArrayList") == -1); - - // stack trace --- -2.21.0 - diff --git a/0003-Use-system-jars.patch b/0003-Use-system-jars.patch deleted file mode 100644 index 3d37ee8..0000000 --- a/0003-Use-system-jars.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 813085c72e9906a53bec5954bcce7305a7c320d1 Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Mon, 21 Feb 2011 17:58:39 +0100 -Subject: [PATCH 3/3] Use system jars - ---- - build/build.xml | 56 +++++++++++---------------------------------------- - build/testcases.xml | 6 ----- - 2 files changed, 12 insertions(+), 50 deletions(-) - -diff --git a/build/build.xml b/build/build.xml -index c667553..479ef2d 100644 ---- a/build/build.xml -+++ b/build/build.xml -@@ -140,28 +140,6 @@ - - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -@@ -174,12 +152,11 @@ - - - -- -+ - - - -- - - - -@@ -210,10 +187,9 @@ - - - -- -+ - -- - - - -@@ -248,7 +224,7 @@ - - - -- - -+ optimize="${optimize}"/> - - - -@@ -268,7 +243,7 @@ - - - -- - - -- -- - - - -@@ -561,7 +534,7 @@ - - - -- - - -@@ -585,8 +558,7 @@ - encoding="UTF-8" - debug="${debug}" - deprecation="${deprecation}" -- optimize="${optimize}" -- classpathref="velocity.run.classpath"/> -+ optimize="${optimize}"/> - - - -@@ -604,7 +576,7 @@ - - - -- - - -@@ -620,8 +592,7 @@ - doctitle="${name} ${version} API" - encoding="UTF-8" - docencoding="UTF-8" -- bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved." -- classpathref="velocity.build.classpath"> -+ bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> - - - -@@ -1024,12 +995,11 @@ - - - -- - - -+ classname="org.apache.velocity.anakia.AnakiaTask"/> - - - ####################################################### -@@ -1231,7 +1201,7 @@ - - - -- - - -@@ -1264,8 +1234,6 @@ - - - -- -- - - - -diff --git a/build/testcases.xml b/build/testcases.xml -index 06bb36e..f3749bc 100644 ---- a/build/testcases.xml -+++ b/build/testcases.xml -@@ -36,12 +36,6 @@ - - - -- -- -- -- -- -- - - - --- -1.7.4 - diff --git a/0004-JDBC-41-compat.patch b/0004-JDBC-41-compat.patch deleted file mode 100644 index c137bac..0000000 --- a/0004-JDBC-41-compat.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:49:20.202936454 -0500 -+++ b/src/test/org/apache/velocity/test/sql/HsqlDataSource.java 2012-02-15 19:52:35.062574871 -0500 -@@ -23,6 +23,7 @@ - import java.sql.Connection; - import java.sql.DriverManager; - import java.sql.SQLException; -+import java.sql.SQLFeatureNotSupportedException; - - import javax.sql.DataSource; - -@@ -73,5 +74,8 @@ - public Object unwrap(final Class iface) throws SQLException { - throw new SQLException("Not implemented"); - } -+ public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { -+ throw new SQLFeatureNotSupportedException("getParentLogger() not supported"); -+ } - - } diff --git a/0004-Use-log4j-1.2.17.patch b/0004-Use-log4j-1.2.17.patch deleted file mode 100644 index 62602a0..0000000 --- a/0004-Use-log4j-1.2.17.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cec42bf7ae8b4b72850c3cdea74a07603f11786f Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Wed, 18 Jun 2014 07:25:12 +0200 -Subject: [PATCH 4/4] Use log4j 1.2.17 - ---- - pom.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pom.xml b/pom.xml -index e35d72d..c8d48fd 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -187,7 +187,7 @@ - - log4j - log4j -- 1.2.12 -+ 1.2.17 - provided - - --- -1.9.3 - diff --git a/0006-Skip-Java-8-incompatible-test.patch b/0006-Skip-Java-8-incompatible-test.patch deleted file mode 100644 index 3577fa0..0000000 --- a/0006-Skip-Java-8-incompatible-test.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6060e6ef497bddc4a9aeac343e584ff324746d58 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Wed, 18 Jun 2014 08:11:48 +0200 -Subject: [PATCH 6/6] Skip Java 8 incompatible test - ---- - src/test/org/apache/velocity/test/issues/VelTools66TestCase.java | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -index 00bb0b1..6fb7260 100644 ---- a/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -+++ b/src/test/org/apache/velocity/test/issues/VelTools66TestCase.java -@@ -87,7 +87,8 @@ public class VelTools66TestCase - - Method testMethod = introspector.getMethod(TestObject.class, "getTestValue", new Object[0]); - assertNotNull(testMethod); -- assertEquals("Method object does not match!", verifyMethod, testMethod); -+ // Java 8 incompatibility -+ // assertEquals("Method object does not match!", verifyMethod, testMethod); - } - - public static interface TestInterface --- -1.9.3 - diff --git a/sources b/sources index 7928f22..acce6ea 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (velocity-1.7.tar.gz) = d305642aab3c837ad250deaa46b516561fb68f92d04fc205fd4f40eb774ba6286ed3b239ee6352bc4411bd11cb4d1d5b39ce9ab8467f0e1ffceed9f9fc5a228d +SHA512 (velocity-1.7.pom) = 04e8850d391dc16501caa7127fb0b62bb3681dc912d6275056dd57f12d7928db6a1232600e7b0025782a22713fcb134fe41e148ca7601af705f3283feb854cde diff --git a/velocity-1.7-doclint.patch b/velocity-1.7-doclint.patch deleted file mode 100644 index 7895b60..0000000 --- a/velocity-1.7-doclint.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nru velocity-1.7/build/build.xml velocity-1.7.doclint/build/build.xml ---- velocity-1.7/build/build.xml 2015-07-22 12:13:51.566920750 +0200 -+++ velocity-1.7.doclint/build/build.xml 2015-07-22 12:13:14.929703544 +0200 -@@ -592,6 +592,7 @@ - doctitle="${name} ${version} API" - encoding="UTF-8" - docencoding="UTF-8" -+ additionalparam="-Xdoclint:none" - bottom="Copyright © 2000-${build.year} <a href="http://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved."> - - diff --git a/velocity-1.7-osgi.patch b/velocity-1.7-osgi.patch deleted file mode 100644 index 2d6ac05..0000000 --- a/velocity-1.7-osgi.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -Nru velocity-1.7/build/build.properties velocity-1.7.osgi/build/build.properties ---- velocity-1.7/build/build.properties 2010-11-19 21:16:21.000000000 +0100 -+++ velocity-1.7.osgi/build/build.properties 2015-07-22 12:21:19.627117810 +0200 -@@ -166,8 +166,7 @@ - - ######################################################################## - # OSGi stuff --import=com.werken.xpath;resolution:=optional,\ -- javax.naming,\ -+import=javax.naming,\ - javax.servlet;resolution:=optional,\ - javax.servlet.http;resolution:=optional,\ - javax.sql,\ -@@ -188,8 +187,7 @@ - org.jdom.input;resolution:=optional,\ - org.jdom.output;resolution:=optional,\ - org.xml.sax --dep.import=com.werken.xpath;resolution:=optional,\ -- javax.naming,\ -+dep.import=javax.naming,\ - javax.servlet;resolution:=optional,\ - javax.servlet.http;resolution:=optional,\ - javax.sql,\ -@@ -207,8 +205,7 @@ - export=org.apache.velocity;uses:="org.apache.velocity.context,\ - org.apache.velocity.exception,\ - org.apache.velocity.runtime.resource",\ -- org.apache.velocity.anakia;uses:="com.werken.xpath,\ -- org.apache.tools.ant,\ -+ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ - org.apache.tools.ant.taskdefs,\ - org.jdom,\ - org.jdom.output",\ -@@ -327,8 +324,7 @@ - org.apache.velocity;uses:="org.apache.velocity.context,\ - org.apache.velocity.exception,\ - org.apache.velocity.runtime.resource",\ -- org.apache.velocity.anakia;uses:="com.werken.xpath,\ -- org.apache.tools.ant,\ -+ org.apache.velocity.anakia;uses:="org.apache.tools.ant,\ - org.apache.tools.ant.taskdefs,\ - org.jdom,\ - org.jdom.output",\ diff --git a/velocity-1.7.pom b/velocity-1.7.pom deleted file mode 100644 index 77a8e38..0000000 --- a/velocity-1.7.pom +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - 4.0.0 - - - org.apache - apache - 4 - - - org.apache.velocity - velocity - 1.7 - - Apache Velocity - http://velocity.apache.org/engine/devel/ - Apache Velocity is a general purpose template engine. - 2000 - jar - - - 2.0.9 - - - - install - src/java - src/test - - - org.apache.maven.plugins - maven-site-plugin - - UTF-8 - UTF-8 - ${basedir}/xdocs/docs - - - - - - src/java - - **/*.java - - - - - - - - velocity.apache.org - scpexe://people.apache.org/www/velocity.apache.org/engine/releases/velocity-1.7 - - - apache.releases - Apache Release Distribution Repository - scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository - - - apache.snapshots - Apache Development Snapshot Repository - scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository - - - - - - Will Glass-Husain - wglass - wglass@forio.com - Forio Business Simulations - - Java Developer - - - - - Geir Magnusson Jr. - geirm - geirm@optonline.net - Independent (DVSL Maven) - - Java Developer - - - - - Daniel Rall - dlr - dlr@finemaltcoding.com - CollabNet, Inc. - - Java Developer - - - - - Henning P. Schmiedehausen - henning - hps@intermeta.de - INTERMETA - Gesellschaft für Mehrwertdienste mbH - - Java Developer - - 2 - - - - Nathan Bubna - nbubna - nathan@esha.com - ESHA Research - - Java Developer - - - - - - - - commons-collections - commons-collections - 3.2.1 - - - commons-lang - commons-lang - 2.4 - - - oro - oro - 2.0.8 - true - - - jdom - jdom - 1.0 - provided - - - commons-logging - commons-logging - 1.1 - provided - - - avalon-framework - avalon-framework - - - log4j - log4j - - - javax.servlet - servlet-api - - - - - log4j - log4j - 1.2.12 - provided - - - javax.servlet - servlet-api - 2.3 - provided - - - logkit - logkit - 2.0 - provided - - - ant - ant - 1.6 - provided - - - werken-xpath - werken-xpath - 0.9.4 - provided - - - junit - junit - 3.8.1 - test - - - hsqldb - hsqldb - 1.7.1 - test - - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.1 - - - - dependencies - issue-tracking - license - summary - scm - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.0 - - - - changes-report - jira-report - - - - - ${jira.browse.url}/%ISSUE% - - 12311337 - - fixfor=12310290&sorter/field=issuekey&sorter/order=ASC - 100 - http://velocity.apache.org/who-we-are.html - - - - org.codehaus.mojo - taglist-maven-plugin - 2.2 - - TODO - FIXME - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.5 - - - http://java.sun.com/j2se/1.4.2/docs/api - http://jakarta.apache.org/oro/api - http://jakarta.apache.org/commons/lang/api-release - http://jakarta.apache.org/commons/collections/api-release - - http://www.jdom.org/docs/apidocs - http://logging.apache.org/log4j/docs/api - http://excalibur.apache.org/apidocs - http://tomcat.apache.org/tomcat-4.1-doc/servletapi - - - - - org.apache.maven.plugins - maven-changelog-plugin - 2.1 - - - org.codehaus.mojo - findbugs-maven-plugin - 1.2 - - true - Low - Max - build/findbugs-exclude.xml - xdocs - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.4 - 1.4 - - - - - - - scm:svn:http://svn.apache.org/repos/asf/velocity/engine/trunk - scm:svn:https://svn.apache.org/repos/asf/velocity/engine/trunk - HEAD - http://svn.apache.org/viewvc/velocity/engine/trunk - - - - https://issues.apache.org/jira/browse - - - - JIRA - ${jira.browse.url}/VELOCITY - - diff --git a/velocity.spec b/velocity.spec index c865d57..295888a 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,6 +1,6 @@ Name: velocity Version: 1.7 -Release: 26%{?dist} +Release: 27%{?dist} Summary: Java-based template engine License: ASL 2.0 URL: http://velocity.apache.org/ @@ -12,24 +12,12 @@ Source1: http://repo1.maven.org/maven2/org/apache/%{name}/%{name}/%{versi # Remove bundled binaries which cannot be easily verified for licensing Source2: generate-tarball.sh -Patch0: 0001-Remove-avalon-logkit.patch -Patch1: 0004-Use-log4j-1.2.17.patch -Patch2: 0003-Use-system-jars.patch -Patch3: 0004-JDBC-41-compat.patch -Patch4: 0001-Don-t-use-Werken-XPath.patch -Patch5: 0006-Skip-Java-8-incompatible-test.patch -Patch6: velocity-1.7-doclint.patch -Patch7: velocity-1.7-osgi.patch -Patch8: 0001-Port-to-apache-commons-lang3.patch -Patch9: 0002-Port-to-OpenJDK-11.patch - -BuildRequires: javapackages-local -BuildRequires: ant -BuildRequires: ant-junit +Patch1: 0001-Port-to-apache-commons-lang3.patch +Patch2: 0002-Force-use-of-JDK-log-chute.patch +BuildRequires: maven-local BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(org.apache.commons:commons-lang3) - BuildRequires: mvn(org.apache:apache:pom:) %description @@ -53,65 +41,20 @@ template services for the Turbine web application framework. Velocity+Turbine provides a template service that will allow web applications to be developed according to a true MVC model. -%package manual -Summary: Manual for %{name} - -%description manual -Documentation for %{name}. - %package javadoc Summary: Javadoc for %{name} %description javadoc Javadoc for %{name}. -%package demo -Summary: Demo for %{name} -Requires: %{name} = %{version}-%{release} - -%description demo -Demonstrations and samples for %{name}. - -# ----------------------------------------------------------------------------- - %prep %setup -q - -# remove bundled libs/classes (except those used for testing) -find . -name '*.jar' ! -name 'test*.jar' -print -delete -find . -name '*.class' ! -name 'Foo.class' -print -delete - cp %{SOURCE1} ./pom.xml - -# remove rest of avalon logkit refences -%patch0 -p1 - -# Use log4j 1.2.17 %patch1 -p1 - -# Use system jar files instead of downloading from net %patch2 -p1 -%patch3 -p1 - -# Use jdom instead of werken-xpath -#%patch4 -p1 -%pom_remove_dep werken-xpath: - -# Skip Java 8 incompatible test -%patch5 -p1 - -# Disable Java8 doclint -%patch6 -p1 - -# Remove werken-xpath Import/Export refences in OSGi manifest file -%patch7 -p1 - -# Port to apache-commons-lang3 -%patch8 -p1 - -# Tests compare the string content of thrown exceptions which changed with jdk 11 -%patch9 -p1 +find . -name '*.jar' ! -name 'test*.jar' -print -delete +find . -name '*.class' ! -name 'Foo.class' -print -delete # Disable unneeded features rm -r src/java/org/apache/velocity/{anakia,texen,servlet,convert} @@ -121,64 +64,34 @@ rm src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java rm src/java/org/apache/velocity/runtime/log/VelocityFormatter.java rm src/java/org/apache/velocity/app/event/implement/Escape{Html,JavaScript,Sql,Xml,}Reference.java -# Disable failing tests -rm src/test/org/apache/velocity/test/VelocityServletTestCase.java -rm src/test/org/apache/velocity/test/sql/DataSourceResourceLoaderTestCase.java -rm -r src/test/org/apache/velocity/test/sql +%pom_remove_dep :oro +%pom_remove_dep :jdom +%pom_remove_dep :commons-logging +%pom_remove_dep :log4j +%pom_remove_dep :servlet-api +%pom_remove_dep :logkit +%pom_remove_dep :ant +%pom_remove_dep :werken-xpath -# ----------------------------------------------------------------------------- +%mvn_alias : %{name}:%{name} %build - -export CLASSPATH=$(build-classpath \ -commons-collections:commons-collections \ -org.apache.commons:commons-lang3 \ -commons-logging:commons-logging \ -javax.servlet:javax.servlet-api \ -oro:oro \ -log4j:log4j:1.2.17 \ -) -ant \ - -buildfile build/build.xml \ - -Dbuild.sysclasspath=first \ - -Djavac.target=1.6 \ - -Djavac.source=1.6 \ - jar javadocs - -# fix line-endings in generated files -sed -i 's/\r//' docs/api/stylesheet.css docs/api/package-list - -# ----------------------------------------------------------------------------- +%mvn_build -f %install -%mvn_file : %{name} -%mvn_alias : %{name}:%{name} -%mvn_artifact pom.xml bin/%{name}-%{version}.jar -%mvn_install -J docs/api - -# zero-length file -rm -r test/issues/velocity-537/compare/velocity537.vm.cmp -# data -install -d -m 755 %{buildroot}%{_datadir}/%{name} -cp -pr examples test %{buildroot}%{_datadir}/%{name} - +%mvn_install %files -f .mfiles %doc README.txt %license LICENSE NOTICE -%files manual -%license LICENSE NOTICE -%doc docs/* - %files javadoc -f .mfiles-javadoc %license LICENSE NOTICE -%files demo -%license LICENSE NOTICE -%{_datadir}/%{name} - %changelog +* Fri May 15 2020 Mikolaj Izdebski - 1.7-27 +- Build with Maven + * Tue Nov 05 2019 Mikolaj Izdebski - 1.7-26 - Mass rebuild for javapackages-tools 201902 From a22a8f84a4c2d0fa569d1ec57de7dce8ce32b9af Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 11 Mar 2021 17:03:02 +0100 Subject: [PATCH 19/21] Fix for CVE-2020-13936 --- 0003-CVE-2020-13936.patch | 77 +++++++++++++++++++++++++++++++++++++++ velocity.spec | 2 + 2 files changed, 79 insertions(+) create mode 100644 0003-CVE-2020-13936.patch diff --git a/0003-CVE-2020-13936.patch b/0003-CVE-2020-13936.patch new file mode 100644 index 0000000..5e9f9b3 --- /dev/null +++ b/0003-CVE-2020-13936.patch @@ -0,0 +1,77 @@ +From 3be84770e7fbe6f000f0c002905e86fe1412d551 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 11 Mar 2021 16:22:50 +0100 +Subject: [PATCH] CVE-2020-13936 + +From upstream patches: +https://github.com/apache/velocity-engine/commit/1ba60771d23dae7e6b3138ae6bee09cf6f9d2485 +https://github.com/apache/velocity-engine/commit/15909056fe51f5d39d49e101d706d3075876dde4 +https://github.com/apache/velocity-engine/commit/3f5d477bb4f4397bed2d2926c35dcef7de3aae3e + +--- + .../velocity/runtime/defaults/velocity.properties | 15 ++++++++++----- + .../introspection/SecureIntrospectorImpl.java | 9 +++++++++ + 2 files changed, 19 insertions(+), 5 deletions(-) + +diff --git a/src/java/org/apache/velocity/runtime/defaults/velocity.properties b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +index 855118b..a8a9231 100644 +--- a/src/java/org/apache/velocity/runtime/defaults/velocity.properties ++++ b/src/java/org/apache/velocity/runtime/defaults/velocity.properties +@@ -245,15 +245,16 @@ runtime.introspector.uberspect = org.apache.velocity.util.introspection.Uberspec + # accessed. + # ---------------------------------------------------------------------------- + ++# Prohibit reflection + introspector.restrict.packages = java.lang.reflect + + # The two most dangerous classes ++# ClassLoader, Thread, and subclasses disabled by default in SecureIntrospectorImpl + +-introspector.restrict.classes = java.lang.Class +-introspector.restrict.classes = java.lang.ClassLoader +- +-# Restrict these for extra safety ++# Restrict these system classes. Note that anything in this list is matched exactly. ++# (Subclasses must be explicitly named to be included). + ++introspector.restrict.classes = java.lang.Class + introspector.restrict.classes = java.lang.Compiler + introspector.restrict.classes = java.lang.InheritableThreadLocal + introspector.restrict.classes = java.lang.Package +@@ -262,8 +263,12 @@ introspector.restrict.classes = java.lang.Runtime + introspector.restrict.classes = java.lang.RuntimePermission + introspector.restrict.classes = java.lang.SecurityManager + introspector.restrict.classes = java.lang.System +-introspector.restrict.classes = java.lang.Thread + introspector.restrict.classes = java.lang.ThreadGroup + introspector.restrict.classes = java.lang.ThreadLocal + ++# Restrict instance managers for common servlet containers (Tomcat, JBoss, Jetty) + ++introspector.restrict.classes = org.apache.catalina.core.DefaultInstanceManager ++introspector.restrict.classes = org.apache.tomcat.SimpleInstanceManager ++introspector.restrict.classes = org.wildfly.extension.undertow.deployment.UndertowJSPInstanceManager ++introspector.restrict.classes = org.eclipse.jetty.util.DecoratedObjectFactory +diff --git a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java +index f317b1c..25fc84d 100644 +--- a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java ++++ b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java +@@ -121,6 +121,15 @@ public class SecureIntrospectorImpl extends Introspector implements SecureIntros + return true; + } + ++ /** ++ * Always disallow ClassLoader, Thread and subclasses ++ */ ++ if (ClassLoader.class.isAssignableFrom(clazz) || ++ Thread.class.isAssignableFrom(clazz)) ++ { ++ return false; ++ } ++ + /** + * check the classname (minus any array info) + * whether it matches disallowed classes or packages +-- +2.29.2 + diff --git a/velocity.spec b/velocity.spec index 295888a..64d26bf 100644 --- a/velocity.spec +++ b/velocity.spec @@ -14,6 +14,7 @@ Source2: generate-tarball.sh Patch1: 0001-Port-to-apache-commons-lang3.patch Patch2: 0002-Force-use-of-JDK-log-chute.patch +Patch3: 0003-CVE-2020-13936.patch BuildRequires: maven-local BuildRequires: mvn(commons-collections:commons-collections) @@ -52,6 +53,7 @@ Javadoc for %{name}. cp %{SOURCE1} ./pom.xml %patch1 -p1 %patch2 -p1 +%patch3 -p1 find . -name '*.jar' ! -name 'test*.jar' -print -delete find . -name '*.class' ! -name 'Foo.class' -print -delete From 0136dda54e5bf0c45de0377791fd52f95c0ccdfe Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 16 Apr 2021 15:33:13 +0200 Subject: [PATCH 20/21] Conditionalize buildrequires in bootstrap mode --- velocity.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/velocity.spec b/velocity.spec index 64d26bf..cb50f38 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,3 +1,5 @@ +%bcond_without bootstrap + Name: velocity Version: 1.7 Release: 27%{?dist} @@ -17,9 +19,13 @@ Patch2: 0002-Force-use-of-JDK-log-chute.patch Patch3: 0003-CVE-2020-13936.patch BuildRequires: maven-local +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: mvn(commons-collections:commons-collections) BuildRequires: mvn(org.apache.commons:commons-lang3) BuildRequires: mvn(org.apache:apache:pom:) +%endif %description Velocity is a Java-based template engine. It permits anyone to use the From 5cf6b304219f6fa71e45d2b8cade0018a0298c6f Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 13 May 2021 19:08:43 +0200 Subject: [PATCH 21/21] Turn off bootstrap mode by default --- velocity.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/velocity.spec b/velocity.spec index cb50f38..515a956 100644 --- a/velocity.spec +++ b/velocity.spec @@ -1,4 +1,4 @@ -%bcond_without bootstrap +%bcond_with bootstrap Name: velocity Version: 1.7