Remove plexus-utils and commons-xxx references (#833)

This commit is contained in:
Guillaume Nodet
2023-04-06 10:52:45 +02:00
committed by GitHub
parent eef6c2f16f
commit 5093ced94b
6 changed files with 39 additions and 63 deletions

View File

@@ -31,7 +31,6 @@ import org.codehaus.plexus.components.interactivity.InputHandler;
import org.codehaus.plexus.components.interactivity.OutputHandler;
import org.codehaus.plexus.components.interactivity.Prompter;
import org.codehaus.plexus.components.interactivity.PrompterException;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.sisu.Priority;
import org.eclipse.sisu.Typed;
import org.mvndaemon.mvnd.common.Message;
@@ -115,7 +114,7 @@ public class DaemonPrompter extends AbstractInputHandler implements Prompter, In
} catch (IOException e) {
throw new PrompterException("Failed to prompt user", e);
}
if (StringUtils.isEmpty(line)) {
if (line == null || line.isEmpty()) {
line = defaultReply;
}
if (line != null && (possibleValues != null && !possibleValues.contains(line))) {

View File

@@ -36,7 +36,6 @@ import org.apache.maven.eventspy.EventSpy;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecution;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.sisu.Typed;
import org.mvndaemon.mvnd.common.Environment;
import org.slf4j.Logger;
@@ -196,9 +195,17 @@ public class BuildTimeEventSpy extends AbstractEventSpy {
public String name() {
String name = mojo.getKey();
String truncatedName =
name.length() >= MAX_NAME_LENGTH ? StringUtils.substring(name, 0, MAX_NAME_LENGTH) : name + " ";
return StringUtils.rightPad(truncatedName, MAX_NAME_LENGTH, ".");
if (name.length() < MAX_NAME_LENGTH) {
StringBuilder sb = new StringBuilder(MAX_NAME_LENGTH);
sb.append(name);
sb.append(' ');
while (sb.length() < MAX_NAME_LENGTH) {
sb.append('.');
}
return sb.toString();
} else {
return name.substring(0, MAX_NAME_LENGTH);
}
}
public long duration() {