cstamas commented on code in PR #2254: URL: https://github.com/apache/maven/pull/2254#discussion_r2039833241
########## impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/cisupport/GenericCIDetector.java: ########## @@ -0,0 +1,50 @@ +/* + * 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.cling.invoker.cisupport; + +import java.util.Optional; + +import org.apache.maven.api.cli.cisupport.CISupport; + +/** + * Generic CI support. This offers same support as Maven 3 always had. Is also special, as code will reject this + * detector result IF there are also any other returned via discovered services. + */ +public class GenericCIDetector implements CIDetector { + public static final String NAME = "generic"; + + @Override + public Optional<CISupport> detectCI() { + String ciEnv = System.getenv("CI"); + if (ciEnv != null && !"false".equals(ciEnv)) { + return Optional.of(new CISupport() { + @Override + public String name() { + return NAME; + } + + @Override + public String message() { + return "Environment variable CI equals \"true\". Disable detection by removing that variable or by setting it to any other value"; Review Comment: Ok, the original comes from https://github.com/apache/maven/commit/ac0bc5541e3d1a19b22c4138c354237c8202e11f So def not Maven 3. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org