Commit Graph

311 Commits (05fbd5dc467af66c65c4a16382f66ba69ca2ac07)

Author SHA1 Message Date
Eddú Meléndez 3d52c86a21 Annotate interfaces with @FunctionaInterface
Closes gh-6857
8 years ago
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
Brian Clozel de98c4b3ff Provide Reactor 3 auto-configuration
This commit provides auto-configuration for the Reactor Core 3 library.
A new configuration namespace, "spring.reactor" allows to configure
hooks on operators, like "spring.reactor.stacktrace-mode.enabled".

This property is enabled automatically by devtools, since it improves
the developer experience and provides full stacktrace information when
exceptions occur (but at a performance cost).

Fixes gh-7302
8 years ago
Andy Wilkinson 9bba73a1a9 Upgrade to Thymeleaf 3 and drop support for Thymleaf 2
This commit raises the minimum supported version of Thymeleaf to
3.0.x. It also upgrades Spring Social to a version that is compatible
with Thymeleaf 3.

Closes gh-7450
Closes gh-6258
See gh-7885
8 years ago
Stephane Nicoll 661fd848eb Merge branch '1.5.x' 8 years ago
Stephane Nicoll 505e7f75ea Polish contribution
Closes gh-8089
8 years ago
dreis d58f38f6f6 Use String.replace() with single char if possible
See gh-8089
8 years ago
Phillip Webb 8ffaa54e74 Merge branch '1.5.x' 8 years ago
Madhura Bhave ca435512c0 Introduce spring-boot-autoconfigure-processor
Add an annotation processor that generates properties files for certain
auto-configuration class annotations. Currently attribute values from
@AutoConfigureOrder, @AutoConfigureBefore, @AutoConfigureAfter and
@ConditionalOnClass annotations are stored.

The properties file will allow optimizations to be added in the
`spring-boot-autoconfigure` project. Primarily by removing the need
to ASM parse as many `.class` files.

See gh-7573
8 years ago
Phillip Webb 2c89d9918f Relocate AutoConfigurations from root package
Move PropertyPlaceholder and MessageSource auto-configuration from the
root package to the `context` subpackage.

Fixes gh-8071
8 years ago
Andy Wilkinson 4548af2966 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 531cf5d4f6 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 6a0fb8e44c Update DevTools' ResourceLoader to delegate to user's custom loader
Previously, when DevTools' was used it would set the application
context's ResourceLoader and overwrite any custom ResourceLoader that
had been configured. On the rare occasion when the user had customized
the ResourceLoader this meant that the customization was lost and
certain resources would become unavailable.

This commit updates DevTools' ResourceLoader to delegate a custom
ResourceLoader if one has been configured. If one has not been
configured it delegates as before, i.e. to
WebApplicationContextResourceLoader for web applications and to
DefaultResourceLoader for all others apps.

Closes gh-8010
8 years ago
Andy Wilkinson 5f4848cf21 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 6cab03de0b Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 69320180d9 Make FileSystemWatcherTests.waitsForPollingInterval more robust
The intent of the test is to:

1. Make a change
2. Sleep for long enough for that change to be picked up
3. Make another change
4. Stop that watcher after 1 further scan has been performed
5. Assert that a further scan was performed by checking that two
   separate sets of changes (step 1 and step 3) have been picked up

Previously, step 2 relied on simply sleeping for a period of time
longer than the polling interval. In reality, the polling interval
is only a minimum time between scans and the actual time between them
depends on thread scheduling, GC pauses, etc. This lead to the
test failing intermittently if the scan didn't happen in a timely
manner.

This commit removes the sleep and replaces it with a while loop that
waits for first change to be picked up. This ensures that the second
change will be detected separately from the first and that two
separate change sets should always be available once the watcher has
stopped.

