Commit Graph

906 Commits

Author SHA1 Message Date
Stephane Nicoll caf11e4445 Add Couchbase cache support
This commit updates the cache auto-configuration to provide a
`CouchbaseCacheManager` if a `Bucket` has been configured.

The global customizer infrastructure allows to further tune the cache
manager if necessary.

Closes gh-5176
2016-03-18 07:52:56 +01:00
Stephane Nicoll 10012cfddc Rename Maven plugin mojo
Rename the goal from `generate-build-info` to `build-info` for consistency.

See gh-2559
2016-03-17 16:58:08 +01:00
ddbullfrog 21c630828e Fix typo
Closes gh-5424
2016-03-16 09:29:12 +01:00
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +01:00
Stephane Nicoll e67f2e2983 Separate Couchbase setup from Spring Data
This commit separates the basic setup of Couchbase from Spring Data so
that a `Bucket` and `Cluster` bucket beans are exposed even if Spring
Data is not available.

A basic setup happens if `spring.couchbase.bootstrap-hosts` is specified,
configuring the `default` bucket with no authentication unless specified
otherwise.

If Spring Data is available, those beans are re-used by default to
configure the `CouchbaseTemplate` and other repository-related beans.

Closes gh-5347
2016-03-14 11:11:48 +01:00
Stephane Nicoll dddea70985 Collect and display build information
This commit updates the Maven plugin to generate a
`META-INF/boot/build.properties` file with various build-specific
settings (group, artifact, name, version and build time). Additionally,
the plugin can be configured to write an arbitrary number of additional
properties.

A new `BuildProperties` bean is automatically exposed when such a file is
present. If that bean is present, an `InfoContributor` is automatically
created to expose that information under the `build` key.

As for the git contributor, it is possible to only display the core
settings or everything using the `management.info.build.mode` property.

See gh-2559
2016-03-10 17:21:31 +01:00
Andy Wilkinson 86d87f6b8a Deprecate support for Velocity
Support for Velocity has been deprecated in Spring Framework 4.3 with
the plan being to remove it in 5.0. This commit deprecates Spring
Boot's support in 1.4, with the plan being to remove it in 2.0.

Closes gh-5276
2016-03-07 13:48:17 +00:00
Andy Wilkinson 5009933788 Move to constructor injection in simple configuration classes
This commit updates "simple" configuration classes to use constructor
injection. Simple means that there are no optional dependencies
(@Autowired(required=false) is not used), and none of the dependencies
use generics.

Configuration classes that are not simple will be updated in a second
pass once https://jira.spring.io/browse/SPR-14015 has been fixed.

See gh-5306
2016-03-04 12:27:29 +00:00
Phillip Webb 73cbb2f40a Polish 2016-03-03 09:14:24 -08:00
Stephane Nicoll 0490fbc7f8 Polish contribution
`InfoProvider` is now `InfoContributor` and contributes to the `Info`
instance via a builder. The `Info` instance is immutable. Each
contributor can be disabled via the `management.info.<name>.enabled`
key or all can be disabled using `management.info.defaults.enabled` (this
is similar to what the health endpoint does).

By default, all keys from the environment starting with `info.` are
exposed. If a `git.properties` file is present in the classpath, the
content of `GitInfo` is exposed using the `git` key.

A `SimpleInfoContributor` and `AbstractEnvironmentInfoContributor` are
available for convenience. `InfoContributor` instances can be ordered
the usual way, with a default order provided by
`InfoProviderAutoConfiguration#DEFAULT_ORDER`.

Closes gh-3492
2016-03-03 16:23:37 +01:00
Meang Akira Tanaka 8bebe6dea9 Info endpoint
See gh-3492
2016-03-03 14:39:55 +01:00
Andy Wilkinson 355860fd09 Remove @Autowired from constructors where class has single constructor
Closes gh-5226
2016-03-01 16:03:07 +00:00
Andy Wilkinson 3ca67e669d Polishing 2016-03-01 14:30:27 +00:00
Sebastien Deleuze 6fde504a63 Fix failing Content-Type related test after SPR-13631 changes 2016-03-01 15:05:22 +01:00
Stephane Nicoll 6741f05af1 Polish contribution
Closes gh-4903
2016-02-29 14:07:01 +01:00
Andy Wilkinson fa7dfb5109 Ignore tests that are broken by UNDERTOW-639 2016-02-26 18:24:56 +00:00
Ken Dombeck 9f93559d44 Fix logger classname
Closes gh-5254
2016-02-26 16:53:48 +01:00
Stephane Nicoll 5680ffdedb Fixup version numbers following release 2016-02-26 11:00:36 +01:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson fcb5f03146 Upgrade to Hazelcast 3.6
Closes gh-5237
2016-02-25 20:15:02 +00:00
Andy Wilkinson 56487d23d6 Merge branch '1.3.x' 2016-02-25 20:00:34 +00:00
Vedran Pavic 6801e8208d Fix namespace declarations in Hazelcast xml's and make them consistent 2016-02-25 19:59:28 +00:00
Andy Wilkinson 01b7a7d9d3 Add missing copyright headers 2016-02-25 12:12:57 +00:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Phillip Webb 34ae7e3eee Fix packages and annotations used in sample
Fixup accidental error in previous commit.
2016-02-22 12:07:49 -08:00
Phillip Webb 95c4cdbedc Fix packages and annotations used in sample
Update a few of the samples to correct the packages used in tests and
to make use of the `@SpringBootApplication` annotation.
2016-02-22 10:29:43 -08:00
Phillip Webb 89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
2016-02-19 19:28:37 -08:00
Phillip Webb 4b55144d80 Polish 2016-02-19 16:19:22 -08:00
Andy Wilkinson 99b3af9216 Use a random server port in the Couchbase sample’s tests 2016-02-19 16:13:42 +00:00
Andy Wilkinson d66bc7b1ee Merge branch '1.3.x' 2016-02-18 12:48:10 +00:00
Andy Wilkinson d3074a086c Increase timeout for startup of embedded Cassandra
The integration tests for the Spring Data Cassandra sample application
fail intermittently, apparently due to Cassandra failing to start
within the default timeout period of 10000ms.

