Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
f5c8a887
Commit
f5c8a887
authored
Jul 24, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate CLI integration tests from any settings decryption failures
parent
4d4cc076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
CommandLineInvoker.java
...framework/boot/cli/infrastructure/CommandLineInvoker.java
+22
-5
SettingsXmlRepositorySystemSessionAutoConfiguration.java
.../SettingsXmlRepositorySystemSessionAutoConfiguration.java
+1
-1
No files found.
spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java
View file @
f5c8a887
...
@@ -21,7 +21,9 @@ import java.io.File;
...
@@ -21,7 +21,9 @@ import java.io.File;
import
java.io.FileFilter
;
import
java.io.FileFilter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.PrintWriter
;
import
java.io.StringReader
;
import
java.io.StringReader
;
import
java.io.StringWriter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -99,16 +101,31 @@ public final class CommandLineInvoker {
...
@@ -99,16 +101,31 @@ public final class CommandLineInvoker {
}
}
public
String
getErrorOutput
()
{
public
String
getErrorOutput
()
{
return
this
.
err
.
toString
(
);
return
postProcessLines
(
getLines
(
this
.
err
)
);
}
}
public
String
getStandardOutput
()
{
public
String
getStandardOutput
()
{
return
this
.
out
.
toString
(
);
return
postProcessLines
(
getStandardOutputLines
()
);
}
}
public
List
<
String
>
getStandardOutputLines
()
{
public
List
<
String
>
getStandardOutputLines
()
{
BufferedReader
reader
=
new
BufferedReader
(
new
StringReader
(
return
getLines
(
this
.
out
);
this
.
out
.
toString
()));
}
private
String
postProcessLines
(
List
<
String
>
lines
)
{
StringWriter
out
=
new
StringWriter
();
PrintWriter
printOut
=
new
PrintWriter
(
out
);
for
(
String
line
:
lines
)
{
if
(!
line
.
startsWith
(
"Maven settings decryption failed"
))
{
printOut
.
println
(
line
);
}
}
return
out
.
toString
();
}
private
List
<
String
>
getLines
(
StringBuffer
buffer
)
{
BufferedReader
reader
=
new
BufferedReader
(
new
StringReader
(
buffer
.
toString
()));
String
line
;
String
line
;
List
<
String
>
lines
=
new
ArrayList
<
String
>();
List
<
String
>
lines
=
new
ArrayList
<
String
>();
try
{
try
{
...
@@ -117,7 +134,7 @@ public final class CommandLineInvoker {
...
@@ -117,7 +134,7 @@ public final class CommandLineInvoker {
}
}
}
}
catch
(
IOException
ex
)
{
catch
(
IOException
ex
)
{
throw
new
RuntimeException
(
"Failed to read
standard
output"
);
throw
new
RuntimeException
(
"Failed to read output"
);
}
}
return
lines
;
return
lines
;
}
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfiguration.java
View file @
f5c8a887
...
@@ -77,7 +77,7 @@ public class SettingsXmlRepositorySystemSessionAutoConfiguration implements
...
@@ -77,7 +77,7 @@ public class SettingsXmlRepositorySystemSessionAutoConfiguration implements
Settings
settings
=
loadSettings
();
Settings
settings
=
loadSettings
();
SettingsDecryptionResult
decryptionResult
=
decryptSettings
(
settings
);
SettingsDecryptionResult
decryptionResult
=
decryptSettings
(
settings
);
if
(!
decryptionResult
.
getProblems
().
isEmpty
())
{
if
(!
decryptionResult
.
getProblems
().
isEmpty
())
{
Log
.
error
(
"
Settings decryption failed: "
+
decryptionResult
.
getProblems
()
);
Log
.
error
(
"
Maven settings decryption failed. Some Maven repositories may be inaccessible"
);
// Continue - the encrypted credentials may not be used
// Continue - the encrypted credentials may not be used
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment