File tree 5 files changed +66
-7
lines changed
src/main/java/org/apache/maven/jline 5 files changed +66
-7
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,15 @@ under the License.
99
99
</dependency >
100
100
<dependency >
101
101
<groupId >org.jline</groupId >
102
- <artifactId >jline</artifactId >
102
+ <artifactId >jline-reader</artifactId >
103
+ </dependency >
104
+ <dependency >
105
+ <groupId >org.jline</groupId >
106
+ <artifactId >jline-terminal-jni</artifactId >
107
+ </dependency >
108
+ <dependency >
109
+ <groupId >org.jline</groupId >
110
+ <artifactId >jline-terminal-ffm</artifactId >
103
111
</dependency >
104
112
105
113
<!-- DI Runtime -->
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ under the License.
123
123
</dependency >
124
124
<dependency >
125
125
<groupId >org.jline</groupId >
126
- <artifactId >jline </artifactId >
126
+ <artifactId >jansi-core </artifactId >
127
127
</dependency >
128
128
129
129
<dependency >
Original file line number Diff line number Diff line change @@ -40,7 +40,20 @@ under the License.
40
40
</dependency >
41
41
<dependency >
42
42
<groupId >org.jline</groupId >
43
- <artifactId >jline</artifactId >
43
+ <artifactId >jline-reader</artifactId >
44
+ </dependency >
45
+ <dependency >
46
+ <groupId >org.jline</groupId >
47
+ <artifactId >jline-terminal-jni</artifactId >
48
+ </dependency >
49
+ <dependency >
50
+ <groupId >org.jline</groupId >
51
+ <artifactId >jline-terminal-ffm</artifactId >
52
+ <optional >true</optional >
53
+ </dependency >
54
+ <dependency >
55
+ <groupId >org.jline</groupId >
56
+ <artifactId >jansi-core</artifactId >
44
57
</dependency >
45
58
<dependency >
46
59
<groupId >javax.inject</groupId >
@@ -62,4 +75,13 @@ under the License.
62
75
</dependency >
63
76
</dependencies >
64
77
78
+ <build >
79
+ <plugins >
80
+ <plugin >
81
+ <groupId >org.eclipse.sisu</groupId >
82
+ <artifactId >sisu-maven-plugin</artifactId >
83
+ </plugin >
84
+ </plugins >
85
+ </build >
86
+
65
87
</project >
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public MessageBuilder builder(int size) {
74
74
75
75
@ Override
76
76
public String readLine () throws IOException {
77
- return doPrompt (null , true );
77
+ return doPrompt (null , false );
78
78
}
79
79
80
80
@ Override
@@ -193,7 +193,21 @@ private void doDisplay(String message) throws IOException {
193
193
194
194
private String doPrompt (String message , boolean password ) throws IOException {
195
195
try {
196
- return MessageUtils .reader .readLine (message != null ? message + ": " : null , password ? '*' : null );
196
+ if (message != null ) {
197
+ if (!message .endsWith ("\n " )) {
198
+ if (message .endsWith (":" )) {
199
+ message += " " ;
200
+ } else if (!message .endsWith (": " )) {
201
+ message += ": " ;
202
+ }
203
+ }
204
+ int lastNl = message .lastIndexOf ('\n' );
205
+ String begin = message .substring (0 , lastNl + 1 );
206
+ message = message .substring (lastNl + 1 );
207
+ MessageUtils .terminal .writer ().print (begin );
208
+ MessageUtils .terminal .flush ();
209
+ }
210
+ return MessageUtils .reader .readLine (message , password ? '*' : null );
197
211
} catch (Exception e ) {
198
212
throw new IOException ("Unable to prompt user" , e );
199
213
}
Original file line number Diff line number Diff line change @@ -461,7 +461,22 @@ under the License.
461
461
</dependency >
462
462
<dependency >
463
463
<groupId >org.jline</groupId >
464
- <artifactId >jline</artifactId >
464
+ <artifactId >jline-reader</artifactId >
465
+ <version >${jlineVersion} </version >
466
+ </dependency >
467
+ <dependency >
468
+ <groupId >org.jline</groupId >
469
+ <artifactId >jline-terminal-ffm</artifactId >
470
+ <version >${jlineVersion} </version >
471
+ </dependency >
472
+ <dependency >
473
+ <groupId >org.jline</groupId >
474
+ <artifactId >jline-terminal-jni</artifactId >
475
+ <version >${jlineVersion} </version >
476
+ </dependency >
477
+ <dependency >
478
+ <groupId >org.jline</groupId >
479
+ <artifactId >jansi-core</artifactId >
465
480
<version >${jlineVersion} </version >
466
481
</dependency >
467
482
<dependency >
@@ -818,7 +833,7 @@ under the License.</licenseText>
818
833
<ignoredScope >test</ignoredScope >
819
834
</ignoredScopes >
820
835
<excludes >
821
- <exclude >org.jline:jline</exclude >
836
+ <exclude >org.jline:jline-terminal-ffm </exclude >
822
837
</excludes >
823
838
</enforceBytecodeVersion >
824
839
</rules >
You can’t perform that action at this time.
0 commit comments