In attempt to get the tests to pass reliably, this commit increases
the timeout to 60000ms (1 minute).
2016-02-18 12:46:31 +00:00
Andy Wilkinson 3b068c8bc2 Upgrade to Spring Integration 4.3.0.M1
Closes gh-5163
2016-02-17 16:42:39 +00:00
Stephane Nicoll 64a5cad09a Improve couchbase support
Expose an `auto-index` property that controls if views and indexes
should be created automatically.

Update the sample so that it uses this new property, lowering the manual
steps to make it working on a vanilla couchbase server.

See gh-3498
2016-02-16 11:42:14 +01:00
Stephane Nicoll da3b49e024 Polish contribution
Closes gh-3499
2016-02-16 09:31:50 +01:00
Eddú Meléndez 76f1ca4188 Add Couchbase support
Closes gh-3498
2016-02-16 09:31:50 +01:00
Oliver Gierke e703997be2 Use new projection capabilities in Spring Data Hopper.
Uses interfaces instead of DTOs to implement projections. Works
around DATAJPA-864 [0].

[0] https://jira.spring.io/browse/DATAJPA-864
2016-02-15 15:19:54 +01:00
Stephane Nicoll ebffa493e4 Harmonize ConfigurationProperties bean name
When `@EnableConfigurationProperties` is defined, Spring Boot
automatically registers a bean in the context for each class specified
on the annotation. Previously, the name of the bean only included the
prefix which leads to conflict if two different classes use the same
prefix.

This commit changes the bean name structure to be <prefix>-<fqn> where
prefix is the prefix used on the annotation and <fqn> the fully qualified
name of the target class.

Closes gh-4395
2016-02-09 17:19:11 +01:00
Phillip Webb 2b18e99ac7 Polish 2016-02-08 11:01:52 -08:00
Phillip Webb 1cc1fc6431 Use AssertJ in spring-boot-samples
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb 516afcd2ca Polish 2016-02-06 15:02:12 -08:00
Stephane Nicoll 5bfccf42c4 Merge branch '1.3.x' 2016-02-02 11:24:00 +01:00
Karol Rynio 19afae7fe6 Fix typos
Closes gh-5025
2016-02-02 11:23:35 +01:00
Stephane Nicoll da5e0f6abe Remove reference to `spring-boot.version` in the build
Closes gh-5014
2016-01-26 13:24:16 +01:00
Stephane Nicoll 2b1c319867 Fix broken build
`server.session-timeout` was deprecated in 1.3 but still used in a sample
that broke once the support for it was removed. This commit fix the build
by using the expected property.
2016-01-26 10:08:02 +01:00
Stephane Nicoll e293008c3f Rename redis starter to spring-boot-starter-data-redis
Closes gh-1033
2016-01-26 08:31:34 +01:00
Stephane Nicoll bead239448 Remove support for Log4j
Apache Log4j 1.x is EOL and has now been replaced by log4j 2. This commit
removes the deprecated support for Log4j 1.x

See gh-4905
2016-01-25 14:06:06 +01:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Phillip Webb c77a7e0cba Fixup version numbers following release 2016-01-21 19:18:01 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Phillip Webb 7397dbaf57 Allow ExitCodeGenerator to be used on Exceptions
Update exit code support to allow the ExitCodeGenerator interface to
be placed on an Exception. Any uncaught exception implementing the
interface and returning a non `0` status will now trigger a System.exit
with the code.

