This is an automated email from the ASF dual-hosted git repository. cziegeler pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/felix-dev.git
The following commit(s) were added to refs/heads/master by this push: new 6cac848e66 FELIX-6771 : Use SLF4J 2 6cac848e66 is described below commit 6cac848e66ac9028bf4eb833ceff544bb6f07bc4 Author: Carsten Ziegeler <cziege...@apache.org> AuthorDate: Fri Apr 18 10:49:28 2025 +0200 FELIX-6771 : Use SLF4J 2 --- http/base/pom.xml | 2 +- http/bridge/pom.xml | 8 +++--- http/itest/pom.xml | 32 +++++++++++----------- .../felix/http/itest/BaseIntegrationTest.java | 12 ++------ http/jetty/pom.xml | 13 ++++++--- .../http/jetty/it/AbstractJettyTestSupport.java | 8 ++---- .../felix/http/jetty/it/LightClassifierIT.java | 4 +-- .../jetty/it/MissingWebsocketDependenciesIT.java | 8 +++--- http/jetty12/pom.xml | 11 +++++--- .../http/jetty/it/AbstractJettyTestSupport.java | 8 ++---- .../felix/http/jetty/it/LightClassifierIT.java | 8 ++---- .../jetty/it/MissingWebsocketDependenciesIT.java | 6 ++-- 12 files changed, 56 insertions(+), 64 deletions(-) diff --git a/http/base/pom.xml b/http/base/pom.xml index 92a7bb7356..c4e9706856 100644 --- a/http/base/pom.xml +++ b/http/base/pom.xml @@ -87,7 +87,7 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> + <version>2.0.17</version> <scope>provided</scope> </dependency> <dependency> diff --git a/http/bridge/pom.xml b/http/bridge/pom.xml index ebeb36f5d9..49d441f029 100644 --- a/http/bridge/pom.xml +++ b/http/bridge/pom.xml @@ -142,13 +142,13 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.7.36</version> + <version>2.0.17</version> <scope>provided</scope> </dependency> <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> - <version>6.0.0</version> + <version>6.1.0</version> </dependency> <dependency> <groupId>org.osgi</groupId> @@ -186,12 +186,12 @@ <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.http.base</artifactId> - <version>5.1.10</version> + <version>5.1.13-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.http.wrappers</artifactId> - <version>1.1.8</version> + <version>6.1.0</version> </dependency> </dependencies> </project> diff --git a/http/itest/pom.xml b/http/itest/pom.xml index 23f6adf978..1d9a096b0a 100644 --- a/http/itest/pom.xml +++ b/http/itest/pom.xml @@ -1,12 +1,12 @@ -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for additional - information regarding copyright ownership. The ASF licenses this file to - you under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of - the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required - by applicable law or agreed to in writing, software distributed under the - License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, either express or implied. See the License for the specific +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor + license agreements. See the NOTICE file distributed with this work for additional + information regarding copyright ownership. The ASF licenses this file to + you under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of + the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required + by applicable law or agreed to in writing, software distributed under the + License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> @@ -32,10 +32,10 @@ <properties> <felix.java.version>11</felix.java.version> - <http.servlet.api.version>2.1.0</http.servlet.api.version> + <http.servlet.api.version>6.1.0</http.servlet.api.version> <http.jetty.version>5.1.33-SNAPSHOT</http.jetty.version> <http.jetty.id>org.apache.felix.http.jetty</http.jetty.id> - <pax.exam.version>4.13.1</pax.exam.version> + <pax.exam.version>4.13.3</pax.exam.version> <pax.url.aether.version>2.6.14</pax.url.aether.version> </properties> @@ -44,7 +44,7 @@ <id>jetty12</id> <properties> <felix.java.version>17</felix.java.version> - <http.servlet.api.version>3.0.0</http.servlet.api.version> + <http.servlet.api.version>6.1.0</http.servlet.api.version> <http.jetty.version>1.0.29-SNAPSHOT</http.jetty.version> <http.jetty.id>org.apache.felix.http.jetty12</http.jetty.id> </properties> @@ -56,13 +56,13 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> - <systemPropertyVariables> + <systemPropertyVariables> <http.servlet.api.version>${http.servlet.api.version}</http.servlet.api.version> <http.jetty.version>${http.jetty.version}</http.jetty.version> <http.jetty.id>${http.jetty.id}</http.jetty.id> </systemPropertyVariables> </configuration> - </plugin> + </plugin> </plugins> </build> <dependencies> @@ -83,7 +83,7 @@ <artifactId>httpcore-osgi</artifactId> <version>4.4.6</version> <scope>provided</scope> - </dependency> + </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient-osgi</artifactId> @@ -94,7 +94,7 @@ <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-json_1.1_spec</artifactId> <version>1.3</version> - <scope>provided</scope> + <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.johnzon</groupId> diff --git a/http/itest/src/test/java/org/apache/felix/http/itest/BaseIntegrationTest.java b/http/itest/src/test/java/org/apache/felix/http/itest/BaseIntegrationTest.java index 8bc267372e..81b518a72c 100644 --- a/http/itest/src/test/java/org/apache/felix/http/itest/BaseIntegrationTest.java +++ b/http/itest/src/test/java/org/apache/felix/http/itest/BaseIntegrationTest.java @@ -156,14 +156,8 @@ public abstract class BaseIntegrationTest { // scavenge sessions every 10 seconds (10 minutes is default in 9.4.x) systemProperty("org.eclipse.jetty.servlet.SessionScavengingInterval").value("10"), - mavenBundle("org.slf4j", "slf4j-api", "1.7.32"), - mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.32"), - mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.32"), - - mavenBundle("org.apache.felix", "org.apache.felix.log", "1.2.6"), - mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "5.3.0"), - mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.1.0"), - + // update pax logging for SLF4J 2 + mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"), mavenBundle("org.slf4j", "slf4j-api", "2.0.17"), mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", "1.2.16").startLevel(START_LEVEL_SYSTEM_BUNDLES), mavenBundle("org.apache.felix", "org.apache.felix.configadmin").version("1.9.22").startLevel(START_LEVEL_SYSTEM_BUNDLES), @@ -246,7 +240,7 @@ public abstract class BaseIntegrationTest { for (final ServiceReference<ManagedService> serviceRef : serviceRefs) { ManagedService service = m_context.getService(serviceRef); - try { + try { service.updated(props); } catch (ConfigurationException ex) { fail("Invalid configuration provisioned: " + ex.getMessage()); diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 65733fafd7..b6e962c5f4 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -77,7 +77,7 @@ && !"org.eclipse.jetty.websocket".equals(artifact.getGroupId()) // skip the optional websocket artifacts && !"jetty-annotations".equals(artifact.getArtifactId()) // skip the transitive artifacts from the optional websocket artifacts && !"jetty-plus".equals(artifact.getArtifactId()) - && !"jetty-webapp".equals(artifact.getArtifactId())) { + && !"jetty-webapp".equals(artifact.getArtifactId())) { def jar; try { jar = new java.util.jar.JarFile(artifact.file) @@ -209,7 +209,6 @@ org.osgi.service.http.context;version="[1.1,1.2)", org.osgi.service.http.runtime;version="[1.1,1.2)", org.osgi.service.http.runtime.dto;version="[1.1,1.2)", - org.slf4j;version="[1.0,3.0)", * </Import-Package> <DynamicImport-Package> @@ -375,6 +374,12 @@ </build> <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>2.0.17</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> @@ -509,7 +514,7 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.14.0</version> + <version>2.19.0</version> </dependency> <!-- Testing --> <dependency> @@ -598,7 +603,7 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> - <version>2.0.13</version> + <version>2.0.17</version> <scope>test</scope> </dependency> diff --git a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index 8ca81650d6..54f3210d56 100644 --- a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -41,14 +41,10 @@ import org.ops4j.pax.exam.options.SystemPropertyOption; import org.ops4j.pax.exam.options.UrlProvisionOption; import org.ops4j.pax.exam.options.extra.VMOption; import org.ops4j.pax.exam.util.PathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { protected static final String JETTY_VERSION = "11.0.25"; - protected final Logger logger = LoggerFactory.getLogger(getClass()); - private final String workingDirectory = String.format("%s/target/paxexam/%s/%s", PathUtils.getBaseDir(), getClass().getSimpleName(), UUID.randomUUID()); /** @@ -77,8 +73,10 @@ public abstract class AbstractJettyTestSupport { keepCaches(), localMavenRepo(), CoreOptions.workingDirectory(workingDirectory()), + // update pax logging for SLF4J 2 + mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"), optionalRemoteDebug(), - mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.0.0"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("6.1.0"), testBundle("bundle.filename"), junitBundles(), awaitility(), diff --git a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java index fd46d14d54..626dfde175 100644 --- a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java +++ b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java @@ -56,9 +56,7 @@ public class LightClassifierIT extends AbstractJettyTestSupport { spifly(), // Minimum additional jetty dependency bundles - mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("2.0.13"), - mavenBundle().groupId("org.slf4j").artifactId("slf4j-simple").version("2.0.13"), - mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.16.1"), + mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.19.0"), mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version("1.5"), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").version(jettyVersion), diff --git a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java index b11d3ae094..f5edf7219c 100644 --- a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java +++ b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java @@ -65,17 +65,17 @@ public class MissingWebsocketDependenciesIT extends AbstractJettyTestSupport { Awaitility.await("waitForLogs") .atMost(Duration.ofSeconds(50)) .pollDelay(Duration.ofMillis(200)) - .until(() -> containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http]")); + .until(() -> containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http]")); - assertTrue(containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http] : Failed to initialize jetty specific websocket " + assertTrue(containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http] WARN : Failed to initialize jetty specific websocket " + "support since the initializer class was not found. Check if the websocket-jetty-server bundle is deployed.")); - assertTrue(containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http] : Failed to initialize jakarta standard websocket" + assertTrue(containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http] WARN : Failed to initialize jakarta standard websocket" + " support since the initializer class was not found. Check if the websocket-jakarta-server bundle is deployed.")); } /** * Checks if the text is present in the file - * + * * @param file the file to check * @param expected the text to look for * @return true if the text was found, false otherwise diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index ac6901f02f..4e84dc4c33 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -213,7 +213,6 @@ org.osgi.service.http.context;version="[1.1,1.2)", org.osgi.service.http.runtime;version="[1.1,1.2)", org.osgi.service.http.runtime.dto;version="[1.1,1.2)", - org.slf4j;version="[1.0,3.0)", * </Import-Package> <DynamicImport-Package> @@ -405,7 +404,6 @@ org.osgi.service.http.context;version="[1.1,1.2)", org.osgi.service.http.runtime;version="[1.1,1.2)", org.osgi.service.http.runtime.dto;version="[1.1,1.2)", - org.slf4j;version="[1.0,3.0)", * </Import-Package> <DynamicImport-Package> @@ -513,7 +511,6 @@ org.osgi.service.http.context;version="[1.1,1.2)", org.osgi.service.http.runtime;version="[1.1,1.2)", org.osgi.service.http.runtime.dto;version="[1.1,1.2)", - org.slf4j;version="[1.0,3.0)", * </Import-Package> <DynamicImport-Package> @@ -594,6 +591,12 @@ </build> <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>2.0.17</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> @@ -829,7 +832,7 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> - <version>2.0.13</version> + <version>2.0.17</version> <scope>test</scope> </dependency> </dependencies> diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index a9e40d4f82..64ec919015 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -41,14 +41,10 @@ import org.ops4j.pax.exam.options.SystemPropertyOption; import org.ops4j.pax.exam.options.UrlProvisionOption; import org.ops4j.pax.exam.options.extra.VMOption; import org.ops4j.pax.exam.util.PathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { protected static final String JETTY_VERSION = "12.0.19"; - protected final Logger logger = LoggerFactory.getLogger(getClass()); - private final String workingDirectory = String.format("%s/target/paxexam/%s/%s", PathUtils.getBaseDir(), getClass().getSimpleName(), UUID.randomUUID()); /** @@ -77,8 +73,10 @@ public abstract class AbstractJettyTestSupport { keepCaches(), localMavenRepo(), CoreOptions.workingDirectory(workingDirectory()), + // update pax logging for SLF4J 2 + mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"), optionalRemoteDebug(), - mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.0.0"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("6.1.0"), testBundle("bundle.filename"), junitBundles(), awaitility(), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java index 97a0994ba9..30c3f1fa80 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java @@ -53,12 +53,8 @@ public class LightClassifierIT extends AbstractJettyTestSupport { protected Option[] additionalOptions() throws IOException { String jettyVersion = System.getProperty("jetty.version", JETTY_VERSION); return new Option[] { - spifly(), - // Minimum additional jetty dependency bundles - mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("2.0.13"), - mavenBundle().groupId("org.slf4j").artifactId("slf4j-simple").version("2.0.13"), - mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.16.1"), + mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.19.0"), mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version("1.5"), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").version(jettyVersion), @@ -94,7 +90,7 @@ public class LightClassifierIT extends AbstractJettyTestSupport { } /** - * Verify FELIX-6700 by checking that the webconsole bundle was resolved and active + * Verify FELIX-6700 by checking that the webconsole bundle was resolved and active */ @Test public void testWebConsoleBundleIsActive() throws Exception { diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java index 141b522214..d733197afb 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java @@ -65,12 +65,12 @@ public class MissingWebsocketDependenciesIT extends AbstractJettyTestSupport { Awaitility.await("waitForLogs") .atMost(Duration.ofSeconds(50)) .pollDelay(Duration.ofMillis(200)) - .until(() -> containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http]")); + .until(() -> containsString(logFile, "org.apache.felix.http.jetty12 [org.apache.felix.http]")); - assertTrue(containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http] : Failed to " + assertTrue(containsString(logFile, "org.apache.felix.http.jetty12 [org.apache.felix.http] WARN : Failed to " + "initialize jetty EE10 specific websocket support since the initializer class was not found. " + "Check if the jetty-ee10-websocket-jetty-server bundle is deployed.")); - assertTrue(containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http] : Failed to " + assertTrue(containsString(logFile, "org.apache.felix.http.jetty12 [org.apache.felix.http] WARN : Failed to " + "initialize jakarta EE10 standard websocket support since the initializer class was not found. " + "Check if the jetty-ee10-websocket-jakarta-server bundle is deployed.")); }