Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ If you want to bootstrap Maven, you'll need:
- Maven 3.9.0 or later
- Run Maven, specifying a location into which the completed Maven distro should be installed:
```
mvn -DdistributionTargetDir="$HOME/app/maven/apache-maven-3.9.x-SNAPSHOT" clean package
mvn -DdistributionTargetDir="$HOME/app/maven/apache-maven-3.10.x-SNAPSHOT" clean package
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.maven.cli.logging.BaseSlf4jConfiguration;
import org.slf4j.MavenSlf4jFriend;
import org.slf4j.impl.MavenSlf4jSimpleFriend;
import org.slf4j.simple.MavenSlf4jSimpleFriend;

/**
* Configuration for slf4j-simple.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.slf4j.impl;
package org.slf4j.simple;

import org.slf4j.ILoggerFactory;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
# value = corresponding o.a.m.cli.logging.Slf4jConfiguration class
org.slf4j.impl.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
Comment thread
olamy marked this conversation as resolved.
org.slf4j.impl.MavenSimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
org.slf4j.simple.SimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
org.slf4j.simple.MavenSimpleLoggerFactory org.apache.maven.cli.logging.impl.Slf4jSimpleConfiguration
org.apache.logging.slf4j.Log4jLoggerFactory org.apache.maven.cli.logging.impl.Log4j2Configuration
ch.qos.logback.classic.LoggerContext org.apache.maven.cli.logging.impl.LogbackConfiguration
10 changes: 7 additions & 3 deletions maven-slf4j-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ under the License.
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -63,13 +68,12 @@ under the License.
<artifactItem>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<type>jar</type>
<classifier>sources</classifier>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/generated-sources/slf4j-simple</outputDirectory>
<includes>org/slf4j/impl/*.java</includes>
<excludes>org/slf4j/impl/StaticLoggerBinder*</excludes>
<includes>org/slf4j/simple/*.java</includes>
<excludes>org/slf4j/simple/SimpleServiceProvider*</excludes>
Comment thread
olamy marked this conversation as resolved.
</artifactItem>
</artifactItems>
</configuration>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.slf4j.impl;
package org.slf4j.simple;

import java.io.PrintStream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.slf4j.impl;
package org.slf4j.simple;

import org.slf4j.Logger;

Expand All @@ -37,4 +37,9 @@ public Logger getLogger(String name) {
return oldInstance == null ? newInstance : oldInstance;
}
}

@Override
protected Logger createLogger(String name) {
return new MavenSimpleLogger(name);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* 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.
*/
package org.slf4j.simple;

import org.slf4j.ILoggerFactory;
import org.slf4j.IMarkerFactory;
import org.slf4j.helpers.BasicMarkerFactory;
import org.slf4j.helpers.NOPMDCAdapter;
import org.slf4j.spi.MDCAdapter;
import org.slf4j.spi.SLF4JServiceProvider;

/**
* SLF4J service provider for Maven, using {@link MavenSimpleLoggerFactory}
* to provide colorized log output.
*
* @since 3.10.0
*/
public class MavenSimpleServiceProvider implements SLF4JServiceProvider {

/**
* Declare the version of the SLF4J API this implementation is compiled against.
*/
// to avoid constant folding by the compiler, this field must *not* be final
@SuppressWarnings({"checkstyle:staticvariablename", "checkstyle:visibilitymodifier"})
public static String REQUESTED_API_VERSION = "2.0"; // !final

private ILoggerFactory loggerFactory;
private final IMarkerFactory markerFactory = new BasicMarkerFactory();
private final MDCAdapter mdcAdapter = new NOPMDCAdapter();

@Override
public ILoggerFactory getLoggerFactory() {
return loggerFactory;
}

@Override
public IMarkerFactory getMarkerFactory() {
return markerFactory;
}

@Override
public MDCAdapter getMDCAdapter() {
return mdcAdapter;
}

@Override
public String getRequestedApiVersion() {
return REQUESTED_API_VERSION;
}

@Override
public void initialize() {
Comment thread
olamy marked this conversation as resolved.
loggerFactory = new MavenSimpleLoggerFactory();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.
org.slf4j.simple.MavenSimpleServiceProvider
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.slf4j.impl;
package org.slf4j.simple;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ under the License.
<cipherVersion>2.0</cipherVersion>
<jxpathVersion>1.4.0</jxpathVersion>
<resolverVersion>2.0.16</resolverVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<slf4jVersion>2.0.17</slf4jVersion>
<xmlunitVersion>2.11.0</xmlunitVersion>
<powermockVersion>2.0.9</powermockVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
Expand Down Expand Up @@ -374,7 +374,6 @@ under the License.
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down