Fixes gh-4803
2016-01-13 12:31:37 +00:00
Andy Wilkinson 2aff82bb64 Merge branch '1.2.x' 2016-01-12 10:19:36 +00:00
Stephane Nicoll ecf56f0708 Fixup version numbers following release 2015-12-18 15:07:13 +01:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Stephane Nicoll bb736e255b Fix SNAPSHOT version 2015-12-17 14:15:14 +01:00
Kirill Vlasov 786aacf2e9 Use Collections.isEmpty() instead of .size() == 0
Ensure that Collections.isEmpty() is used to check if there are no
elements in a collections. This is more explicit and can be faster than
calling .size().

Closes gh-4783
2015-12-16 20:59:33 +00:00
Dave Syer c7c685f65f Disable hypermedia in actuator endpoints by default
This change permanently removes links from the endpoints that return
arrays or collections, and also disables them in the rest of the
endpoints (except /actuator) by default.

Fixes gh-4616
2015-12-16 11:00:22 +00:00
Stephane Nicoll f269383803 Polish contribution
Closes gh-4770
2015-12-14 14:49:22 +01:00
David Morley 288aa962c4 Rename method to clarify which connector is being created
See gh-4770
2015-12-14 14:44:48 +01:00
Eddú Meléndez 1b81d9f0b5 Add support for server.server-header property
Add a `server.server-header` property which can be used to override the
`server` header usually sent back automatically by Tomcat/Jetty or
Undertow.

See https://www.owasp.org/index.php/Securing_tomcat for background.

Fixes gh-4461
Closes gh-4504
2015-12-12 21:24:29 +00:00
Phillip Webb 7f8aff0231 Format HTML in web-ui sample 2015-12-11 13:41:38 +00:00
kozazz 0de4b6ce63 Add update/delete to the web-ui sample
Closes gh-4735
See gh-4733
2015-12-11 13:37:08 +00:00
Phillip Webb 0489a3b4de Polish 2015-12-10 19:43:29 +00:00
Andy Wilkinson 4f7752d467 Merge branch '1.2.x' 2015-12-10 13:45:15 +00:00
Andy Wilkinson ce541bebcf Align BasicErrorController’s HTML response status with non-HTML status
Previously, BasicErrorController would return the response status
set in the javax.servlet.error.status_code request attribute when
serving JSON but would also return a 200 OK response when serving
HTML. This didn’t cause much trouble when a person was browsing, but
proved problematic for machine clients that request text/html and care
about the response status. For example, the success handler would be
driven for an XHR request even though the response was really an error.

This commit updates BasicErrorController to set the response status for
text/html responses to match the status that it would use in an
application/json response.

Closes gh-4694
2015-12-10 13:40:16 +00:00
Andy Wilkinson 0e09408f91 Merge branch '1.2.x' 2015-12-03 11:10:52 +00:00
Ivan Chen d6bd120b2c Remove unused test.css from spring-boot-sample-tomcat
Closes gh-4606
2015-12-03 11:10:15 +00:00
Dave Syer 344360453e Add test for management.security.enabled=false with child context 2015-11-27 17:14:49 +00:00
Dave Syer 2de48a35ab Make /error the error page in child context as well as parent
If user set the management.port *and* the management.context-path
then the /error path was in the wrong place because formerly it
was implemented (in this case) by an MvcEndpoint. If we
switch it to a regular @Controller (which are now supported in the
child context if there is one) then it won't disappear under the
management.context-path.

Also use lazy request matching in ignores as well as secure paths.
The problem was that the ignores were constructed eagerly from the
actuator paths before they were available (the EndpointHandlerMapping
needs to be lazily accessed to avoid a security-induced bean creation
cascade).

Fixes gh-4624
2015-11-27 16:53:37 +00:00
Stephane Nicoll e19d9ff09d Fix gradle config for the bootRun task
Closes gh-4627
2015-11-27 10:23:12 +01:00
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Stephane Nicoll 14e7b10310 Fixup version numbers following release 2015-11-16 12:50:27 +01:00
Spring Buildmaster 3f6f57a80e Next Development Version 2015-11-16 03:18:54 -08:00
Johnny Lim 4d9111606b Polish docs
Closes gh-4446
2015-11-12 17:23:04 +01:00
Dave Syer 88f776ef17 Remove duplicate sample 2015-11-07 10:25:07 +00:00
Phillip Webb 6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Dave Syer fa9724becb Revert "Add or avoid proxy configurations for integration tests"
This reverts commit 251f2805a8.
2015-11-02 17:38:54 +00:00
mrumpf 251f2805a8 Add or avoid proxy configurations for integration tests
The Maven POM does all the dependency resolutions for the
spring-boot-antlib project. Delegating this task to Ivy, which is
buried deep in the Antrun/Antunit part of the build, makes any kind
of proxy configuration much more complex.
The ivysettings.xml already has the local M2 repository configured,
but because the folder "repository" is missing, the artifacts, already
downloaded by Maven cannot be resolved from this location.
The Spring and Maven Central repositories should be removed from the
ivysettings.xml files in order to force all resolves to be done through
the local M2 repository. The POM of joda-time version 2.8.1 has an
optional dependency to joda-convert 1.2, which lets the Ivy resolve
process fail, because this version of the joda-convert library was
not resolved by any of the Maven POMs. It seems as if Ivy does not
respect the optional scope, defined in the joda-time POM.

