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
4e410681
Commit
4e410681
authored
Aug 20, 2015
by
Huang YunKun
Committed by
Stephane Nicoll
Aug 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable resource cache when DevTools is enabled
Closes gh-3794 Closes gh-3739
parent
5aa222a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
DevToolsPropertyDefaultsPostProcessor.java
...t/devtools/env/DevToolsPropertyDefaultsPostProcessor.java
+1
-0
LocalDevToolsAutoConfigurationTests.java
...ls/autoconfigure/LocalDevToolsAutoConfigurationTests.java
+13
-0
No files found.
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java
100644 → 100755
View file @
4e410681
...
...
@@ -46,6 +46,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
properties
.
put
(
"spring.mustache.cache"
,
"false"
);
properties
.
put
(
"server.session.persistent"
,
"true"
);
properties
.
put
(
"spring.h2.console.enabled"
,
"true"
);
properties
.
put
(
"spring.resources.cache-period"
,
"0"
);
PROPERTIES
=
Collections
.
unmodifiableMap
(
properties
);
}
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java
100644 → 100755
View file @
4e410681
...
...
@@ -28,6 +28,7 @@ import org.junit.rules.ExpectedException;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.ResourceProperties
;
import
org.springframework.boot.devtools.classpath.ClassPathChangedEvent
;
import
org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher
;
import
org.springframework.boot.devtools.filewatch.ChangedFiles
;
...
...
@@ -89,6 +90,13 @@ public class LocalDevToolsAutoConfigurationTests {
assertThat
(
resolver
.
isCacheable
(),
equalTo
(
false
));
}
@Test
public
void
resourceCachePeriodIsZero
()
throws
Exception
{
this
.
context
=
initializeAndRun
(
WebResourcesConfig
.
class
);
ResourceProperties
properties
=
this
.
context
.
getBean
(
ResourceProperties
.
class
);
assertThat
(
properties
.
getCachePeriod
(),
equalTo
(
0
));
}
@Test
public
void
liveReloadServer
()
throws
Exception
{
this
.
context
=
initializeAndRun
(
Config
.
class
);
...
...
@@ -242,4 +250,9 @@ public class LocalDevToolsAutoConfigurationTests {
}
@Configuration
@Import
({
LocalDevToolsAutoConfiguration
.
class
,
ResourceProperties
.
class
})
public
static
class
WebResourcesConfig
{
}
}
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