Commit Graph

302 Commits (9e23206c31c64838db15bc17904e17b5e59d9140)

Author SHA1 Message Date
Andy Wilkinson 80940764f6 Do not trigger a restart when a test class is changed
Previously, dev tools would restart the application when any .class
file changed. This included test classes. This commit updates the
default excludes to ignore any classes with a name that ends in 
Test.class or Tests.class.

Closes gh-3900
9 years ago
Phillip Webb e674d751de Polish Javadoc 9 years ago
Phillip Webb e07df7e4c6 Remove redundant modifiers 9 years ago
Phillip Webb 6e29ee4557 Polish 9 years ago
Phillip Webb 67402405db Reformat code 9 years ago
Phillip Webb 2615990ffb Organize imports 9 years ago
Andy Wilkinson efee06fd9b Only configure remove devtools security if Spring Security is enabled
Previously, RemoteDevToolsAutoConfiguration would try to configure
Spring Security if it was on the classpath. This led to a failure if
Spring Security was on the classpath but its auto-configuration was
disabled.

This commit updates the auto-configuration to be conditional on the
presence of Spring Security’s ObjectPostProcessor bean.

See gh-3889
9 years ago
Andy Wilkinson e2862390ee Allow anonymous access to devtools remote server
Previously, if an app had Spring Security on the classpath the remote
devtools server would be secured using basic authentication. This
prevented RemoteSpringApplication from uploading changes to the server
as they would be rejected with a 401.

This commit updates RemoteDevToolsAutoConfiguration to allow anonymous
access to the remote server. CSRF protection is also disabled so that
POST requests without a CSRF token will be accepted.

Closes gh-3889
9 years ago
Phillip Webb 4aa2fed48b Revert "configure JRE that is different from compiler target level"
This reverts commit 678f36cfef.
9 years ago
Phillip Webb 6193b640a4 Polish 9 years ago
Huang YunKun 4e410681aa Disable resource cache when DevTools is enabled
Closes gh-3794
Closes gh-3739
9 years ago
Martin Lippert 678f36cfef configure JRE that is different from compiler target level 9 years ago
Stephane Nicoll 7c0c953f81 Add value alias for SpringApplicationConfiguration
Given that Spring Boot uses java config accross the board, a new `value`
attribute is now aliased to the existing `classes` attribute such that
one could write the following:

@SpringApplicationConfiguration(MyConfig.class)
public class MyTest {}

Closes gh-3635
9 years ago
Stephane Nicoll 3c91781bee Add additional exclude property
The default value of `spring.devtools.restart.exclude` is quite long and
any override requires to copy/paste it to add additional exclusions. To
avoid that, a new `spring.devtools.restart.additional-exclude` property
has been added.

Both properties are now used to compute the full list of exclusions that
is used by PatternClassPathRestartStrategy.

Closes gh-3774
9 years ago
Stephane Nicoll 0d7ee8a2df Fix default value of restarter meta-data
Closes gh-3773
9 years ago
Andy Wilkinson 8067a53682 Prevent run failures in tests from polluting LoggerContext 9 years ago
Andy Wilkinson 9e88dced88 Update devtools to customise environment before app context is refreshed
Prior to this commit, the devtools used bean factory post processors to
configure the environment with custom, development-time properties. This
meant that the environment was configured as part of the application
context being refreshed. Crucially, this happened after any property
conditions were evaluated making it impossible for the devtools to
change the default auto-configuration behaviour for a bean or
configuration class that was conditional on a property.

This commit moves the configuration of the environment into an
ApplicationListener that listens for the
ApplicationEnvironmentPreparedEvent which is published as soon as the
Environment has been prepared and before the application context is
refreshed.

Closes gh-3726
9 years ago
Andy Wilkinson 4a25bae143 Allow additional paths that trigger a reload/restart to be configured
Previously, only folders on the classpath would be watched and used
to trigger a restart/reload of the application. This commit adds a
new property spring.devtools.restart.additional-paths that can be
used to configure additional paths that should be watched for
changes. When a change occurs in one of those paths a restart or
reload will be triggered, depending on the full restart exclude
patterns configured via the existing spring.devtools.restart.exclude
property.

Closes gh-3469
9 years ago
Andy Wilkinson 2a5a32b603 Add auto-configuration for H2’s web console
Three conditions must be met for the console to be enabled:

 - H2 is on the classpath
 - The application is a web application
 - spring.h2.console.enabled is set to true

If spring-boot-devtools is on the classpath, spring.h2.console.enabled
will be set to true automatically. Without the dev tools, the enabled
property will have to be set to true in application.properties.

By default, the console is available at /h2-console. This can be
configured via the spring.h2.console.path property. The value of this
property must begin with a '/'.

When Spring Security is on the classpath the console will be secured
based on the user's security.* configuration. When the console is
secured, CSRF protection is disabled and frame options is set to
SAMEORIGIN for its path. Both settings are required in order for the
console to function.