Pass proxy settings to the forked process to make the Gradle distribution download work

Create a gradle.properties file for each Gradle integration test and writes the forking
process' proxy settings as systemProp.http(s).Host/Port to the properties file.
This configures the external process with the right proxy settings to let it download
the Gradle distribution via the HTTP proxy server.

Added a hint for Windows users to get the core.autocrlf setting right

When the core.autocrlf setting under Windows is set to false for example
All files are not converted regarding their EOL characters to the
Windows format with CRLF at a line's end. There is a checkstyle
validation that checks that all files have the system's line endings
and in some test-cases the value from the system property "line.ending"
is used to check test output. So without the conversion, those checks
are going to fail, resulting in build errors.

Fixes gh-4367, fixes gh-3816
2015-11-02 17:23:30 +00:00
Dave Syer cc3f673874 Narrow range of events listened for in security audit
The InteractiveAuthenticationSuccessEvent is always shadowed by a
regulat AuthenticationSuccessEvent, so there's no need to listen for
all AbstractAuthenticationSuccessEvents.

Fixes gh-4355
2015-11-02 10:01:45 +00:00
Stephane Nicoll 791e3048cf Fixup version numbers following release 2015-11-01 17:02:35 +01:00
Dave Syer 96fcd49e2e OpenTsdbMetricWriter -> OpenTsdbGaugeWriter 2015-10-31 16:10:49 +00:00
Dave Syer db03e8ea50 Fix sample and tidy up MetricWriter/GaugeWriter
The metric export configuration was still using the MetricWriter
interface where it should be using GaugeWriter
2015-10-31 16:00:48 +00:00
Andy Wilkinson 74317a220e Merge branch '1.2.x' 2015-10-30 09:24:14 +00:00
Andy Wilkinson 1f92360583 Ensure that HATEOAS sample does not try to produce XML
The HATEOAS sample does not support XML responses. Previously, the
controller doesn't constrain the media types that it could produce.
This would result in a failure when handling a request that prefers
XML responses.

This commit updates the produces clauses in the controller so that
the sample will only attempt to produce JSON.

Closes gh-4343
2015-10-30 09:17:34 +00:00
Andy Wilkinson 248fcbec5d Merge branch '1.2.x' 2015-10-30 09:06:58 +00:00
Andy Wilkinson 05b501ce41 Update Tomcat multi-connectors sample to configure SSL declaratively
The documentation recommends configuring the HTTP connector in code
and using application.properties to configure the HTTPS connector
as it's easier. This commit updates the sample to follow that
recommendation.

Closes gh-4342
2015-10-30 09:05:24 +00:00
Dave Syer abd7bc0466 Add OAuth2 resource server sample
Shows how to use @EnableResourceServer in a pure resource
server and configure the secure paths.
2015-10-29 08:41:51 +00:00
Andy Wilkinson c4122b8f8d Work around brittle annotation scanning in Mojarra
FacesListener in Mojarra 2.2.12 (used in Glassfish 4.1.1) is a
ServletContainerInitializer that’s annotated to handle types annotated
with javax.annotation.Resource.
OAuth2RestOperationsConfiguration.SessionScopedConfiguration is one such
class. This leads to com.sun.faces.config.DelegatingAnnotationProvider
calling getAnnotations on SessionScopedConfiguration.class. This fails
with a java.lang.ArrayStoreException due to SessionScopedConfiguration
being annotated with @ConditionalOnBean(OAuth2ClientConfiguration) and
OAuth2ClientConfiguration not being on the classpath.
DelegatingAnnotationProvider currently catches NoClassDefFoundErrors
thrown during its annotation processing. It needs to be made more
robust so that it also copes with an ArrayStoreException, in a similar
way to how org.glassfish.apf.impl.AnnotationProcessorImpl was updated to
fix GLASSFISH-21265 [1]. I’ve opened an issue to this effect [2].

In the meantime, we can work around the brittleness in
DelegatingAnnotationProvider by restructuring
SessionScopedConfiguration. This commit moves the use of @Resource into
a nested inner class, ClientContextConfiguration, while leaving the use
of @ConditionalOnBean on SessionScopedConfiguration. This means that it
is now ClientContextConfiguration that is passed to FacesListener and
processed by DelegatingAnnotationProcessor, thereby avoiding exposing
it to the @ConditionalOnBean annotation that it does not handle
gracefully. A Glassfish-based deployment test has also been added to
verify the fix.

Closes gh-2079
Closes gh-4321

