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
1f36d465
Commit
1f36d465
authored
Jun 25, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix various Windows related issues
Fixes gh-1168
parent
43cf95b8
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
53 additions
and
12 deletions
+53
-12
pom.xml
spring-boot-actuator/pom.xml
+10
-0
ResourceMatcher.java
...springframework/boot/cli/command/jar/ResourceMatcher.java
+3
-2
ExtendedGroovyClassLoader.java
...ramework/boot/cli/compiler/ExtendedGroovyClassLoader.java
+2
-0
DetailedProgressReporterTests.java
...oot/cli/compiler/grape/DetailedProgressReporterTests.java
+14
-6
LoggingApplicationListener.java
...ingframework/boot/logging/LoggingApplicationListener.java
+11
-0
base.xml
...sources/org/springframework/boot/logging/logback/base.xml
+1
-1
LoggingApplicationListenerTests.java
...amework/boot/logging/LoggingApplicationListenerTests.java
+6
-1
LogbackLoggingSystemTests.java
...ework/boot/logging/logback/LogbackLoggingSystemTests.java
+5
-1
logback-nondefault.xml
spring-boot/src/test/resources/logback-nondefault.xml
+1
-1
No files found.
spring-boot-actuator/pom.xml
View file @
1f36d465
...
...
@@ -101,6 +101,16 @@
<artifactId>
tomcat-embed-core
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.crashub
</groupId>
<artifactId>
crash.shell
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.crashub
</groupId>
<artifactId>
crash.cli
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.crashub
</groupId>
<artifactId>
crash.embed.spring
</artifactId>
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/jar/ResourceMatcher.java
View file @
1f36d465
...
...
@@ -33,6 +33,7 @@ import org.springframework.core.io.Resource;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.util.AntPathMatcher
;
import
org.springframework.util.StringUtils
;
/**
* Used to match resources for inclusion in a CLI application's jar file
...
...
@@ -186,8 +187,8 @@ class ResourceMatcher {
}
private
MatchedResource
(
File
rootFolder
,
File
file
)
{
this
.
name
=
file
.
getAbsolutePath
().
substring
(
rootFolder
.
getAbsolutePath
().
length
()
+
1
);
this
.
name
=
StringUtils
.
cleanPath
(
file
.
getAbsolutePath
().
substring
(
rootFolder
.
getAbsolutePath
().
length
()
+
1
)
)
;
this
.
file
=
file
;
this
.
root
=
false
;
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java
View file @
1f36d465
...
...
@@ -38,6 +38,7 @@ import org.codehaus.groovy.control.CompilerConfiguration;
import
org.codehaus.groovy.control.SourceUnit
;
import
org.springframework.util.Assert
;
import
org.springframework.util.FileCopyUtils
;
import
org.springframework.util.StringUtils
;
/**
* Extension of the {@link GroovyClassLoader} with support for obtaining '.class' files as
...
...
@@ -222,6 +223,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader {
}
private
boolean
isGroovyJar
(
String
entry
)
{
entry
=
StringUtils
.
cleanPath
(
entry
);
for
(
String
jarPrefix
:
GROOVY_JARS_PREFIXES
)
{
if
(
entry
.
contains
(
"/"
+
jarPrefix
+
"-"
))
{
return
true
;
...
...
spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/DetailedProgressReporterTests.java
View file @
1f36d465
...
...
@@ -26,9 +26,17 @@ import org.eclipse.aether.transfer.TransferResource;
import
org.junit.Before
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
import
static
org
.
hamcrest
.
Matchers
.
endsWith
;
import
static
org
.
hamcrest
.
Matchers
.
startsWith
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertT
rue
;
import
static
org
.
junit
.
Assert
.
assertT
hat
;
/**
* Tests for {@link DetailedProgressReporter}.
*
* @author Andy Wilkinson
*/
public
final
class
DetailedProgressReporterTests
{
private
static
final
String
REPOSITORY
=
"http://my.repository.com/"
;
...
...
@@ -63,13 +71,13 @@ public final class DetailedProgressReporterTests {
public
void
downloaded
()
throws
InterruptedException
{
// Ensure some transfer time
Thread
.
sleep
(
100
);
TransferEvent
completedEvent
=
new
TransferEvent
.
Builder
(
this
.
session
,
this
.
resource
).
addTransferredBytes
(
4096
).
build
();
this
.
session
.
getTransferListener
().
transferSucceeded
(
completedEvent
);
assertTrue
(
new
String
(
this
.
baos
.
toByteArray
()).
matches
(
String
.
format
(
"Downloaded: %s%s \\(4KB at [0-9]+(\\.|,)[0-9]KB/sec\\)\\n"
,
REPOSITORY
,
ARTIFACT
)));
String
message
=
new
String
(
this
.
baos
.
toByteArray
()).
replace
(
"\\"
,
"/"
);
assertThat
(
message
,
startsWith
(
"Downloaded: "
+
REPOSITORY
+
ARTIFACT
));
assertThat
(
message
,
containsString
(
"4KB at"
));
assertThat
(
message
,
containsString
(
"KB/sec"
));
assertThat
(
message
,
endsWith
(
"\n"
));
}
}
spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
View file @
1f36d465
...
...
@@ -36,6 +36,7 @@ import org.springframework.util.ClassUtils;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.util.StringUtils
;
/**
* An {@link ApplicationListener} that configures a logging framework depending on what it
...
...
@@ -147,6 +148,16 @@ public class LoggingApplicationListener implements SmartApplicationListener {
}
}
// Logback won't read backslashes so add a clean path for it to use
if
(!
StringUtils
.
hasLength
(
System
.
getProperty
(
"LOG_TEMP"
)))
{
String
path
=
System
.
getProperty
(
"java.io.tmpdir"
);
path
=
StringUtils
.
cleanPath
(
path
);
if
(
path
.
endsWith
(
"/"
))
{
path
=
path
.
substring
(
0
,
path
.
length
()-
1
);
}
System
.
setProperty
(
"LOG_TEMP"
,
path
);
}
boolean
environmentChanged
=
false
;
for
(
Map
.
Entry
<
String
,
String
>
mapping
:
ENVIRONMENT_SYSTEM_PROPERTY_MAPPING
.
entrySet
())
{
...
...
spring-boot/src/main/resources/org/springframework/boot/logging/logback/base.xml
View file @
1f36d465
...
...
@@ -3,7 +3,7 @@
<include
resource=
"org/springframework/boot/logging/logback/basic.xml"
/>
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${
java.io.tmpdir:-/tmp
}/}spring.log}"
/>
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${
LOG_TEMP:-${java.io.tmpdir:-/tmp}
}/}spring.log}"
/>
<property
name=
"FILE_LOG_PATTERN"
value=
"%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } [%t] --- %-40.40logger{39} : %m%n%wex"
/>
<appender
name=
"FILE"
...
...
spring-boot/src/test/java/org/springframework/boot/logging/LoggingApplicationListenerTests.java
View file @
1f36d465
...
...
@@ -86,7 +86,12 @@ public class LoggingApplicationListenerTests {
}
private
String
tmpDir
()
{
return
this
.
context
.
getEnvironment
().
resolvePlaceholders
(
"${java.io.tmpdir}"
);
String
path
=
this
.
context
.
getEnvironment
().
resolvePlaceholders
(
"${java.io.tmpdir}"
);
path
=
path
.
replace
(
"\\"
,
"/"
);
if
(
path
.
endsWith
(
"/"
))
{
path
=
path
.
substring
(
0
,
path
.
length
()-
1
);
}
return
path
;
}
@Test
...
...
spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java
View file @
1f36d465
...
...
@@ -61,7 +61,11 @@ public class LogbackLoggingSystemTests {
}
private
String
tmpDir
()
{
return
System
.
getProperty
(
"java.io.tmpdir"
);
String
path
=
StringUtils
.
cleanPath
(
System
.
getProperty
(
"java.io.tmpdir"
));
if
(
path
.
endsWith
(
"/"
))
{
path
=
path
.
substring
(
0
,
path
.
length
()
-
1
);
}
return
path
;
}
@After
...
...
spring-boot/src/test/resources/logback-nondefault.xml
View file @
1f36d465
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${
java.io.tmpdir:-/tmp
}/}tmp.log}"
/>
<property
name=
"LOG_FILE"
value=
"${LOG_FILE:-${LOG_PATH:-${
LOG_TEMP:-${java.io.tmpdir:-/tmp}
}/}tmp.log}"
/>
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${LOG_FILE} [%t] ${PID:-????} %c{1}: %m%n
</pattern>
...
...
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