See gh-7782
8 years ago
Phillip Webb 77f9bb09ca Further Polish Mockito 2 support
See gh-7770
8 years ago
Stephane Nicoll 506f6497c0 Merge branch '1.5.x' 8 years ago
Johnny Lim f915ae197a Polish 8 years ago
Phillip Webb a90bad37bd Merge branch '1.5.x' 8 years ago
Phillip Webb b76978ff7e Try to prevent Travis build failures
Update LiveReloadServerTests which seems to be failing intermittently
on Travis.
8 years ago
Phillip Webb 53f1df86a2 Merge branch '1.5.x' 8 years ago
Phillip Webb aacf5d660f Update copyright year for changed files 8 years ago
Phillip Webb 519f9c6c54 Merge branch '1.5.x' 8 years ago
Phillip Webb 8b69856fc9 Polish 8 years ago
Phillip Webb 97d7ffd8e8 Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 61c931943f Fix Devtools PatternResolver Servlet support
Update ClassLoaderFilesResourcePatternResolver to support servlet
resources when it's being used with a WebApplicationContext.

Prior to commit 918e122ddc a `ResourceLoader` was not added to the
`ApplicationContext`, meaning that servlet resources could be found by
virtue of the protected `getResourceByPath()` method. Following commit
918e122ddc, the context `ResourceLoader` is set, meaning that all calls
to `getResource` delegate to the `ResourceLoader` and the
`ApplicationContext` methods are not invoked. Since the devtools
`ResourceLoader` wasn't Servlet aware, servlet resources could not
be found.