[1] https://java.net/jira/browse/GLASSFISH-21265
[2] https://java.net/jira/browse/JAVASERVERFACES-4076
2015-10-28 12:18:22 +00:00
Huang YunKun 1c5e445554 Update the samples to use @WebIntegrationTest and randomPort=true
Closes gh-4294
Closes gh-4271
2015-10-27 11:56:01 +00:00
Andy Wilkinson d9d4cc2ef5 Ensure request context is setup before security filter runs
Previously, OrderedRequestContextFilter was ordered such that it
ran after Spring Security's Filter. This meant that the request
context was unavailable to any Filters in Spring Security's Filter
chain. Specifically, this caused a failure when using @EnableOAuth2Sso
as OAuth2ClientAuthenticationProcessingFilter, which is added to
Spring Security's Filter chain would be unable to use the
request-scoped bean upon which it depends.

This commit updates the order of OrderedRequestContextFilter so that
the request context is set up before Spring Security's Filter runs.
The tests for SampleGitHubApplication have been updated to use
TestRestTemplate rather than MockMvc. This is necessary as the latter,
via ServletTestExecutionListener, automatically populates the request
context holder, masking the fact that the request context filter was
setting it up too late.

Closes gh-4270
2015-10-27 10:56:55 +00:00
Andy Wilkinson 89df4946f7 Use a context-relative URL for Dev Tools sample’s CSS 2015-10-26 10:09:50 +00:00
Phillip Webb 634bb770b2 Organize imports with new settings
See gh-4234
2015-10-19 12:58:34 -07:00
Phillip Webb 1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 2015-10-19 12:56:55 -07:00
Phillip Webb a79131f8d2 Organize imports with new settings
See gh-4234
2015-10-19 12:55:44 -07:00
Spring Buildmaster 2b38a861e3 Next Development Version 2015-10-16 05:57:24 -07:00
Andy Wilkinson ac944f02cc Use a random HTTP port when running SampleLiquibaseApplicationTests 2015-10-16 12:07:56 +01:00
Andy Wilkinson 874cd3390e Fix version of parent in pom for spring-boot-sample-war 2015-10-16 10:39:58 +01:00
Phillip Webb d84889b03c Revert "Compile samples and integration tests with Java 8"
This reverts commit 09395f956a.
2015-10-16 00:01:52 -07:00
Phillip Webb 5392c0a52b Merge remote-tracking branch 'springsource/1.2.x' 2015-10-15 21:52:28 -07:00
Phillip Webb 56643222cf Add simple war sample 2015-10-15 15:31:28 -07:00
Wallace Wadge e3315d2252 Allow TraceWebFilter to trace more attributes
Update TraceWebFilter to optionally trace more details from the
HttpServletRequest/HttpServletResponse. The `management.trace.include`
property can be used to change what aspects are logged.

Closes gh-3948
2015-10-14 13:25:11 -07:00
Andy Wilkinson 995ff66eae Configure m2e to ignore reserve-network-port in Cassandra sample 2015-10-14 13:23:56 +01:00
Stephane Nicoll 01b23c886f Use random port for Cassandra tests
Closes gh-4028
2015-10-14 11:37:19 +02:00
Andy Wilkinson 8ee8c9fe90 Merge branch '1.2.x' 2015-10-12 14:12:20 +01:00
Andy Wilkinson d33d068fae Upgrade to Tomcat 8.0.28 and test support for SSL config from classpath
Prior to 8.0.28 Tomcat required the key store and trust store (if any)
to be available directly on the filesystem, i.e. classpath: resources
would not work. Tomcat 8.0.28 removed this limitation.

This commit updates to Tomcat 8.0.28, updates the tests to verify
the new Tomcat capability and removes the obsolete documentation of
the restriction.

Closes gh-4048
2015-10-12 13:36:32 +01:00
Phillip Webb aae38db9af Fix compiler warnings only shown in Eclipse Mars 2015-10-07 23:40:28 -07:00
Phillip Webb a0fc90a5ec Compile samples and integration tests with Java 8
Update the samples and integration tests to use Java 8. There's no
specific reason to keep them on Java 6 and it helps keep Eclipse happy
if we upgrade.
2015-10-07 23:40:20 -07:00
Phillip Webb c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Phillip Webb 47576354f7 Merge branch '1.2.x' 2015-10-07 23:19:50 -07:00
Phillip Webb 09395f956a Compile samples and integration tests with Java 8
Update the samples and integration tests to use Java 8. There's no
specific reason to keep them on Java 6 and it helps keep Eclipse happy
if we upgrade.
2015-10-07 19:46:11 -07:00
Andy Wilkinson cff1eea4c4 Make new configuration inner class static
See gh-4079
2015-10-05 14:35:00 +01:00
Phillip Webb c3b7764b72 Polish 2015-10-02 11:25:56 -07:00
Andy Wilkinson 2b748a7b44 Fix SampleOAuth2SsoApplicationTests
The redirect happens in two stages, first from / to /login on localhost
and then to github.com. This commit updates the test to check that the
first redirect has worked, i.e. from / to /login on localhost.
2015-10-02 16:55:00 +01:00
Dave Syer 67a70571de Add simple SSO sample with github authentication 2015-10-02 14:13:15 +01:00
Stephane Nicoll b2c3e7e2ed Rename error.* properties to server.error.*
Closes gh-4050
2015-10-02 14:03:24 +02:00
Dave Syer c8ec2cb70b Add missing annotation to openTSDB sample 2015-09-28 13:54:50 +01:00
Phillip Webb 31f0c837fd Fix broken Cassandra sample tests
See gh-2064
2015-09-26 01:16:06 -07:00
Julien Dubois c401330901 Add Cassandra support
Add auto-configuration support and health checks for Cassandra and
Spring Data Cassandra.

