Skip to content

Commit 6cac848

Browse files
committed
FELIX-6771 : Use SLF4J 2
1 parent d014d7a commit 6cac848

File tree

12 files changed

+56
-64
lines changed

12 files changed

+56
-64
lines changed

http/base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<dependency>
8888
<groupId>org.slf4j</groupId>
8989
<artifactId>slf4j-api</artifactId>
90-
<version>1.7.36</version>
90+
<version>2.0.17</version>
9191
<scope>provided</scope>
9292
</dependency>
9393
<dependency>

http/bridge/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@
142142
<dependency>
143143
<groupId>org.slf4j</groupId>
144144
<artifactId>slf4j-api</artifactId>
145-
<version>1.7.36</version>
145+
<version>2.0.17</version>
146146
<scope>provided</scope>
147147
</dependency>
148148
<dependency>
149149
<groupId>jakarta.servlet</groupId>
150150
<artifactId>jakarta.servlet-api</artifactId>
151-
<version>6.0.0</version>
151+
<version>6.1.0</version>
152152
</dependency>
153153
<dependency>
154154
<groupId>org.osgi</groupId>
@@ -186,12 +186,12 @@
186186
<dependency>
187187
<groupId>org.apache.felix</groupId>
188188
<artifactId>org.apache.felix.http.base</artifactId>
189-
<version>5.1.10</version>
189+
<version>5.1.13-SNAPSHOT</version>
190190
</dependency>
191191
<dependency>
192192
<groupId>org.apache.felix</groupId>
193193
<artifactId>org.apache.felix.http.wrappers</artifactId>
194-
<version>1.1.8</version>
194+
<version>6.1.0</version>
195195
</dependency>
196196
</dependencies>
197197
</project>

http/itest/pom.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2-
license agreements. See the NOTICE file distributed with this work for additional
3-
information regarding copyright ownership. The ASF licenses this file to
4-
you under the Apache License, Version 2.0 (the "License"); you may not use
5-
this file except in compliance with the License. You may obtain a copy of
6-
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7-
by applicable law or agreed to in writing, software distributed under the
8-
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9-
OF ANY KIND, either express or implied. See the License for the specific
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to
4+
you under the Apache License, Version 2.0 (the "License"); you may not use
5+
this file except in compliance with the License. You may obtain a copy of
6+
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7+
by applicable law or agreed to in writing, software distributed under the
8+
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9+
OF ANY KIND, either express or implied. See the License for the specific
1010
language governing permissions and limitations under the License. -->
1111
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1212
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -32,10 +32,10 @@
3232

3333
<properties>
3434
<felix.java.version>11</felix.java.version>
35-
<http.servlet.api.version>2.1.0</http.servlet.api.version>
35+
<http.servlet.api.version>6.1.0</http.servlet.api.version>
3636
<http.jetty.version>5.1.33-SNAPSHOT</http.jetty.version>
3737
<http.jetty.id>org.apache.felix.http.jetty</http.jetty.id>
38-
<pax.exam.version>4.13.1</pax.exam.version>
38+
<pax.exam.version>4.13.3</pax.exam.version>
3939
<pax.url.aether.version>2.6.14</pax.url.aether.version>
4040
</properties>
4141

@@ -44,7 +44,7 @@
4444
<id>jetty12</id>
4545
<properties>
4646
<felix.java.version>17</felix.java.version>
47-
<http.servlet.api.version>3.0.0</http.servlet.api.version>
47+
<http.servlet.api.version>6.1.0</http.servlet.api.version>
4848
<http.jetty.version>1.0.29-SNAPSHOT</http.jetty.version>
4949
<http.jetty.id>org.apache.felix.http.jetty12</http.jetty.id>
5050
</properties>
@@ -56,13 +56,13 @@
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-surefire-plugin</artifactId>
5858
<configuration>
59-
<systemPropertyVariables>
59+
<systemPropertyVariables>
6060
<http.servlet.api.version>${http.servlet.api.version}</http.servlet.api.version>
6161
<http.jetty.version>${http.jetty.version}</http.jetty.version>
6262
<http.jetty.id>${http.jetty.id}</http.jetty.id>
6363
</systemPropertyVariables>
6464
</configuration>
65-
</plugin>
65+
</plugin>
6666
</plugins>
6767
</build>
6868
<dependencies>
@@ -83,7 +83,7 @@
8383
<artifactId>httpcore-osgi</artifactId>
8484
<version>4.4.6</version>
8585
<scope>provided</scope>
86-
</dependency>
86+
</dependency>
8787
<dependency>
8888
<groupId>org.apache.httpcomponents</groupId>
8989
<artifactId>httpclient-osgi</artifactId>
@@ -94,7 +94,7 @@
9494
<groupId>org.apache.geronimo.specs</groupId>
9595
<artifactId>geronimo-json_1.1_spec</artifactId>
9696
<version>1.3</version>
97-
<scope>provided</scope>
97+
<scope>provided</scope>
9898
</dependency>
9999
<dependency>
100100
<groupId>org.apache.johnzon</groupId>

