Skip to content

Commit 4de1dd1

Browse files
committed
Upgrade to slf4j 2.0.17
Signed-off-by: Olivier Lamy <olamy@apache.org>
1 parent e7e1216 commit 4de1dd1

11 files changed

Lines changed: 97 additions & 94 deletions

File tree

apache-maven/src/main/appended-resources/licenses/MIT-slf4j-api-1.7.36.txt renamed to apache-maven/src/main/appended-resources/licenses/unrecognized-slf4j-api-2.0.17.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1919
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2020
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2121
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
23-
24-

maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Slf4jSimpleConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.apache.maven.cli.logging.BaseSlf4jConfiguration;
2222
import org.slf4j.MavenSlf4jFriend;
23-
import org.slf4j.impl.MavenSlf4jSimpleFriend;
23+
import org.slf4j.simple.MavenSlf4jSimpleFriend;
2424

2525
/**
2626
* Configuration for slf4j-simple.

maven-embedder/src/main/java/org/slf4j/impl/MavenSlf4jSimpleFriend.java renamed to maven-embedder/src/main/java/org/slf4j/simple/MavenSlf4jSimpleFriend.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.slf4j.impl;
19+
package org.slf4j.simple;
2020

2121
import org.slf4j.ILoggerFactory;
2222
import org.slf4j.LoggerFactory;

maven-slf4j-provider/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ under the License.
6666
<version>${slf4jVersion}</version>
6767
<type>jar</type>
6868
<classifier>sources</classifier>
69-
<overWrite>false</overWrite>
69+
<overWrite>true</overWrite>
7070
<outputDirectory>${project.build.directory}/generated-sources/slf4j-simple</outputDirectory>
71-
<includes>org/slf4j/impl/*.java</includes>
72-
<excludes>org/slf4j/impl/StaticLoggerBinder*</excludes>
71+
<includes>org/slf4j/simple/*.java</includes>
72+
<excludes>org/slf4j/simple/SimpleServiceProvider*</excludes>
7373
</artifactItem>
7474
</artifactItems>
7575
</configuration>

maven-slf4j-provider/src/main/java/org/slf4j/impl/StaticLoggerBinder.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLogger.java renamed to maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.slf4j.impl;
19+
package org.slf4j.simple;
2020

2121
import java.io.PrintStream;
2222

maven-slf4j-provider/src/main/java/org/slf4j/impl/MavenSimpleLoggerFactory.java renamed to maven-slf4j-provider/src/main/java/org/slf4j/simple/MavenSimpleLoggerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.slf4j.impl;
19+
package org.slf4j.simple;
2020

2121
import org.slf4j.Logger;
2222

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with 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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.slf4j.simple;
20+
21+
import org.slf4j.ILoggerFactory;
22+
import org.slf4j.IMarkerFactory;
23+
import org.slf4j.helpers.BasicMarkerFactory;
24+
import org.slf4j.helpers.NOPMDCAdapter;
25+
import org.slf4j.spi.MDCAdapter;
26+
import org.slf4j.spi.SLF4JServiceProvider;
27+
28+
/**
29+
* SLF4J service provider for Maven, using {@link MavenSimpleLoggerFactory}
30+
* to provide colorized log output.
31+
*
32+
* @since 3.10.0
33+
*/
34+
public class MavenSimpleServiceProvider implements SLF4JServiceProvider {
35+
36+
/**
37+
* Declare the version of the SLF4J API this implementation is compiled against.
38+
*/
39+
// to avoid constant folding by the compiler, this field must *not* be final
40+
@SuppressWarnings({"checkstyle:staticvariablename", "checkstyle:visibilitymodifier"})
41+
public static String REQUESTED_API_VERSION = "2.0.99"; // !final
42+
43+
private ILoggerFactory loggerFactory;
44+
private final IMarkerFactory markerFactory = new BasicMarkerFactory();
45+
private final MDCAdapter mdcAdapter = new NOPMDCAdapter();
46+
47+
@Override
48+
public ILoggerFactory getLoggerFactory() {
49+
return loggerFactory;
50+
}
51+
52+
@Override
53+
public IMarkerFactory getMarkerFactory() {
54+
return markerFactory;
55+
}
56+
57+
@Override
58+
public MDCAdapter getMDCAdapter() {
59+
return mdcAdapter;
60+
}
61+
62+
@Override
63+
public String getRequestedApiVersion() {
64+
return REQUESTED_API_VERSION;
65+
}
66+
67+
@Override
68+
public void initialize() {
69+
loggerFactory = new MavenSimpleLoggerFactory();
70+
}
71+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
org.slf4j.simple.MavenSimpleServiceProvider

maven-slf4j-provider/src/test/java/org/slf4j/impl/MavenSimpleLoggerTest.java renamed to maven-slf4j-provider/src/test/java/org/slf4j/simple/MavenSimpleLoggerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.slf4j.impl;
19+
package org.slf4j.simple;
2020

2121
import java.io.ByteArrayOutputStream;
2222
import java.io.PrintStream;

0 commit comments

Comments
 (0)