Fixes gh-2064
Closes gh-2214
2015-09-25 23:00:53 -07:00
Ivan Chen 926b40e46c Delete duplicate application.properties
Closes gh-4004
2015-09-23 21:29:28 -07:00
Phillip Webb d22d0683b2 Fixup build following release 2015-09-16 12:03:23 -04:00
Spring Buildmaster 9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Phillip Webb 3444ebbc05 Merge branch '1.2.x' 2015-09-11 13:50:56 -07:00
Phillip Webb 5f250ebbc1 Add exception endpoints to tomcat-jsp sample
Update `spring-boot-sample-tomcat-jsp` to include endpoints that trigger
exceptions. Primarily to aid testing of the ErrorPageFilter.

See gh-2745
2015-09-11 12:25:48 -07:00
Stephane Nicoll 0d2797ddd5 Polish contribution
Closes gh-3936
2015-09-11 16:23:38 +02:00
Eddú Meléndez 591f016e90 Expose actuator endpoints for flyway and liquibase
Update the samples to expose the relevant actuator endpoint.

Closes gh-3935
2015-09-11 16:22:45 +02:00
Phillip Webb 3174f898c6 Fix failing logback test
See gh-3924
2015-09-10 15:18:11 -07:00
Phillip Webb d09805fd75 Polish license headers 2015-09-08 16:05:05 -07:00
Phillip Webb 1983b43830 Polish POM descriptions 2015-09-08 16:05:01 -07:00
Phillip Webb 67402405db Reformat code 2015-09-08 14:56:40 -07:00
Phillip Webb 2615990ffb Organize imports 2015-09-08 14:40:35 -07:00
Phillip Webb 0335053139 Merge branch '1.2.x' 2015-09-08 14:37:16 -07:00
Phillip Webb 15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb 0f6b60d8c8 Organize imports 2015-09-08 14:05:00 -07:00
Phillip Webb 026c3019df Polish 2015-09-08 13:37:28 -07:00
Stephane Nicoll f7a1db8e25 Polish 2015-09-08 16:17:04 +02:00
Stephane Nicoll 5453f7c59c Fix broken build
Commit c85f4df0ee broke the build as some tests are expecting HSQL to be
used. We now specify the name of the database rather than specifying the
jdbc url.
2015-09-08 16:16:13 +02:00
Stephane Nicoll c85f4df0ee Polish
Upgrade sample to use H2 and expose the web console by default.
2015-09-08 10:20:46 +02:00
Phillip Webb f4dcef281c Merge branch '1.2.x' 2015-09-03 11:30:08 -07:00
Phillip Webb feb2452f06 Simplify WebApplicationContext class guard
See gh-3856
2015-09-03 10:33:53 -07:00
Phillip Webb 6193b640a4 Polish 2015-09-02 23:44:19 -07:00
herau c379caadef Fix sample links
Closes gh-3844
2015-08-28 16:38:15 +02:00
Dave Syer ff681adc5b Fix launch.script to not exit prematurely
Use "return" instead of "exit" where possible, especially in
function definitions.

Also fixed the exit codes to match the LSB spec for some specific
conditions (fixes gh-3521).

Fixes gh-3199, fixes gh-3535
2015-08-26 17:54:20 +01:00
Stephane Nicoll 63d157bb7c Favor JSR-107 provider if present
Previously, native cache libraries were favored over a standard JSR-107
implementation. If a user has a working setup using JCache with one
provider and switch to another provider, his setup may be broken if we
happen to provide a native support for the new provider.

We now consistently favor JSR-107 if it is present. Native support can
still be enabled via the `spring.cache.type` property.

Closes gh-3822
2015-08-25 15:07:24 +02:00
Stephane Nicoll 1dfa1fc3a5 Polish
Closes gh-3800
2015-08-22 08:41:40 +02:00
Huang YunKun 3b81152ddc Fix springloaded version
Closes gh-3807
2015-08-22 08:41:30 +02:00
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
2015-08-19 17:09:34 +02:00
Andy Wilkinson 25709385e6 Update Hypermedia samples following /hal and /links being combined
See gh-3696
2015-08-10 14:21:22 +01:00
Stephane Nicoll 7bc5322034 Merge branch '1.2.x' 2015-08-09 09:04:17 +02:00
Thomas Traude 2b6d7a3f15 Update URL to Groovy Docs
Closes gh-3715
2015-08-09 09:03:54 +02:00
Phillip Webb 28f32da74f Don't user root path for HAL endpoints
Update LinksMvcEndpoint and HalBrowserMvcEndpoint so that no longer try
to use the `/` context path. Links are now available from `/links` and
the HAL browser is available from `/hal`.

