Commit Graph

5131 Commits

Author SHA1 Message Date
Matt Benson ae4559eb4f Create spring-boot-antlib module
Create a new spring-boot-antlib module which allows Apache Ant users
to easily create executable jars.

Fixes gh-3339
2015-06-30 00:30:28 -07:00
Phillip Webb 8d948dfa6c Be more lenient about expected exceptions 2015-06-29 18:35:22 -07:00
Phillip Webb ada92fe020 Merge pull request #3341 from lukashinsch/logging-test
* pr/3341:
  Cleanup logging so execution order is unimportant
2015-06-29 17:58:04 -07:00
Lukas Hinsch 59bf850da1 Cleanup logging so execution order is unimportant
Fixes gh-3341
2015-06-29 17:56:39 -07:00
Phillip Webb 8e78ba8ce7 Change LoggingSystemTests to use real temp folder
Update AbstractLoggingSystemTests to use a TemporaryFolder rule.

Fixes gh-3349
2015-06-29 17:54:16 -07:00
Phillip Webb 5c6fef903d Polish 2015-06-29 17:44:57 -07:00
Phillip Webb 268b7911dd Rename ResourceProperties.Chain.html5AppCache
Rename the `html5AppCache` property from `ResourceProperties.Chain` to
`html-application-cache`.

Fixes gh-3354
2015-06-29 17:14:44 -07:00
Phillip Webb d213cc05d5 Polish 2015-06-29 16:48:59 -07:00
Andy Wilkinson cc3aea2b69 Prevent Jetty’s singleton shutdown thread from breaking restarts
By default, Jetty uses a singleton shutdown thread, registered as a
shutdown hook, to stop its components. This single thread breaks the
restart logic in devtools as a second restart causes a second attempt to
start the singleton shutdown thread which fails with an
IllegalStateException. This processing is unnecessary in a Spring Boot
application as the application context’s lifecycle when ensure that
Jetty is shutdown.

This commit updates the embedded Jetty container to remove its
components from Jetty’s shutdown thread. This leaves the thread with
no components to manage at which point it removes its registration as a
shutdown hook.

Closes gh-3343
2015-06-29 16:52:05 +01:00
Ivan Sopov a09a29be44 Add sample for Jetty 9.3
Closes gh-3325
2015-06-29 15:59:29 +01:00
Andy Wilkinson 7ecc271617 Merge branch 'gh-3296' 2015-06-29 15:59:11 +01:00
Andy Wilkinson 00d594dcda Replace GzipFilter and Tomcat compression with general purpose approach
Closes gh-3296
2015-06-29 15:58:57 +01:00
Ivan Sopov dde194e2b9 Use native compression for all embedded containers, not just Tomcat
See gh-3296
2015-06-29 15:07:47 +01:00
Stephane Nicoll 31a6d53a95 Fix typo 2015-06-29 06:19:19 -07:00
Stephane Nicoll 269398f745 Merge pull request #3346 from izeye/filewatch
* pr/3346:
  Polish
2015-06-29 06:16:09 -07:00
izeye df33830fb6 Polish
Closes gh-3346
2015-06-29 06:15:09 -07:00
Dave Syer 46fbca66a6 Fix typo 'a' -> 'an' 2015-06-29 06:43:25 +01:00
Dave Syer c39b9f7635 Tweak docs on /health endpoint to reflect secure/sensitive
Fixes gh-2816
2015-06-28 22:13:17 +01:00
Stephane Nicoll 8c977567d9 Merge pull request #3344 from izeye/docs-20150628
* pr/3344:
  Polish doc
2015-06-28 06:34:14 -07:00
izeye 4bc7919e04 Polish doc
Closes gh-3344
2015-06-28 06:33:52 -07:00
Stephane Nicoll a990cc1878 Merge pull request #3123 from bclozel/gh-1604
* pr/3123:
  Polish
  Improve Spring Resource Handling support
2015-06-28 06:32:16 -07:00
Stephane Nicoll a6ccb4a6e0 Polish
Polish resource handling chain support. Make sure that the chain is
enabled automatically if at least one strategy is enabled.

