mirror of https://github.com/apache/maven.git
[MNG-8261] Remove jline-terminal-ffm direct dependency (#1719)
This commit is contained in:
parent
2d224623a3
commit
d77462e78a
|
@ -99,7 +99,15 @@ under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<artifactId>jline-reader</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-jni</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-ffm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DI Runtime -->
|
||||
|
|
|
@ -123,7 +123,7 @@ under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<artifactId>jansi-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -40,7 +40,20 @@ under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<artifactId>jline-reader</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-jni</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-ffm</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jansi-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.inject</groupId>
|
||||
|
@ -62,4 +75,13 @@ under the License.
|
|||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.sisu</groupId>
|
||||
<artifactId>sisu-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -74,7 +74,7 @@ public class JLineMessageBuilderFactory implements MessageBuilderFactory, Prompt
|
|||
|
||||
@Override
|
||||
public String readLine() throws IOException {
|
||||
return doPrompt(null, true);
|
||||
return doPrompt(null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -193,7 +193,21 @@ public class JLineMessageBuilderFactory implements MessageBuilderFactory, Prompt
|
|||
|
||||
private String doPrompt(String message, boolean password) throws IOException {
|
||||
try {
|
||||
return MessageUtils.reader.readLine(message != null ? message + ": " : null, password ? '*' : null);
|
||||
if (message != null) {
|
||||
if (!message.endsWith("\n")) {
|
||||
if (message.endsWith(":")) {
|
||||
message += " ";
|
||||
} else if (!message.endsWith(": ")) {
|
||||
message += ": ";
|
||||
}
|
||||
}
|
||||
int lastNl = message.lastIndexOf('\n');
|
||||
String begin = message.substring(0, lastNl + 1);
|
||||
message = message.substring(lastNl + 1);
|
||||
MessageUtils.terminal.writer().print(begin);
|
||||
MessageUtils.terminal.flush();
|
||||
}
|
||||
return MessageUtils.reader.readLine(message, password ? '*' : null);
|
||||
} catch (Exception e) {
|
||||
throw new IOException("Unable to prompt user", e);
|
||||
}
|
||||
|
|
19
pom.xml
19
pom.xml
|
@ -461,7 +461,22 @@ under the License.
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline</artifactId>
|
||||
<artifactId>jline-reader</artifactId>
|
||||
<version>${jlineVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-ffm</artifactId>
|
||||
<version>${jlineVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jline-terminal-jni</artifactId>
|
||||
<version>${jlineVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jline</groupId>
|
||||
<artifactId>jansi-core</artifactId>
|
||||
<version>${jlineVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -818,7 +833,7 @@ under the License.</licenseText>
|
|||
<ignoredScope>test</ignoredScope>
|
||||
</ignoredScopes>
|
||||
<excludes>
|
||||
<exclude>org.jline:jline</exclude>
|
||||
<exclude>org.jline:jline-terminal-ffm</exclude>
|
||||
</excludes>
|
||||
</enforceBytecodeVersion>
|
||||
</rules>
|
||||
|
|
Loading…
Reference in New Issue