The actuator HAL browser now works with either WebJars or the Spring
Data version. It also now transforms the initial HTML so that the
form is pre-populated with `/links`.

When using Spring Data's HAL browser, the root includes a link to
`/links` with a rel of `actuator`.

See gh-3621
2015-08-06 00:29:00 -07:00
Vladimir Tsanev 632d78b6fb Prettify Log4J 2's default output
This commit updates the default output produced when using Log2J 2 to
be similar to the output produced by Logback. It introduces a new
converter for throwables that adds some whitespace around stacktraces
and a color converter that produces ANSI-colored output when enabled
via spring.output.ansi.enabled.

Closes gh-3548
2015-08-05 15:09:27 +01:00
Stephane Nicoll 6c7a5c5077 Harmonize Undertow's access log properties
Harmonize the configuration properties for Undertow to match the changes
made for gh-2491.

Move `spring.undertow.accessLog*` to `spring.undertow.accesslog.*`
2015-08-05 14:34:48 +02:00
Stephane Nicoll bfe930a873 Auto-configure @EnableConfigurationProperties
Add an auto-configuration that avoid a Spring Boot user to add
`@EnableConfigurationProperties` to its configuration to benefit from
that feature.

As our own auto-configurations are tested independently, such annotation
is still present to avoid a useless reference to this new
auto-configuration.

Closes gh-2457
2015-08-04 13:59:57 +02:00
Phillip Webb 891dd5a0f6 Polish 2015-08-03 11:03:48 -07:00
Stephane Nicoll 7c3cdead28 Remove unnecessary mainClassName
Since each sample has (supposedly) only one application class and not
a lot of the code, the `mainClassName` attribute in the gradle build is
not really useful and can lead to inconsistency if the application class
is moved.

See gh-3588
2015-07-23 17:36:41 +02:00
Justin Garrick 8960b88020 Fix package name of web-ui sample
Closes gh-3588
2015-07-23 17:26:48 +02:00
Stephane Nicoll 80754d5cc2 Polish
Closes gh-3534
2015-07-23 11:46:32 +02:00
Lucas Saldanha bf303b02f7 Add configuration properties validation sample
Create a new project sample that demonstrate the usage of
@ConfigurationProperties with configurationPropertiesValidator.

Fixes gh-3513
2015-07-23 11:42:55 +02:00
Stephane Nicoll e1479a02b7 polish
Use canonical version for the management's context path.
2015-07-20 10:33:12 +02:00
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
2015-07-16 17:29:20 -07:00
Phillip Webb 728e64b929 Polish 2015-07-16 12:56:49 -07:00
Andy Wilkinson 2c81907d58 Flesh out and polish Embedded MongoDB auto-configuration contribution
Embedded MongoDB is now auto-configured when it is on the classpath.
The Mongo instance will listen on the port specified by the
spring.data.mongodb.port property. If this property has a value of
zero and randomly allocated port will be used. In such an event, the
MongoClient created by MongoAutoConfiguration will be automatically
configured to use the port that was allocated.

By default, MongoDB 2.6.10 will be used. This can be configured using
the spring.embedded-mongodb.version property. Mongo's sync delay
feature is enabled by default. This can be configured using the
spring.embedded-mongobd.features property.

Closes gh-2002
2015-07-16 16:34:18 +01:00
izeye f4589e7cc3 Fix typos
Closes gh-3504
2015-07-15 15:45:02 +02:00
Dave Syer de95012635 Workaround problems with order of endpoint handler mapping
When Spring Data REST is owning the home page it has its own
HandlerMapping with a fix (relatively) low priority. The /links
endpoint wants to own the home page as well, and our handler mapping
has a high priority for good reasons. This change addresses the
issue by checking if Spring Data REST is configured and if
the management context path (or  more specifically, the links
endpoint) is the same as the home page.

Fixes gh-3486
2015-07-15 11:45:25 +01:00
Phillip Webb 3b6a37d44b Remove accidentally committed .gitignore files 2015-07-13 13:25:00 -07:00
Phillip Webb 73be2c056f Clear logback status list on reset
Update LogbackLoggingSystem to clear logback status messages on reset.
This prevents shutdown errors from preventing subsequent startup.

Fixes gh-3472
2015-07-13 13:22:51 -07:00
Dave Syer e5d3fa0c6c Merge remote-tracking branch '1.2.x' 2015-07-13 15:43:40 +01:00
Dave Syer d0cf6b534b Add 3xx redirects to the "unmapped" class of requests for metrics
When Spring Security sends 302 responses to a login page we don't get
any information about the request matching in Spring MVC. Consequently
apps can end up with a lot of counter.status.302.* metrics (where
"*" can be whatever the user sent).

This change treats 3xx the same as 4xx (if it is unmapped it just gets
added to a metric called "unmapped" instead of using the actual request
path).