http/itest/src/test/java/org/apache/felix/http/itest/BaseIntegrationTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,8 @@ public Option[] config() {
156156

157157
// scavenge sessions every 10 seconds (10 minutes is default in 9.4.x)
158158
systemProperty("org.eclipse.jetty.servlet.SessionScavengingInterval").value("10"),
159-
mavenBundle("org.slf4j", "slf4j-api", "1.7.32"),
160-
mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.32"),
161-
mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.32"),
162-
163-
mavenBundle("org.apache.felix", "org.apache.felix.log", "1.2.6"),
164-
mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "5.3.0"),
165-
mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.1.0"),
166-
159+
// update pax logging for SLF4J 2
160+
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"), mavenBundle("org.slf4j", "slf4j-api", "2.0.17"),
167161
mavenBundle("org.apache.sling", "org.apache.sling.commons.johnzon", "1.2.16").startLevel(START_LEVEL_SYSTEM_BUNDLES),
168162

169163
mavenBundle("org.apache.felix", "org.apache.felix.configadmin").version("1.9.22").startLevel(START_LEVEL_SYSTEM_BUNDLES),
@@ -246,7 +240,7 @@ protected void configureHttpService(Dictionary<String, ?> props) throws Exceptio
246240

247241
for (final ServiceReference<ManagedService> serviceRef : serviceRefs) {
248242
ManagedService service = m_context.getService(serviceRef);
249-
try {
243+
try {
250244
service.updated(props);
251245
} catch (ConfigurationException ex) {
252246
fail("Invalid configuration provisioned: " + ex.getMessage());

http/jetty/pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
&& !"org.eclipse.jetty.websocket".equals(artifact.getGroupId()) // skip the optional websocket artifacts
7878
&& !"jetty-annotations".equals(artifact.getArtifactId()) // skip the transitive artifacts from the optional websocket artifacts
7979
&& !"jetty-plus".equals(artifact.getArtifactId())
80-
&& !"jetty-webapp".equals(artifact.getArtifactId())) {
80+
&& !"jetty-webapp".equals(artifact.getArtifactId())) {
8181
def jar;
8282
try {
8383
jar = new java.util.jar.JarFile(artifact.file)
@@ -209,7 +209,6 @@
209209
org.osgi.service.http.context;version="[1.1,1.2)",
210210
org.osgi.service.http.runtime;version="[1.1,1.2)",
211211
org.osgi.service.http.runtime.dto;version="[1.1,1.2)",
212-
org.slf4j;version="[1.0,3.0)",
213212
*
214213
</Import-Package>
215214
<DynamicImport-Package>
@@ -375,6 +374,12 @@
375374
</build>
376375

377376
<dependencies>
377+
<dependency>
378+
<groupId>org.slf4j</groupId>
379+
<artifactId>slf4j-api</artifactId>
380+
<version>2.0.17</version>
381+
<scope>provided</scope>
382+
</dependency>
378383
<dependency>
379384
<groupId>javax.servlet</groupId>
380385
<artifactId>javax.servlet-api</artifactId>
@@ -509,7 +514,7 @@
509514
<dependency>
510515
<groupId>commons-io</groupId>
511516
<artifactId>commons-io</artifactId>
512-
<version>2.14.0</version>
517+
<version>2.19.0</version>
513518
</dependency>
514519
<!-- Testing -->
515520
<dependency>
@@ -598,7 +603,7 @@
598603
<dependency>
599604
<groupId>org.slf4j</groupId>
600605
<artifactId>slf4j-simple</artifactId>
601-
<version>2.0.13</version>
606+
<version>2.0.17</version>
602607
<scope>test</scope>
603608
</dependency>
604609

http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@
4141
import org.ops4j.pax.exam.options.UrlProvisionOption;
4242
import org.ops4j.pax.exam.options.extra.VMOption;
4343
import org.ops4j.pax.exam.util.PathUtils;
44-
import org.slf4j.Logger;
45-
import org.slf4j.LoggerFactory;
4644

4745
public abstract class AbstractJettyTestSupport {
4846
protected static final String JETTY_VERSION = "11.0.25";
4947

50-
protected final Logger logger = LoggerFactory.getLogger(getClass());
51-
5248
private final String workingDirectory = String.format("%s/target/paxexam/%s/%s", PathUtils.getBaseDir(), getClass().getSimpleName(), UUID.randomUUID());
5349

5450
/**
@@ -77,8 +73,10 @@ public Option[] configuration() throws IOException {
7773
keepCaches(),
7874
localMavenRepo(),
7975
CoreOptions.workingDirectory(workingDirectory()),
76+
// update pax logging for SLF4J 2
77+
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"),
8078
optionalRemoteDebug(),
81-
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.0.0"),
79+
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("6.1.0"),
8280
testBundle("bundle.filename"),
8381
junitBundles(),
8482
awaitility(),

http/jetty/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ protected Option[] additionalOptions() throws IOException {
5656
spifly(),
5757

5858
// Minimum additional jetty dependency bundles
59-
mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("2.0.13"),
60-
mavenBundle().groupId("org.slf4j").artifactId("slf4j-simple").version("2.0.13"),
61-
mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.16.1"),
59+
mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.19.0"),
6260
mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version("1.5"),
6361
mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-server").version(jettyVersion),
6462
mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").version(jettyVersion),

http/jetty/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ public void testMissingDepencencyWarningLogs() throws Exception {
6565
Awaitility.await("waitForLogs")
6666
.atMost(Duration.ofSeconds(50))
6767
.pollDelay(Duration.ofMillis(200))
68-
.until(() -> containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http]"));
68+
.until(() -> containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http]"));
6969

70-
assertTrue(containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http] : Failed to initialize jetty specific websocket "
70+
assertTrue(containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http] WARN : Failed to initialize jetty specific websocket "
7171
+ "support since the initializer class was not found. Check if the websocket-jetty-server bundle is deployed."));
72-
assertTrue(containsString(logFile, "org.apache.felix.http.jetty[org.apache.felix.http] : Failed to initialize jakarta standard websocket"
72+
assertTrue(containsString(logFile, "org.apache.felix.http.jetty [org.apache.felix.http] WARN : Failed to initialize jakarta standard websocket"
7373
+ " support since the initializer class was not found. Check if the websocket-jakarta-server bundle is deployed."));
7474
}
7575

7676
/**
7777
* Checks if the text is present in the file
78-
*
78+
*
7979
* @param file the file to check
8080
* @param expected the text to look for
8181
* @return true if the text was found, false otherwise

http/jetty12/pom.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@
213213
org.osgi.service.http.context;version="[1.1,1.2)",
214214
org.osgi.service.http.runtime;version="[1.1,1.2)",
215215
org.osgi.service.http.runtime.dto;version="[1.1,1.2)",
216-
org.slf4j;version="[1.0,3.0)",
217216
*
218217
</Import-Package>
219218
<DynamicImport-Package>
@@ -405,7 +404,6 @@
405404
org.osgi.service.http.context;version="[1.1,1.2)",
406405
org.osgi.service.http.runtime;version="[1.1,1.2)",
407406
org.osgi.service.http.runtime.dto;version="[1.1,1.2)",
408-
org.slf4j;version="[1.0,3.0)",
409407
*
410408
</Import-Package>
411409
<DynamicImport-Package>
@@ -513,7 +511,6 @@
513511
org.osgi.service.http.context;version="[1.1,1.2)",
514512
org.osgi.service.http.runtime;version="[1.1,1.2)",
515513
org.osgi.service.http.runtime.dto;version="[1.1,1.2)",
516-
org.slf4j;version="[1.0,3.0)",
517514
*
518515
</Import-Package>
519516
<DynamicImport-Package>
@@ -594,6 +591,12 @@
594591
</build>
595592

596593
<dependencies>
594+
<dependency>
595+
<groupId>org.slf4j</groupId>
596+
<artifactId>slf4j-api</artifactId>
597+
<version>2.0.17</version>
598+
<scope>provided</scope>
599+
</dependency>
597600
<dependency>
598601
<groupId>javax.servlet</groupId>
599602
<artifactId>javax.servlet-api</artifactId>
@@ -829,7 +832,7 @@
829832
<dependency>
830833
<groupId>org.slf4j</groupId>
831834
<artifactId>slf4j-simple</artifactId>
832-
<version>2.0.13</version>
835+
<version>2.0.17</version>
833836
<scope>test</scope>
834837
</dependency>
835838
</dependencies>

http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@
4141
import org.ops4j.pax.exam.options.UrlProvisionOption;
4242
import org.ops4j.pax.exam.options.extra.VMOption;
4343
import org.ops4j.pax.exam.util.PathUtils;
44-
import org.slf4j.Logger;
45-
import org.slf4j.LoggerFactory;
4644

4745
public abstract class AbstractJettyTestSupport {
4846
protected static final String JETTY_VERSION = "12.0.19";
4947

50-
protected final Logger logger = LoggerFactory.getLogger(getClass());
51-
5248
private final String workingDirectory = String.format("%s/target/paxexam/%s/%s", PathUtils.getBaseDir(), getClass().getSimpleName(), UUID.randomUUID());
5349

5450
/**
@@ -77,8 +73,10 @@ public Option[] configuration() throws IOException {
7773
keepCaches(),
7874
localMavenRepo(),
7975
CoreOptions.workingDirectory(workingDirectory()),
76+
// update pax logging for SLF4J 2
77+
mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"),
8078
optionalRemoteDebug(),
81-
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.0.0"),
79+
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("6.1.0"),
8280
testBundle("bundle.filename"),
8381
junitBundles(),
8482
awaitility(),

0 commit comments

Comments
 (0)