diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f8cd94b..4cfca52 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,10 +45,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # 4.1.2 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # 4.1.5 with: persist-credentials: false - - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -57,7 +57,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c # 3.24.7 + uses: github/codeql-action/init@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # 3.25.4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -68,7 +68,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@3ab4101902695724f9365a384f86c1074d94e18c # 3.24.7 + uses: github/codeql-action/autobuild@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # 3.25.4 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -82,4 +82,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c # 3.24.7 + uses: github/codeql-action/analyze@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # 3.25.4 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 00ddd57..070ac49 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: java: [ 8 ] steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 with: persist-credentials: false - name: Set up JDK ${{ matrix.java }} @@ -42,6 +42,6 @@ jobs: run: mvn --show-version --batch-mode --no-transfer-progress verify jacoco:report - name: Upload coverage to Codecov - uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v3 + uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v3 with: files: ./target/site/jacoco/jacoco.xml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 166ce30..cee3d81 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -31,12 +31,12 @@ jobs: java: [ 8, 11, 17, 21 ] experimental: [false] # include: -# - java: 22-ea +# - java: 23-ea # experimental: true steps: - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 1fbbd73..9f22301 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -40,12 +40,12 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # 4.1.2 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # 4.1.5 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # 2.3.1 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # 2.3.3 with: results_file: results.sarif results_format: sarif @@ -57,13 +57,13 @@ jobs: publish_results: true - name: "Upload artifact" - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # 4.3.1 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 with: name: SARIF file path: results.sarif retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@3ab4101902695724f9365a384f86c1074d94e18c # 3.24.7 + uses: github/codeql-action/upload-sarif@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # 3.25.4 with: sarif_file: results.sarif diff --git a/README.md b/README.md index 0730ab8..752406f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Apache Commons Logging [![Java CI](https://github.com/apache/commons-logging/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/commons-logging/actions/workflows/maven.yml) [![Coverage Status](https://codecov.io/gh/apache/commons-logging/branch/master/graph/badge.svg)](https://app.codecov.io/gh/apache/commons-logging) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/commons-logging/commons-logging/badge.svg?gav=true)](https://maven-badges.herokuapp.com/maven-central/commons-logging/commons-logging/?gav=true) -[![Javadocs](https://javadoc.io/badge/commons-logging/commons-logging/1.3.1.svg)](https://javadoc.io/doc/commons-logging/commons-logging/1.3.1) +[![Javadocs](https://javadoc.io/badge/commons-logging/commons-logging/1.3.2.svg)](https://javadoc.io/doc/commons-logging/commons-logging/1.3.2) [![CodeQL](https://github.com/apache/commons-logging/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/apache/commons-logging/actions/workflows/codeql-analysis.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/apache/commons-logging/badge)](https://api.securityscorecards.dev/projects/github.com/apache/commons-logging) @@ -70,7 +70,7 @@ Alternatively, you can pull it from the central Maven repositories: commons-logging commons-logging - 1.3.1 + 1.3.2 ``` diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 4028541..d1144da 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -38,6 +38,56 @@ Changes * Bump logkit from 1.0.1 to 2.0 #32. Thanks to Dependabot. +Historical list of changes: https://commons.apache.org/proper/commons-logging/changes-report.html + +Download it from https://commons.apache.org/proper/commons-logging/download_logging.cgi + +For complete information on Apache Commons Logging, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons Logging website: + +https://commons.apache.org/proper/commons-logging/ + +----------------------------------------------------------------------------- +Apache Commons Logging +Version 1.3.1 +RELEASE NOTES + +The Apache Commons Logging team is pleased to announce the release of Apache Commons Logging 1.3.1 + +Apache Commons Logging is a thin adapter allowing configurable bridging to other, +well-known logging systems. + +This is a feature and maintenance release. Java 8 or later is required. + +Changes in this version +----------------------- + +New features +------------ + +* Add Maven property project.build.outputTimestamp for build reproducibility. Thanks to Gary Gregory. + +Fixed Bugs +---------- + +* Remove references to very old JDK and Commons Logging versions #201. Thanks to Elliotte Rusty Harold. +* Update from Logj 1 to the Log4j 2 API compatibility layer #231. Thanks to Gary Gregory, Piotr P. Karwasz. +* Allow Servlet 4 in OSGi environment #191. Thanks to Vclav Haisman. +* Fix generics warnings #213. Thanks to Elliotte Rusty Harold. +* LOGGING-189: Fix Import-Package entry for org.slf4j #188. Thanks to Vclav Haisman, Sebb, Hannes Wellmann, Gary Gregory, Piotr P. Karwasz. + +Changes +------- + +* Bump org.apache.commons:commons-parent from 65 to 67. Thanks to Dependabot. +* Bump log4j2.version from 2.21.1 to 2.23.1 #187, #230. Thanks to Dependabot, Piotr P. Karwasz. +* Bump org.slf4j:slf4j-api from 2.0.9 to 2.0.12 #207. Thanks to Dependabot. +* Bump ch.qos.logback:logback-classic from 1.3.11 to 1.3.14 #212. Thanks to Dependabot, Gary Gregory. +* Bump ch.qos.logback:logback-core from 1.3.11 to 1.3.14 #211. Thanks to Dependabot, Gary Gregory. +* Bump com.h3xstream.findsecbugs:findsecbugs-plugin from 1.12.0 to 1.13.0. Thanks to Dependabot. +* Bump logkit from 1.0.1 to 2.0 #32. Thanks to Dependabot. + + Historical list of changes: https://commons.apache.org/proper/commons-logging/changes-report.html Download it from https://commons.apache.org/proper/commons-logging/download_logging.cgi diff --git a/pom.xml b/pom.xml index f707ce3..a68ec2e 100644 --- a/pom.xml +++ b/pom.xml @@ -18,15 +18,15 @@ under the License. --> org.apache.commons commons-parent - 67 + 69 4.0.0 commons-logging @@ -36,31 +36,69 @@ under the License. Apache Commons Logging is a thin adapter allowing configurable bridging to other, well-known logging systems. https://commons.apache.org/proper/commons-logging/ - + + java18 + 1.8 + ${commons.logging.javaversion} + ${commons.logging.javaversion} + logging + org.apache.commons.logging + 1.3.2 + 1.3.3 + 1.3.1 + true + LOGGING + 12310484 + + RC2 + true + + 3.2.1 + + filesystem + 2.23.1 + 1.3.14 + 2.0.13 + 1.13.0 + + javax.servlet;version="[2.1.0, 5.0.0)";resolution:=optional, + org.apache.avalon.framework.logger;version="[4.1.3, 4.1.5]";resolution:=optional, + org.apache.log;version="[1.0.1, 1.0.1]";resolution:=optional, + org.apache.log4j;version="[1.2.15, 2.0.0)";resolution:=optional, + org.apache.logging.log4j;version="[2.0, 4.0)";resolution:=optional, + org.slf4j;version="[1.7, 3)";resolution:=optional, + org.slf4j.spi;version="[1.7, 3)";resolution:=optional + + 2024-03-24T15:00:55Z + + true + 0.86 + 0.52 + 0.69 + 0.49 + 0.56 + 0.50 + JIRA https://issues.apache.org/jira/browse/LOGGING - 2001 - scm:git:https://gitbox.apache.org/repos/asf/commons-logging scm:git:https://gitbox.apache.org/repos/asf/commons-logging https://gitbox.apache.org/repos/asf/commons-logging - clean verify apache-rat:check japicmp:cmp javadoc:javadoc checkstyle:check pmd:check - org.apache.maven.plugins @@ -68,8 +106,8 @@ under the License. create-test-jar package @@ -77,7 +115,6 @@ under the License. test-jar - create-api-jar package @@ -101,7 +138,6 @@ under the License. - create-adapters-jar package @@ -130,7 +166,6 @@ under the License. - org.apache.maven.plugins maven-antrun-plugin @@ -153,15 +188,14 @@ under the License. - org.apache.maven.plugins maven-surefire-plugin @@ -169,15 +203,14 @@ under the License. true - org.codehaus.mojo cobertura-maven-plugin @@ -186,7 +219,6 @@ under the License. true - org.moditect moditect-maven-plugin @@ -206,15 +238,14 @@ under the License. - org.apache.maven.plugins maven-failsafe-plugin @@ -260,8 +291,8 @@ under the License. serviceLoader-test @@ -278,7 +309,7 @@ under the License. log4j-test @@ -298,16 +329,16 @@ under the License. + --> org.apache.logging.log4j.core.impl.ReusableLogEventFactory log4j12-test @@ -337,8 +368,8 @@ under the License. org.apache.logging.log4j.core.impl.ReusableLogEventFactory @@ -354,7 +385,7 @@ under the License. slf4j-test @@ -379,7 +410,7 @@ under the License. log4j-to-slf4j-test @@ -412,7 +443,6 @@ under the License. - org.apache.maven.plugins maven-assembly-plugin @@ -436,7 +466,6 @@ under the License. - org.apache.maven.plugins maven-scm-publish-plugin @@ -447,7 +476,6 @@ under the License. - org.apache.maven.plugins maven-checkstyle-plugin @@ -457,7 +485,6 @@ under the License. false - org.apache.maven.plugins maven-pmd-plugin @@ -482,9 +509,8 @@ under the License. - org.apache.maven.plugins @@ -508,10 +534,24 @@ under the License. - + + + + org.apache.felix + maven-bundle-plugin + + + =1.0.0)(!(version>=2.0.0)))";resolution:=optional, + osgi.serviceloader;filter:="(osgi.serviceloader=org.apache.commons.logging.LogFactory)";osgi.serviceloader="org.apache.commons.logging.LogFactory";resolution:=optional;cardinality:=multiple + ]]> + + + + + - org.junit.vintage @@ -594,7 +634,6 @@ under the License. test - @@ -631,7 +670,6 @@ under the License. - apache.website @@ -639,43 +677,6 @@ under the License. scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-logging/ - - - java18 - 1.8 - ${commons.logging.javaversion} - ${commons.logging.javaversion} - logging - org.apache.commons.logging - 1.3.1 - 1.3.2 - 1.3.0 - true - LOGGING - 12310484 - - RC2 - true - - 3.2.1 - - filesystem - 2.23.1 - 1.3.14 - 2.0.12 - 1.13.0 - - javax.servlet;version="[2.1.0, 5.0.0)";resolution:=optional, - org.apache.avalon.framework.logger;version="[4.1.3, 4.1.5]";resolution:=optional, - org.apache.log;version="[1.0.1, 1.0.1]";resolution:=optional, - org.apache.log4j;version="[1.2.15, 2.0.0)";resolution:=optional, - org.apache.logging.log4j;version="[2.0, 4.0)";resolution:=optional, - org.slf4j;version="[1.7, 3)";resolution:=optional, - org.slf4j.spi;version="[1.7, 3)";resolution:=optional - - 2024-03-24T15:00:55Z - - baliuka @@ -819,5 +820,4 @@ under the License. arturobernalg@yahoo.com - diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 246c115..14fbec0 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -43,6 +43,13 @@ The type attribute can be add,update,fix,remove. Release Notes + + Add OSGi metadata to enable Service Loader Mediator #234. + Apache commons logging shows 1.4 as latest release instead of 1.3.1. + + Bump org.apache.commons:commons-parent from 67 to 69 #240. + Bump org.slf4j:slf4j-api from 2.0.12 to 2.0.13 #248. + Add Maven property project.build.outputTimestamp for build reproducibility. diff --git a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java index 987d6ac..2102cf2 100644 --- a/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java +++ b/src/main/java/org/apache/commons/logging/impl/AvalonLogger.java @@ -87,7 +87,7 @@ public class AvalonLogger implements Log { * @param name the name of the avalon logger implementation to delegate to */ public AvalonLogger(final String name) { - Objects.requireNonNull(defaultLogger, "default logger has to be specified if this constructor is used!"); + Objects.requireNonNull(defaultLogger, "defaultLogger"); this.logger = defaultLogger.getChildLogger(name); } diff --git a/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java b/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java index 00a4753..ca0cdcc 100644 --- a/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java +++ b/src/main/java/org/apache/commons/logging/impl/WeakHashtable.java @@ -106,7 +106,7 @@ import java.util.Set; * for most or all users. * * @since 1.1 - * @deprecated No longer used. + * @deprecated No longer used, will be removed in 2.0. */ @Deprecated public final class WeakHashtable extends Hashtable { diff --git a/src/site/resources/profile.jacoco b/src/site/resources/profile.jacoco new file mode 100644 index 0000000..e69de29 diff --git a/src/site/xdoc/download_logging.xml b/src/site/xdoc/download_logging.xml index 7cebced..a35c002 100644 --- a/src/site/xdoc/download_logging.xml +++ b/src/site/xdoc/download_logging.xml @@ -113,32 +113,32 @@ limitations under the License.

