rmannibucau commented on code in PR #1041:
URL: https://github.com/apache/maven/pull/1041#discussion_r1129447663


##########
maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/NoopConfiguration.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.apache.maven.cli.logging.impl;
+
+import org.apache.maven.cli.logging.BaseSlf4jConfiguration;
+
+/**
+ * Configuration available for users setting a custom binding and not using 
--fail-on-severity to avoid warnings.
+ * This is basically a no-op implementation not issuing any warning.
+ * To use it add to maven classpath (m2.conf) a folder/jar with a 
META-INF/maven/slf4j-configuration.properties
+ * containing {@code loggerClass = 
org.apache.maven.cli.logging.impl.NoopConfiguration}.
+ */
+public class NoopConfiguration extends BaseSlf4jConfiguration {

Review Comment:
   Fully agree but not how maven integrated the fail on severity flag, just 
trying to not drop the flag - shouldn't have been introduced since it is 100% a 
log framework feature for me - and get it running properly without warnings 
which actually just mention the exact case you setup (not supported by maven 
slf4j binding).
   
   There are actually two cases assuming we keep this kind of integration:
   
   * maven supports the binding but the loading fails (missing dep - missing 
logback-classic when adding logback-core for ex or the opposite) -> we should 
issue a warning
   * maven does not know the binding -> guess we can discuss info (user 
intended to use a custom binding) or warning (user didnt intend to use the 
binding added to mvn classpath due to an extension transitive dep) but having 
this noop impl enables maven to issue a warning and the user to drop it when he 
knows it is not relevant



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to