default to JDK logging and drop commons-logging and log4j12 implementations

This commit is contained in:
Fabio Valentini 2020-09-11 21:22:10 +02:00
parent 675ae1d0a1
commit 66e053ac1d
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF
4 changed files with 28 additions and 69 deletions

View File

@ -35,27 +35,14 @@ index 750a59a..7fac119 100644
# ----------------------------------------------------------------------------
-# default LogChute to use: default: AvalonLogChute, Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute
+# default LogChute to use: default: Log4JLogChute, CommonsLogLogChute, ServletLogChute, JdkLogChute
+# default LogChute to use: default: 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
+runtime.log.logsystem.class = 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.
*/
--
2.26.2

View File

@ -1,25 +0,0 @@
From b12e4b19a88efce7559514c9dae686b177ecb347 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 30 Jul 2020 15:36:29 +0200
Subject: [PATCH 1/8] Use log4j 1.2.17
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index f453208..8cb5d3f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -187,7 +187,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.12</version>
+ <version>1.2.17</version>
<scope>provided</scope>
</dependency>
<dependency>
--
2.26.2

View File

@ -184,12 +184,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>

View File

@ -2,7 +2,7 @@
Name: velocity
Version: 1.7
Release: 32%{?dist}
Release: 33%{?dist}
Epoch: 0
Summary: Java-based template engine
License: ASL 2.0
@ -16,7 +16,6 @@ Source1: http://repo1.maven.org/maven2/org/apache/%{name}/%{name}/%{versi
Source2: generate-tarball.sh
Patch0: 0000-Remove-avalon-logkit.patch
Patch1: 0001-Use-log4j-1.2.17.patch
Patch2: 0002-Use-system-jars.patch
Patch3: 0003-JDBC-41-compat.patch
Patch4: 0004-Do-not-use-Werken-XPath.patch
@ -25,24 +24,22 @@ Patch6: 0006-Run-javadoc-with-Xdoclint-none.patch
Patch7: 0007-Fix-OSGi-metadata.patch
Patch8: 0008-Port-to-apache-commons-lang3.patch
BuildRequires: javapackages-local
BuildRequires: ant
BuildRequires: antlr
BuildRequires: junit
BuildRequires: ant-junit
BuildRequires: antlr
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-lang3
BuildRequires: apache-parent
BuildRequires: bcel
%if %{with hsqldb}
BuildRequires: hsqldb-lib
%endif
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-logging
BuildRequires: apache-commons-lang3
BuildRequires: glassfish-servlet-api
BuildRequires: jakarta-oro
BuildRequires: javapackages-local
BuildRequires: jaxen
BuildRequires: jdom
BuildRequires: bcel
BuildRequires: log4j12
BuildRequires: apache-parent
BuildRequires: junit
%description
Velocity is a Java-based template engine. It permits anyone to use the
@ -95,12 +92,9 @@ find . -name '*.class' ! -name 'Foo.class' -print -delete
cp %{SOURCE1} ./pom.xml
# remove rest of avalon logkit refences
# remove rest of avalon logkit refences and default to JDK logging
%patch0 -p1
# Use log4j 1.2.17
%patch1 -p1
# Use system jar files instead of downloading from net
%patch2 -p1
@ -123,18 +117,26 @@ cp %{SOURCE1} ./pom.xml
%patch8 -p1
# 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
rm src/java/org/apache/velocity/runtime/log/AvalonLogChute.java
rm src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java
rm src/java/org/apache/velocity/runtime/log/VelocityFormatter.java
# Remove dependency on log4j12
rm src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
rm src/java/org/apache/velocity/runtime/log/Log4JLogSystem.java
rm src/java/org/apache/velocity/runtime/log/SimpleLog4JLogSystem.java
# Remove dependency on commons-logging
rm src/java/org/apache/velocity/runtime/log/CommonsLogLogChute.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
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
%if %{without hsqldb}
rm -r src/test/org/apache/velocity/test/sql
rm -r src/test/org/apache/velocity/test/sql/
%endif
# -----------------------------------------------------------------------------
@ -144,11 +146,9 @@ export CLASSPATH=$(build-classpath \
antlr \
apache-commons-collections \
commons-lang3 \
commons-logging \
glassfish-servlet-api \
junit \
jakarta-oro \
log4j:log4j:1.2.17 \
junit \
jaxen \
jdom \
bcel \
@ -196,6 +196,9 @@ cp -pr examples test %{buildroot}%{_datadir}/%{name}
%{_datadir}/%{name}
%changelog
* Fri Sep 11 2020 Fabio Valentini <decathorpe@gmail.com> - 0:1.7-33
- Default to JDK logging and drop commons-logging and log4j12 implementations.
* Thu Jul 30 2020 Fabio Valentini <decathorpe@gmail.com> - 0:1.7-32
- Port to commons-lang3.