-
+
- - - + + + - - - + + +
commons-logging-1.3.1-bin.tar.gzsha512pgpcommons-logging-1.3.2-bin.tar.gzsha512pgp
commons-logging-1.3.1-bin.zipsha512pgpcommons-logging-1.3.2-bin.zipsha512pgp
- - - + + + - - - + + +
commons-logging-1.3.1-src.tar.gzsha512pgpcommons-logging-1.3.2-src.tar.gzsha512pgp
commons-logging-1.3.1-src.zipsha512pgpcommons-logging-1.3.2-src.zipsha512pgp
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index 409b595..ab10ec5 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -81,7 +81,7 @@ This gives short introductions to topics such as advanced class loading. Binary and source distributions are available here.

- +

Please refer to the change-report.

diff --git a/src/test/java/org/apache/commons/logging/LoadTestCase.java b/src/test/java/org/apache/commons/logging/LoadTestCase.java index 0005202..a2eda91 100644 --- a/src/test/java/org/apache/commons/logging/LoadTestCase.java +++ b/src/test/java/org/apache/commons/logging/LoadTestCase.java @@ -78,11 +78,10 @@ public class LoadTestCase extends TestCase { // but it will delegate to JUnit class loader first @Override public Class loadClass(final String name) throws ClassNotFoundException { - // isolates all logging classes, application in the same class loader too. // filters exceptions to simplify handling in test for (final String element : LOG_PCKG) { - if (name.startsWith(element) && name.indexOf("Exception") == -1) { + if (name.startsWith(element) && !name.contains("Exception")) { return def(name); } } diff --git a/src/test/java/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java b/src/test/java/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java index 9a52c3b..8a787fe 100644 --- a/src/test/java/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java +++ b/src/test/java/org/apache/commons/logging/tccl/log/TcclDisabledTestCase.java @@ -149,8 +149,7 @@ public class TcclDisabledTestCase extends TestCase { assertNotNull(log); // silence compiler warning about unused var } catch (final LogConfigurationException ex) { // ok, expected - final int index = ex.getMessage().indexOf(MY_LOG_IMPL); - assertTrue("MyLog not found", index >= 0); + assertTrue("MyLog not found", ex.getMessage().contains(MY_LOG_IMPL)); } } } diff --git a/src/test/java/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java b/src/test/java/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java index df9634e..e8f2e88 100644 --- a/src/test/java/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java +++ b/src/test/java/org/apache/commons/logging/tccl/logfactory/TcclDisabledTestCase.java @@ -144,8 +144,7 @@ public class TcclDisabledTestCase extends TestCase { } catch (final org.apache.commons.logging.LogConfigurationException ex) { // ok, custom MyLogFactoryImpl as specified in props_disable_tccl // could not be found. - final int index = ex.getMessage().indexOf(MY_LOG_FACTORY_IMPL); - assertTrue("MylogFactoryImpl not found", index >= 0); + assertTrue("MylogFactoryImpl not found", ex.getMessage().contains(MY_LOG_FACTORY_IMPL)); } } }