This is an automated email from the ASF dual-hosted git repository. cstamas pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/master by this push: new 5f1bb6f6 [MRESOLVER-389] Drop logging facade (#338) 5f1bb6f6 is described below commit 5f1bb6f6b4b74b9f54eac74d5e6814e704fa31f8 Author: Tamas Cservenak <ta...@cservenak.net> AuthorDate: Sat Oct 14 15:47:58 2023 +0200 [MRESOLVER-389] Drop logging facade (#338) As Resolver has settled on slf4j since long time. --- https://issues.apache.org/jira/browse/MRESOLVER-389 --- .../eclipse/aether/impl/DefaultServiceLocator.java | 3 - .../eclipse/aether/impl/guice/AetherModule.java | 20 --- .../internal/impl/DefaultArtifactResolver.java | 9 -- .../internal/impl/DefaultRepositorySystem.java | 9 -- .../internal/impl/LoggerFactoryProvider.java | 42 ------ .../internal/impl/slf4j/Slf4jLoggerFactory.java | 165 --------------------- .../java/org/eclipse/aether/spi/log/Logger.java | 74 --------- .../org/eclipse/aether/spi/log/LoggerFactory.java | 36 ----- .../org/eclipse/aether/spi/log/NullLogger.java | 44 ------ .../eclipse/aether/spi/log/NullLoggerFactory.java | 65 -------- .../org/eclipse/aether/spi/log/package-info.java | 27 ---- .../internal/test/util/TestLoggerFactory.java | 92 ------------ pom.xml | 10 ++ 13 files changed, 10 insertions(+), 586 deletions(-) diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java index 4f96f227..145c1f6a 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java @@ -56,7 +56,6 @@ import org.eclipse.aether.internal.impl.TrackingFileManager; import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector; import org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.filter.DefaultRemoteRepositoryFilterManager; -import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.internal.impl.synccontext.DefaultSyncContextFactory; import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactory; import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl; @@ -69,7 +68,6 @@ import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; import org.eclipse.aether.spi.locator.Service; import org.eclipse.aether.spi.locator.ServiceLocator; -import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.synccontext.SyncContextFactory; import static java.util.Objects.requireNonNull; @@ -204,7 +202,6 @@ public final class DefaultServiceLocator implements ServiceLocator { addService(LocalRepositoryProvider.class, DefaultLocalRepositoryProvider.class); addService(LocalRepositoryManagerFactory.class, SimpleLocalRepositoryManagerFactory.class); addService(LocalRepositoryManagerFactory.class, EnhancedLocalRepositoryManagerFactory.class); - addService(LoggerFactory.class, Slf4jLoggerFactory.class); addService(TrackingFileManager.class, DefaultTrackingFileManager.class); addService(ChecksumAlgorithmFactorySelector.class, DefaultChecksumAlgorithmFactorySelector.class); addService(LocalPathComposer.class, DefaultLocalPathComposer.class); diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java index aad52e53..1e8233ca 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java @@ -88,7 +88,6 @@ import org.eclipse.aether.internal.impl.filter.DefaultRemoteRepositoryFilterMana import org.eclipse.aether.internal.impl.filter.GroupIdRemoteRepositoryFilterSource; import org.eclipse.aether.internal.impl.filter.PrefixesRemoteRepositoryFilterSource; import org.eclipse.aether.internal.impl.resolution.TrustedChecksumsArtifactResolverPostProcessor; -import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.internal.impl.synccontext.DefaultSyncContextFactory; import org.eclipse.aether.internal.impl.synccontext.named.NameMapper; import org.eclipse.aether.internal.impl.synccontext.named.NameMappers; @@ -115,10 +114,8 @@ import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; import org.eclipse.aether.spi.connector.transport.TransporterProvider; import org.eclipse.aether.spi.io.FileProcessor; import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; -import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor; import org.eclipse.aether.spi.synccontext.SyncContextFactory; -import org.slf4j.ILoggerFactory; /** * A ready-made <a href="https://github.com/google/guice" target="_blank">Guice</a> module that sets up bindings @@ -323,8 +320,6 @@ public class AetherModule extends AbstractModule { .annotatedWith(Names.named(PrefixesRemoteRepositoryFilterSource.NAME)) .to(PrefixesRemoteRepositoryFilterSource.class) .in(Singleton.class); - - install(new Slf4jModule()); } @Provides @@ -447,19 +442,4 @@ public class AetherModule extends AbstractModule { Set<RepositoryListener> providesRepositoryListeners() { return Collections.emptySet(); } - - private static class Slf4jModule extends AbstractModule { - - @Override - protected void configure() { - bind(LoggerFactory.class) // - .to(Slf4jLoggerFactory.class); - } - - @Provides - @Singleton - ILoggerFactory getLoggerFactory() { - return org.slf4j.LoggerFactory.getILoggerFactory(); - } - } } diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java index 164d4255..1755837a 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java @@ -168,15 +168,6 @@ public class DefaultArtifactResolver implements ArtifactResolver, Service { setRemoteRepositoryFilterManager(locator.getService(RemoteRepositoryFilterManager.class)); } - /** - * @deprecated not used any more since MRESOLVER-36 move to slf4j, added back in MRESOLVER-64 for compatibility - */ - @Deprecated - public DefaultArtifactResolver setLoggerFactory(org.eclipse.aether.spi.log.LoggerFactory loggerFactory) { - // this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); - return this; - } - public DefaultArtifactResolver setFileProcessor(FileProcessor fileProcessor) { this.fileProcessor = requireNonNull(fileProcessor, "file processor cannot be null"); return this; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java index 5ca614f5..7b472b1b 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java @@ -177,15 +177,6 @@ public class DefaultRepositorySystem implements RepositorySystem, Service { setRepositorySystemLifecycle(locator.getService(RepositorySystemLifecycle.class)); } - /** - * @deprecated not used any more since MRESOLVER-36 move to slf4j, added back in MRESOLVER-64 for compatibility - */ - @Deprecated - public DefaultRepositorySystem setLoggerFactory(org.eclipse.aether.spi.log.LoggerFactory loggerFactory) { - // this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); - return this; - } - public DefaultRepositorySystem setVersionResolver(VersionResolver versionResolver) { this.versionResolver = requireNonNull(versionResolver, "version resolver cannot be null"); return this; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/LoggerFactoryProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/LoggerFactoryProvider.java deleted file mode 100644 index 10dcb459..00000000 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/LoggerFactoryProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.eclipse.aether.internal.impl; - -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Provider; -import javax.inject.Singleton; - -import org.eclipse.aether.spi.log.LoggerFactory; - -/** - * Helps Sisu-based applications to pick the right logger factory depending on the classpath. - */ -@Named -@Singleton -public class LoggerFactoryProvider implements Provider<LoggerFactory> { - - @Inject - @Named("slf4j") - private Provider<LoggerFactory> slf4j; - - public LoggerFactory get() { - return slf4j.get(); - } -} diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java deleted file mode 100644 index fa148fd7..00000000 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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.eclipse.aether.internal.impl.slf4j; - -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; - -import org.eclipse.aether.spi.locator.Service; -import org.eclipse.aether.spi.locator.ServiceLocator; -import org.eclipse.aether.spi.log.Logger; -import org.eclipse.aether.spi.log.LoggerFactory; -import org.eclipse.sisu.Nullable; -import org.slf4j.ILoggerFactory; -import org.slf4j.spi.LocationAwareLogger; - -/** - * A logger factory that delegates to <a href="http://www.slf4j.org/" target="_blank">SLF4J</a> logging. - * - * @deprecated Use SLF4J instead - */ -@Singleton -@Named("slf4j") -@Deprecated -public class Slf4jLoggerFactory implements LoggerFactory, Service { - - private static final boolean AVAILABLE; - - static { - boolean available; - try { - Slf4jLoggerFactory.class.getClassLoader().loadClass("org.slf4j.ILoggerFactory"); - available = true; - } catch (Exception | LinkageError e) { - available = false; - } - AVAILABLE = available; - } - - public static boolean isSlf4jAvailable() { - return AVAILABLE; - } - - private ILoggerFactory factory; - - /** - * Creates an instance of this logger factory. - */ - public Slf4jLoggerFactory() { - // enables no-arg constructor - } - - @Inject - Slf4jLoggerFactory(@Nullable ILoggerFactory factory) { - setLoggerFactory(factory); - } - - public void initService(ServiceLocator locator) { - setLoggerFactory(locator.getService(ILoggerFactory.class)); - } - - public Slf4jLoggerFactory setLoggerFactory(ILoggerFactory factory) { - this.factory = factory; - return this; - } - - public Logger getLogger(String name) { - org.slf4j.Logger logger = getFactory().getLogger(name); - if (logger instanceof LocationAwareLogger) { - return new Slf4jLoggerEx((LocationAwareLogger) logger); - } - return new Slf4jLogger(logger); - } - - private ILoggerFactory getFactory() { - if (factory == null) { - factory = org.slf4j.LoggerFactory.getILoggerFactory(); - } - return factory; - } - - private static final class Slf4jLogger implements Logger { - - private final org.slf4j.Logger logger; - - Slf4jLogger(org.slf4j.Logger logger) { - this.logger = logger; - } - - public boolean isDebugEnabled() { - return logger.isDebugEnabled(); - } - - public void debug(String msg) { - logger.debug(msg); - } - - public void debug(String msg, Throwable error) { - logger.debug(msg, error); - } - - public boolean isWarnEnabled() { - return logger.isWarnEnabled(); - } - - public void warn(String msg) { - logger.warn(msg); - } - - public void warn(String msg, Throwable error) { - logger.warn(msg, error); - } - } - - private static final class Slf4jLoggerEx implements Logger { - - private static final String FQCN = Slf4jLoggerEx.class.getName(); - - private final LocationAwareLogger logger; - - Slf4jLoggerEx(LocationAwareLogger logger) { - this.logger = logger; - } - - public boolean isDebugEnabled() { - return logger.isDebugEnabled(); - } - - public void debug(String msg) { - logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, msg, null, null); - } - - public void debug(String msg, Throwable error) { - logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, msg, null, error); - } - - public boolean isWarnEnabled() { - return logger.isWarnEnabled(); - } - - public void warn(String msg) { - logger.log(null, FQCN, LocationAwareLogger.WARN_INT, msg, null, null); - } - - public void warn(String msg, Throwable error) { - logger.log(null, FQCN, LocationAwareLogger.WARN_INT, msg, null, error); - } - } -} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java deleted file mode 100644 index 270e715d..00000000 --- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.eclipse.aether.spi.log; - -/** - * A simple logger to facilitate emission of diagnostic messages. In general, unrecoverable errors should be reported - * via exceptions and informational notifications should be reported via events, hence this logger interface focuses on - * support for tracing. - * - * @deprecated Use SLF4J instead - */ -@Deprecated -public interface Logger { - - /** - * Indicates whether debug logging is enabled. - * - * @return {@code true} if debug logging is enabled, {@code false} otherwise. - */ - boolean isDebugEnabled(); - - /** - * Emits the specified message. - * - * @param msg The message to log, must not be {@code null}. - */ - void debug(String msg); - - /** - * Emits the specified message along with a stack trace of the given exception. - * - * @param msg The message to log, must not be {@code null}. - * @param error The exception to log, may be {@code null}. - */ - void debug(String msg, Throwable error); - - /** - * Indicates whether warn logging is enabled. - * - * @return {@code true} if warn logging is enabled, {@code false} otherwise. - */ - boolean isWarnEnabled(); - - /** - * Emits the specified message. - * - * @param msg The message to log, must not be {@code null}. - */ - void warn(String msg); - - /** - * Emits the specified message along with a stack trace of the given exception. - * - * @param msg The message to log, must not be {@code null}. - * @param error The exception to log, may be {@code null}. - */ - void warn(String msg, Throwable error); -} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java deleted file mode 100644 index d5beb56a..00000000 --- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.eclipse.aether.spi.log; - -/** - * A factory to create loggers. - * - * @deprecated Use SLF4J instead - */ -@Deprecated -public interface LoggerFactory { - - /** - * Gets a logger for a class with the specified name. - * - * @param name The name of the class requesting a logger, must not be {@code null}. - * @return The requested logger, never {@code null}. - */ - Logger getLogger(String name); -} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java deleted file mode 100644 index f3029a3b..00000000 --- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.eclipse.aether.spi.log; - -/** - * A logger that disables any logging. - * - * @deprecated Use SLF4J instead - */ -@Deprecated -final class NullLogger implements Logger { - - public boolean isDebugEnabled() { - return false; - } - - public void debug(String msg) {} - - public void debug(String msg, Throwable error) {} - - public boolean isWarnEnabled() { - return false; - } - - public void warn(String msg) {} - - public void warn(String msg, Throwable error) {} -} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java deleted file mode 100644 index 6e896fc4..00000000 --- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.eclipse.aether.spi.log; - -/** - * A logger factory that disables any logging. - * - * @deprecated Use SLF4J instead - */ -@Deprecated -public final class NullLoggerFactory implements LoggerFactory { - - /** - * The singleton instance of this factory. - */ - public static final LoggerFactory INSTANCE = new NullLoggerFactory(); - - /** - * The singleton logger used by this factory. - */ - public static final Logger LOGGER = new NullLogger(); - - public Logger getLogger(String name) { - return LOGGER; - } - - private NullLoggerFactory() { - // hide constructor - } - - /** - * Gets a logger from the specified factory for the given class, falling back to a logger from this factory if the - * specified factory is {@code null} or fails to provide a logger. - * - * @param loggerFactory The logger factory from which to get the logger, may be {@code null}. - * @param type The class for which to get the logger, must not be {@code null}. - * @return The requested logger, never {@code null}. - */ - public static Logger getSafeLogger(LoggerFactory loggerFactory, Class<?> type) { - if (loggerFactory == null) { - return LOGGER; - } - Logger logger = loggerFactory.getLogger(type.getName()); - if (logger == null) { - return LOGGER; - } - return logger; - } -} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java deleted file mode 100644 index 84ed6c62..00000000 --- a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java +++ /dev/null @@ -1,27 +0,0 @@ -// CHECKSTYLE_OFF: RegexpHeader -/* - * 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. - */ -/** - * A simple logging infrastructure for diagnostic messages. The primary purpose of the - * {@link org.eclipse.aether.spi.log.LoggerFactory} defined here is to avoid a mandatory dependency on a 3rd party - * logging system/facade. Some applications might find the events fired by the repository system sufficient and prefer - * a small footprint. Components that do not share this concern are free to ignore this package and directly employ - * whatever logging system they desire. - */ -package org.eclipse.aether.spi.log; diff --git a/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java deleted file mode 100644 index d72e7baa..00000000 --- a/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.eclipse.aether.internal.test.util; - -import java.io.PrintStream; - -import org.eclipse.aether.spi.log.Logger; -import org.eclipse.aether.spi.log.LoggerFactory; - -/** - * A logger factory that writes to some {@link PrintStream}. - * - * @deprecated Use SLF4J instead - */ -@Deprecated -public final class TestLoggerFactory implements LoggerFactory { - - private final Logger logger; - - /** - * Creates a new logger factory that writes to {@link System#out}. - */ - public TestLoggerFactory() { - this(null); - } - - /** - * Creates a new logger factory that writes to the specified print stream. - */ - public TestLoggerFactory(PrintStream out) { - logger = new TestLogger(out); - } - - public Logger getLogger(String name) { - return logger; - } - - private static final class TestLogger implements Logger { - - private final PrintStream out; - - TestLogger(PrintStream out) { - this.out = (out != null) ? out : System.out; - } - - public boolean isWarnEnabled() { - return true; - } - - public void warn(String msg, Throwable error) { - out.println("[WARN] " + msg); - if (error != null) { - error.printStackTrace(out); - } - } - - public void warn(String msg) { - warn(msg, null); - } - - public boolean isDebugEnabled() { - return true; - } - - public void debug(String msg, Throwable error) { - out.println("[DEBUG] " + msg); - if (error != null) { - error.printStackTrace(out); - } - } - - public void debug(String msg) { - debug(msg, null); - } - } -} diff --git a/pom.xml b/pom.xml index dc18e3ce..87dbb3fa 100644 --- a/pom.xml +++ b/pom.xml @@ -296,6 +296,11 @@ <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#getFileTransformer()</exclude> <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#setFileTransformer(org.eclipse.aether.transform.FileTransformer)</exclude> <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#ArtifactUpload(org.eclipse.aether.artifact.Artifact,java.io.File,org.eclipse.aether.transform.FileTransformer)</exclude> + <!-- MRESOLVER-389 Dropping log facade (use SLF4J instead) --> + <exclude>org.eclipse.aether.spi.log.Logger</exclude> + <exclude>org.eclipse.aether.spi.log.LoggerFactory</exclude> + <exclude>org.eclipse.aether.spi.log.NullLogger</exclude> + <exclude>org.eclipse.aether.spi.log.NullLoggerFactory</exclude> </excludes> <ignoreMissingClasses>true</ignoreMissingClasses> <breakBuildOnBinaryIncompatibleModifications>false</breakBuildOnBinaryIncompatibleModifications> @@ -323,6 +328,11 @@ <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#getFileTransformer()</exclude> <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#setFileTransformer(org.eclipse.aether.transform.FileTransformer)</exclude> <exclude>org.eclipse.aether.spi.connector.ArtifactUpload#ArtifactUpload(org.eclipse.aether.artifact.Artifact,java.io.File,org.eclipse.aether.transform.FileTransformer)</exclude> + <!-- MRESOLVER-389 Dropping log facade (use SLF4J instead) --> + <exclude>org.eclipse.aether.spi.log.Logger</exclude> + <exclude>org.eclipse.aether.spi.log.LoggerFactory</exclude> + <exclude>org.eclipse.aether.spi.log.NullLogger</exclude> + <exclude>org.eclipse.aether.spi.log.NullLoggerFactory</exclude> </excludes> <ignoreMissingClasses>true</ignoreMissingClasses> <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>