See gh-1604
2015-06-28 06:32:07 -07:00
Brian Clozel dd561d15cf Improve Spring Resource Handling support
This commit improves support of the Resource Handling features
introduced in Spring Framework 4.1. Those features add new ways to
resolve and transform static resources in applications.
See [this blog
post](https://spring.io/blog/2014/07/24/spring-framework-4-1-handling-static-web-resources)
for more details.

The `ResourceUrlEncodinFilter` is added for compatible template engines:
Velocity and Thymeleaf. It assists them with rewriting the URLs of
static resources when rendering templates.

New keys are added in the `ResourceProperties` in order to configure
the Resource Handling chain. `ResourceResolvers` and
`ResourceTransformers` are registered accordingly in
`WebMvcAutoConfiguration`.

Here is an example of enabling a `ContentVersionStrategy` on all
static resources, meaning their names will be changed for cache
busting purposes by adding a content hash at the end of the file name.
Like "/js/jquery.js -> /js/jquery-872ca6a9fdda9e2c1516a84cff5c3bc6.js".

```
spring.resources.chain.enabled:true
spring.resources.chain.strategy.content.enabled:true
spring.resources.chain.strategy.content.paths:/**
```

Closes gh-1604
Closes gh-3123
2015-06-28 06:32:07 -07:00
Phillip Webb e34bdcdd9a Merge pull request #2713 from rob-baily/master
* pr/2713:
  Fix logout in sample secure web applications
2015-06-26 16:47:05 -07:00
Rob Baily 3c50386970 Fix logout in sample secure web applications
Fixes gh-1536
2015-06-26 16:44:04 -07:00
Phillip Webb a36d1e2eed Attempt to fix failing log tests 2015-06-26 16:31:04 -07:00
Phillip Webb b68382f3ba Polish 2015-06-26 16:06:11 -07:00
Phillip Webb 4f072f4046 Update logging documentation
Update logging documentation to show the new `-spring` convention and
the Logback extensions.

See gh-1788
See gh-2558
See gh-3338
2015-06-26 15:59:08 -07:00
Phillip Webb 055ace37f0 Support <springProperty> in logback configurations
Include support for a new <springProperty> element which can be used in
`logback-spring.xml` files to add properties from the Spring
Environment. For example:

	<configuration>
		...
		<springProperty name="destination" source="my.loggger.extradest"/>
		<appender name="FILE" class="ch.qos.logback.core.FileAppender">
			<file>${destination}</file>
				...
			</file>
		</appender>
		...
	</configuration>

Fixes gh-1788
2015-06-26 15:59:07 -07:00
Phillip Webb f3f562f386 Support <springProfile> in logback configurations
Include support for a new <springProfile> element which can be used in
`logback-spring.xml` files to selectively enable or disable parts of the
configuration. For example:

	<configuration>
		...
		<springProfile name="staging">
			<logger name="sample.logback" level="TRACE" />
		</springProfile>
		...
	</configuration>

Fixes gh-3338
2015-06-26 15:59:07 -07:00
Phillip Webb 5bc8f0f708 Add logback sample application
Add a logback sample application to demonstrate how `logback-spring.xml`
can be used for customization.

See gh-2558
2015-06-26 15:59:07 -07:00
Phillip Webb 09eed727fe Add Spring specific logging configuration support
Update AbstractLoggingSystem to support convention based logging
configuration specifically for Spring applications. Configurations with
the `-spring` suffix will now be loaded automatically (for example
`logback-spring.xml`).

This change allows for custom log configurations without needing to
reinitialize the logging system. When standard configurations are used
there is no way to prevent early initialization.

Fixes gh-2558
2015-06-26 15:59:07 -07:00
Dave Syer 1f6ac52b96 Change default behaviour of /health when not secured
The default is now to reveal all details unless sensitive=true
(instead of only revealing then if sensitive was explicitly false).
The definition of "secure" also changes to something more sensible
where it is only true if security is enabled.

Fixes gh-2816
2015-06-26 13:44:52 +01:00
Dave Syer c3c1d91f74 Fix Redis metrics default settings
The default should be to generate a key from the prefix. Otherwise
if user sets the prefix and not the key it can pick up metrics from
another repository (which is what happens in the tests).
2015-06-26 12:37:09 +01:00
Stephane Nicoll e02082da99 Merge pull request #3335 from izeye/patch-27
* pr/3335:
  Remove unnecessary import
  Remove unnecessary `@After` callback
2015-06-26 08:26:40 +02:00
Stephane Nicoll 12767a43e2 Remove unnecessary import
See gh-3335
2015-06-26 08:26:16 +02:00
izeye 761c985337 Remove unnecessary `@After` callback
`@After` callback was trying to remove the wrong file anyway. This is
now taken care of by the `TemporaryFolder` rule.

Closes gh-3335
2015-06-26 08:25:18 +02:00
Stephane Nicoll 8b5d44a56d Merge pull request #3333 from izeye/patch-26
* pr/3333:
  Fix typo
2015-06-26 08:21:32 +02:00
izeye 0dc096f905 Fix typo
Closes gh-3333
2015-06-26 08:21:04 +02:00
Phillip Webb 5eb9cd012c Report logback errors in the exception
Update LogbackLoggingSystem to include status errors in the exception
rather than using `System.err`. Also perform additional cleanup in an
attempt to fix CI build failures.

Fixes gh-3309
2015-06-25 12:37:56 -07:00
Phillip Webb 7879743b9f Polish 2015-06-25 12:00:48 -07:00
Andy Wilkinson bedca634c9 Add hamcrest-library to spring-boot's compile classpath
Fixes build break introduced in 31336c2.
2015-06-25 17:14:13 +01:00
Andy Wilkinson c3d93f70b8 Fail fast when a Logback configuration file is missing or malformed
Closes gh-3309
2015-06-25 16:58:58 +01:00
Andy Wilkinson 31336c2dce Allow matchers to be used to verify output captured by OutputCapture
Closes gh-3330
2015-06-25 16:58:58 +01:00
Stephane Nicoll 0ec9de9137 Add support for value provider
Improve the "hints" section of the metadata so that each hint can provide
the reference to a value provider.

A value provider defines how a tool can discover the potential values of
a property based on the context. The provider is identifed by a name and
may have an arbitrary number of parameters.

Closes gh-3303
2015-06-25 14:58:10 +02:00
Stephane Nicoll 43b9ea53d6 Polish (avoid dot at the end of the line) 2015-06-25 11:58:21 +02:00
Stephane Nicoll 56b13800ae Fix json structure 2015-06-25 10:25:21 +02:00
Stephane Nicoll 443fe3b9e6 Merge pull request #3326 from izeye/patch-25
* patch-25:
  Fix typos
2015-06-25 09:21:56 +02:00
izeye e6a3099003 Fix typos
Closes gh-3326
2015-06-25 09:15:28 +02:00
Phillip Webb 689fb0c877 Merge pull request #3314 from izeye/patch-24
* pr/3314:
  Use `bytes.length` in Base64Encoder loop
2015-06-24 21:08:24 -07:00