Fixes gh-7752
8 years ago
Phillip Webb 291752a317 Merge branch '1.5.x' 8 years ago
Phillip Webb d05357e036 Migrate to Tomcat WebSocket client
Move samples and tests from Jetty websocket client to Tomcat since the
upcoming Jetty release contains a bug in `JsrSession`
(https://github.com/eclipse/jetty.project/issues/1202).

See gh-7599
8 years ago
Phillip Webb 5299db3806 Fix deadlock when calling LiveReloadServer.stop()
Update LiveReloadServer so that different synchronization blocks are
used for the sockets and connection lists. Prior to this commit calling
`LiveReloadServer.stop()` would always result in a 60 second delay since
`stop()` owned the monitor add `removeConnection()` (called from a
different thread) needs it to remove the active connection.

Fixes gh-7749
8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Phillip Webb 8b47561f7e Merge branch '1.5.x' 8 years ago
Hrishikesh Joshi c2992e3736 Add more debug logging to DevTools
Add debug logging for the included and excluded URL patterns and
matching URLs.

Fixes gh-7478
Closes gh-7544
8 years ago
Phillip Webb 1f417997f3 Merge branch '1.5.x' 8 years ago
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb bd74c3d327 Polish formatting 8 years ago
Stephane Nicoll 816c236e5b Merge branch '1.5.x' 8 years ago
Stephane Nicoll ee72e788ed Rename `spring-boot-junit-runners` to `spring-boot-test-support`
Closes gh-7421
8 years ago
Stephane Nicoll bd2415463c Merge branch '1.5.x' 8 years ago
Oscar Utbult 0a1009bc42 Use addAll instead of manual array to collection copy
Closes gh-7539
8 years ago
Phillip Webb 20d7dd5747 Merge branch '1.5.x' 8 years ago
Phillip Webb 1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
8 years ago
Phillip Webb 9e18021e8c Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb fce17ca6d9 Polish 8 years ago
Andy Wilkinson 9273b1789b Merge branch '1.5.x' 8 years ago
Andy Wilkinson 1cd781b242 Make spring-boot-test compatible with Mockito 2.1 and 2.2
We use some internal Mockito classes and some  breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.

To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.

Closes gh-6520
8 years ago
Andy Wilkinson 8c80722a70 Merge branch '1.5.x' 8 years ago
Andy Wilkinson bed5155676 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 5857010dde Polishing: fix Checkstyle warning 8 years ago
Andy Wilkinson 971e5e834c Merge branch '1.5.x' 8 years ago
Andy Wilkinson eff0fc0221 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 918e122ddc Fix remote DevTools' support for adding and removing classes
Previously, remote DevTools only correctly supported modifying
existing classes. New classes that were added would be missed, and
deleted classes could cause a failure as they would be found by
component scanning but hidden by RestartClassLoader.

This commit introduces a DevTools-specific ResourcePatternResolver
that is installed as the application context's resource loader. This
custom resolver is aware of the files that have been added and
deleted and modifies the result returned from getResource and
getResources accordingly.

New intergration tests have been introduced to verify DevTools'
behaviour. The tests cover four scenarios:

- Adding a new controller
- Removing an existing controller
- Adding a request mapping to a controller
- Removing a request mapping from a controller

These four scenarios are tested with:

- DevTools updating a local application
- DevTools updating a remote application packaged in a jar file
- DevTools updating a remote application that's been exploded

Closes gh-7379
8 years ago
Phillip Webb cb7c0b5031 Merge branch '1.5.x' 8 years ago
Phillip Webb dfd327d68f Polish multiple root contexts in `Restarter`
See gh-7335
See gh-7336
8 years ago
Marius Bogoevici 34fb909b41 Support multiple root contexts in `Restarter`
Update devtools restarter to support multiple application contexts.

Fixes gh-7335
Closes gh-7336
8 years ago
Phillip Webb d8b7d6dfdc Merge branch '1.5.x' 8 years ago
Madhura Bhave e7db7adfb8 Rename ApplicationStartedEvent
Rename `ApplicationStartedEvent` to `ApplicationStartingEvent` to
avoid confusion.

Fixes gh-7381
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Phillip Webb 1ff1402d9c Merge branch '1.5.x' 8 years ago
Phillip Webb 221feac3ec User random server port in devtools tests
Update `LocalDevToolsAutoConfigurationTests` to ensure that a random
server port is used rather than 8080.

Fixes gh-7268
See gh-7039
8 years ago
Brian Clozel cad3cc4e5d Merge branch '1.5.x' 8 years ago
Brian Clozel 56fa34719d Merge branch '1.4.x' into 1.5.x 8 years ago
Craig Andrews fc535fe27c Disable resource chain cache when DevTools is enabled
If the resource chain is used, such as by using the
`"spring.resources.chain.strategy.content.enabled"` property,
resource chain caching can prevent the developer from seeing
changes made to resources, so that caching should be disabled
when DevTools is enabled.

This commit sets the `"spring.resources.chain.cache"` property
to `true` when devtools is enabled.
8 years ago
Phillip Webb 98a3ae9ac4 Merge branch '1.5.x' 8 years ago
Phillip Webb 5b66ffbb4b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb cecc1c8817 Disable DevTools property defaults in production
Update `DevToolsPropertyDefaultsPostProcessor` so that property defaults
are only added at development time. Properties are now added only when
`Restarter` is initialize or remote devtools is enabled.

Fixes gh-7014
8 years ago
Andy Wilkinson 3eb9397c9d Merge branch '1.5.x' 8 years ago
Andy Wilkinson 570b292df7 Disable JspServlet's development mode by default
This commit switches off the auto-configured JspServlet's
development mode by default. Development mode is then switched on
when DevTools is on the class path.

Closes gh-7039
8 years ago
Stephane Nicoll b95b57dbf5 Merge branch '1.5.x' 8 years ago
Stephane Nicoll e643fc5bd1 Merge branch '1.4.x' into 1.5.x 8 years ago
Johnny Lim 503d735fdd Polish
Closes gh-7081
8 years ago
Andy Wilkinson 2a035d0748 Remove support for Velocity following its deprecation in 1.4
Closes gh-6971
8 years ago
Stephane Nicoll d897bf7354 Merge branch '1.5.x' 8 years ago
Stephane Nicoll 24c2e7d182 Merge branch '1.4.x' into 1.5.x 8 years ago
Craig Andrews d94eedfd8a Exclude `META-INF/build-info.properties` from restart
Prior to this commit any application configured to write
`META-INF/build-info.properties` could trigger unexpected application
restarts. The problem is particularly prevalent when using Eclipse M2E in
combination with Maven's `spring-boot-maven-plugin` `build-info` goal
and Gradle's `springBoot` `buildInfo()`.

Closes gh-7002
8 years ago
Stephane Nicoll 9bc77254a7 Start building against Spring Framework 5 snapshot
This commit enables compatibility build against Spring Framework 5.

The Velocity and Guava support that are deprecated in the 1.x line have
been removed and few other classes contain minor change to comply to non
backward compatible changes in Spring Framework 5.

This commit also switches the required java version to 8.

Closes gh-6977
8 years ago
Stephane Nicoll 6643ec3713 Next development version 8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
Phillip Webb 7396ccfe04 Harmonize ConditionOutcome messages
Add ConditionMessage class to help build condition messages in a
uniform format and update existing conditions to use it.

Fixes gh-6756
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Andy Wilkinson a6f443a953 Automatically disable DevTools when running a Cucumber test
Closes gh-6412
8 years ago
Andy Wilkinson e9c69f261d Merge branch '1.3.x' 8 years ago
Andy Wilkinson e1950e34c6 Include cause when throwing exception due to unreadable manifest
Closes gh-6417
8 years ago
Phillip Webb 05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
8 years ago
Andy Wilkinson bf618d505c Merge branch '1.3.x 8 years ago
Andy Wilkinson b1dd92881d Retry class file upload to remote application that fails to connect
Closes gh-6339
8 years ago
Andy Wilkinson 8e669e2eef Merge branch '1.3.x 8 years ago
Andy Wilkinson 4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Andy Wilkinson 92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
9 years ago
Stephane Nicoll 5656e83ba9 Enable logging of resolved exceptions
Previously, if an exception was resolved by a `HandlerExceptionResolver`
nothing the log indicated a failure to process the query.

This commit adds a new property `spring.mvc.log-resolved-exception` that
enables warning logs for supported `HandlerExceptionResolver` instances.

When Devtools is enabled, this flag is enabled by default.

Closes gh-2176
9 years ago
Johnny Lim 301574de09 Polish
Closes gh-6234
9 years ago
Andy Wilkinson 52e8ad4b6b Drop back to Hibernate 5.0.9.Final
The upgrade to Hibernate 5.2.0.Final has provide to be too
problematic to live with. It requires Java 8, is incompatible with
a number of other projects in the Hibernate ecosystem, and it's
unclear for how long it will be maintained. We'd previously used
Hibernate 5.1.0.Final but its maintenance is also unclear with
Hibernate 5.1.1.Final being more than 3 months overdue.

This commit drops back to Hibernate 5.0.9.Final. This has a few
advantages:

- It's Java 7 compatible
- It's had some time to mature and should be reasonably free of
  regressions for those moving from 4.3.x
- It's used in both Wildfly and JBoss EAP so there's a fair chance
  that it will continue to be maintained.

Closes gh-6198
9 years ago
Phillip Webb c136054e69 Merge branch '1.3.x' 9 years ago
Phillip Webb 5b97981c87 Polish 9 years ago
Andy Wilkinson f28e3d54c5 Upgrade to Tomcat 8.5.3
This commit changes the default version of Tomcat to 8.5.3 while
also retaining support for Tomcat 8.0 and 7.0. The main difference
in 8.5 is that the ServerSocketFactory abstraction that allowed the
TrustStore and KeyStore to be configured programatically no longer
exists. This logic has been replaced with the use of a custom URL
protocol (springbootssl) that provides access to the key store and
trust store of an SslStoreProvider. In addition to working with 8.5,
this approach has the advantage of also working with 8.0 and 7.0.

Closes gh-6164
9 years ago
Stephane Nicoll 2ff9e3cfdc Upgrade to Hibernate 5.2
See gh-6111
9 years ago
Andy Wilkinson d9d26cba1a Merge branch '1.3.x' 9 years ago
Andy Wilkinson 13635201ff Prevent JVM from exiting with 1 when main thread is only non-daemon
DevTools deliberately throws an uncaught exception on the main thread
as a safe way of causing it to stop processing. This exception is
caught and swallowed by an uncaught exception handler. Unfortunately,
this has the unwanted side-effect of causing the JVM to exit with 1
once all running threads are daemons.

Normally, this isn't a problem. Non-daemon threads, such as those
started by an embedded servlet container, will keep the JVM alive and
restarts of the application context will occur when the user makes to
their application. However, if the user adds DevTools to an
application that doesn't start any non-daemon threads, i.e. it starts,
runs, and then exits, it will exit with 1. This causes both
bootRun in Gradle and spring-boot:run in Maven to report that the
build has failed. While there's no benefit to using DevTools with an
application that behaves in this way, the side-effect of causing the
JVM to exit with 1 is unwanted.

This commit address the problem by updating the uncaught exception
handler to call System.exit(0) if the JVM is going to exit as a
result of the uncaught exception causing the main thread to die. In
other words, if the main thread was the only non-daemon thread, its
death as a result of the uncaught exception will now cause the JVM
to exit with 1 rather than 0. If there are other non-daemon threads
that will keep the JVM alive, the behaviour is unchanged.

Closes gh-5968
9 years ago