Fixes gh-2563
2015-07-13 13:33:30 +01:00
Spring Buildmaster 57f26c6bfc Next development version 2015-07-09 17:30:48 -07:00
Phillip Webb 5938c967a3 Polish 2015-07-08 14:10:05 -07:00
Stephane Nicoll a073a505ae Move spring.oauth2.* to security.oauth2.*
Unfortunately, we have no other choice to flip the ignoreUnknownFields
attribute of `SecurityProperties` has many different target are now set
for that namespace outside the class. See gh-3445 for a potential way
to improve that.

Closes gh-3327
2015-07-08 18:26:25 +02:00
Dave Syer c71196b92d Better segregation of export and redis keys 2015-07-08 15:52:50 +01:00
Phillip Webb e885dab752 Polish 2015-07-07 15:17:03 -07:00
Dave Syer 4581c5a273 Rationalize AMQP sample 2015-07-07 17:13:56 +01:00
Phillip Webb e8085016ba Polish Actuator hypermedia support 2015-07-05 22:28:04 -07:00
Dave Syer 74e9e0749b Add support for Spring HATEOAS hypermedia in Actuator endpoints
If spring-hateoas is on the classpath and an MvcEndpoint returns a
@ResponseBody it will be extended and wrapped into a Resource with links.
All the existing endpoints that return sensible JSON data can be extended
this way (i.e. not /logfile). The HAL browser will also be added as an
endpoint if available on the classpath. Finally, asciidocs for the
Actuator endpoints are available as a separate jar file, which if
included in an app will also generate a new (HTTP) endpoint.

Fixes gh-1390
2015-07-02 13:26:02 +01:00
Phillip Webb 43dc0c64c2 Fixup version numbers following release 2015-07-01 23:22:34 -07:00
Spring Buildmaster 7ce391db4f Next development version 2015-07-01 22:48:01 -07:00
Phillip Webb c84658af1b Remove unused .gitignore files 2015-06-30 22:09:00 -07:00
Dave Syer 1e464da248 Refactor the Actuator MVC configuration to allow more customization
There is a new spring.factories entry for
org.springframework.boot.actuate.autoconfigure.EndpointWebMvcConfiguration
which loads extra beans into the MVC config for the Actuator.
If the management context is a child context all the beans go in the
child (except the Spring Security filter still). A big bonus is that
you can add WebConfigurerAdapters to configure static resources etc.
A new component called ManagementContextResolver can be used to
locate the ApplicationContext for the MVC endpoints.

Fixes gh-3345
2015-06-30 09:42:58 +01:00
Matt Benson 183a2095f4 Fixup sample Ant build
Fixes gh-3324
2015-06-30 00:54:53 -07:00
Phillip Webb da82f08692 Create Apache Ant sample
See gh-3339
2015-06-30 00:30:33 -07:00
Phillip Webb d213cc05d5 Polish 2015-06-29 16:48:59 -07:00
Ivan Sopov a09a29be44 Add sample for Jetty 9.3
Closes gh-3325
2015-06-29 15:59:29 +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
Rob Baily 3c50386970 Fix logout in sample secure web applications
Fixes gh-1536
2015-06-26 16:44:04 -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
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
Phillip Webb 61fc4f3f12 Polish copyright headers 2015-06-23 10:22:14 -07:00
Andy Wilkinson 0bb0f32c88 Reinstate code in Data REST sample that went AWOL in 1ce617f1 2015-06-23 14:44:43 +01:00
Phillip Webb 1ce617f1ae Polish sample package names 2015-06-23 00:47:12 -07:00
Phillip Webb c13ff96b78 Fix misnamed jOOQ sample module 2015-06-22 22:12:28 -07:00
Phillip Webb ab1cc829c1 Add jOOQ sample application
See gh-2804
2015-06-22 21:20:12 -07:00
Andy Wilkinson fd6d61e8b4 Add auto-configuration support for Spring Session
This commit adds support for automatically configuring Spring Session.
In a web application when both Spring Session and Spring Data Redis
are on the classpath, Spring Session's Redis Http Session support
will be auto-configured. The max inactive interval for Redis-backed
sessions can be configured via the environment using the existing
server.session-timeout property.

Closes gh-2318
2015-06-18 14:52:59 +01:00
Stephane Nicoll be5e30b409 Migrate spring.view properties
Migrate `spring.view.prefix` and `spring.view.suffix` to
`spring.mvc.view.prefix` and `spring.mvc.view.suffix` respectively. The
former properties are still handled in a backward compatible way and are
defined as deprecated in the meta-data.

Closes gh-3250
2015-06-18 13:55:44 +02:00
Phillip Webb 6b92160295 Enforce Java 8 for compiling 2015-06-11 22:45:56 -07:00
Phillip Webb dc071fa246 Restore remote support in devtools-sample 2015-06-11 21:46:38 -07:00
Phillip Webb b57802190d Polish 2015-06-10 13:09:41 -07:00