Skip to content

Commit 54679b6

Browse files
committed
[log4j-to-slf4j] Adapt OSGi metadata to work with slf4j 1 and 2
Use the version range [1.7,3) for the imported slf4j packages. See also https://bnd.bndtools.org/macros/range.html Fixes #1232 Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
1 parent 8373ffd commit 54679b6

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

log4j-to-slf4j/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<docLabel>SLF4J Documentation</docLabel>
3232
<projectDir>/log4j-to-slf4j</projectDir>
3333
<module.name>org.apache.logging.slf4j</module.name>
34+
<slf4j.support.bound>3</slf4j.support.bound>
3435
</properties>
3536
<dependencies>
3637
<dependency>
@@ -97,6 +98,7 @@
9798
<instructions>
9899
<Bundle-Activator>org.apache.logging.slf4j.Activator</Bundle-Activator>
99100
<Export-Package>org.apache.logging.slf4j</Export-Package>
101+
<Import-Package>org.slf4j*;version="${range;[==,${slf4j.support.bound})}",*</Import-Package>
100102
</instructions>
101103
</configuration>
102104
</plugin>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://logging.apache.org/log4j/changelog"
20+
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.0.xsd"
21+
type="fixed">
22+
<issue id="1232" link="https://github.com/apache/logging-log4j2/issues/1232"/>
23+
<author id="hanneswell"/>
24+
<author name="Hannes Wellmann"/>
25+
<description format="asciidoc">
26+
Adapt the OSGi metadata of log4j-to-slf4j to work with slf4j 1 and 2.
27+
To achieve that use a version range of `[1.7,3)` for the imported slf4j packages.
28+
</description>
29+
</entry>

0 commit comments

Comments
 (0)