Closes gh-766
9 years ago
izeye ee6fc8d917 Fix typos
Closes gh-3608
9 years ago
Stephane Nicoll 42e230192f Polish 9 years ago
Phillip Webb d2133687b0 Use persistent servlet session with DevTools
Set `server.session.persistent=true` when running DevTools to ensure
persistent sessions are used.

Fixes gh-3530
9 years ago
izeye f4589e7cc3 Fix typos
Closes gh-3504
9 years ago
Stephane Nicoll 97634e85ac Remove unnecessary keyword 10 years ago
izeye 7e49a02356 Fix Restarter.setEnabled() to use parameter
Closes gh-3370
10 years ago
Phillip Webb 35379f627a Polish 10 years ago
izeye e98b2a1a33 Remove System.out.println()
Closes gh-3395
10 years ago
izeye b4f636b33f Fix typo
Closes gh-3411
10 years ago
izeye dccb0b7736 Fix typo
Fixes gh-3357
10 years ago
izeye df33830fb6 Polish
Closes gh-3346
10 years ago
izeye 0dc096f905 Fix typo
Closes gh-3333
10 years ago
Phillip Webb 7879743b9f Polish 10 years ago
izeye 286c98d716 Use `bytes.length` in Base64Encoder loop
Update Base64Encoder to use `bytes.length` instead of `encoded.length`
when lopping over the bytes.

Fixes gh-3314
10 years ago
izeye 98ce54c4c3 Fix typo in test methods' names 10 years ago
Phillip Webb 61fc4f3f12 Polish copyright headers 10 years ago
Phillip Webb d3007fae94 Polish formatting 10 years ago
Andrew Landsverk 487ab1a60a Prevent restart when META-INF/maven/** changes
These files are modified by Eclipse for some reason when you change files
like Thymeleaf HTML files. `META-INF/maven/**` has been added to the
default exclusion.

Closes gh-3295
Closes gh-3297
10 years ago
Phillip Webb 099db11754 Don't quit application on restart failures
Update `Restarter` to support a `FailureHandler` strategy that can be
used to determine how to deal with errors. The
`LocalDevToolsAutoConfiguration` now uses a strategy that doesn't quit
the application, but instead continues to wait for further file changes.

This helps make restart much more usable in situations where you
accidentally break code.

Fixes gh-3210
10 years ago
Phillip Webb 24fc94461b Polish 10 years ago
Stephane Nicoll fcb45a4bb7 Polish devtools documentation
See gh-3088
10 years ago
Phillip Webb f0bba46d45 Tweak devtools restart exclusion patterns 10 years ago
Phillip Webb 88c693c6e1 Provide a way to disable the Restarter
Allow the Restarter to be disabled via a System property.

Fixes gh-3173
10 years ago
Stephane Nicoll 6bc4df5690 Fix meta-data for spring.devtools.remote
See gh-3086
10 years ago
Phillip Webb c4dc381a21 Attempt to fix failing build 10 years ago
Phillip Webb 9929e39124 Allow devtools properties in `user.home`
Support loading a `.spring-boot-devtools.properties` file from the
users home folder. The property file can be used to customize settings
that make sense on a per-user basis, but might not want to be checked
into the project.

Fixes gh-3151
10 years ago
Phillip Webb d0349879c3 Allow custom restart pollInterval and quietPeriod
Allow the pollInterval and the quietPeriod of the filewatcher to be
configured.

Fixes gh-3139
10 years ago
Phillip Webb 7bcd6567ba Allow reload to use a trigger file
Update `FileSystemWatcher` to support the concept of a "trigger file"
which could be written by an IDE when a reload needs to occur.

Fixes gh-3157
10 years ago
Phillip Webb 25f74cbaef Clear caches on initial restart
Tweak `Restarter` to clear caches on the initial restart.

See gh-3082
10 years ago
Eddú Meléndez baca62a6c0 Fix typos 10 years ago
Phillip Webb 83300b35bf Set additional template cache devtools properties
Update DevToolsPropertyDefaultsPostProcessor to set the following
additional template cache properties to `false`:

	spring.freemarker.cache
	spring.groovy.template.cache
	spring.velocity.cache
	spring.mustache.cache

Fixes gh-3125
10 years ago
Dave Syer b47af19920 Stop file watcher as soon as a change is detected
The FileWatcher sometimes generates multiple events for a single change
and if there is a slow shutdown hook the second one can come in before
the context is closed, leaving it in a tricky state. This change
attempts to stop the file watcher as soon as it detects a change
(the stop() method is called in the listener, which normally happens in
the same thread as the scan).

Fixes gh-3097
10 years ago
Phillip Webb 983484f429 Rename spring-boot-developer-tools -> devtools
Fixes gh-3099
10 years ago