Commit Graph

733 Commits

Author SHA1 Message Date
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
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
2015-06-08 23:46:24 -07:00
Phillip Webb
d0349879c3 Allow custom restart pollInterval and quietPeriod
Allow the pollInterval and the quietPeriod of the filewatcher to be
configured.

Fixes gh-3139
2015-06-08 22:51:50 -07:00
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
2015-06-08 22:14:48 -07:00
Eddú Meléndez
baca62a6c0 Fix typos 2015-06-05 16:59:51 +02:00
Phillip Webb
983484f429 Rename spring-boot-developer-tools -> devtools
Fixes gh-3099
2015-06-04 13:50:56 -07:00
Stephane Nicoll
b847b6fa4b Fixup version numbers following release 2015-06-04 10:34:44 +02:00
Phillip Webb
09a29a7207 Polish OAuth SSO 2015-06-04 00:56:12 -07:00
Phillip Webb
31d6a0f17a Polish updated metrics code 2015-06-04 00:56:00 -07:00
Phillip Webb
d2f11c465e Polish cache code 2015-06-04 00:55:38 -07:00
Phillip Webb
412b7b9e50 Polish 2015-06-04 00:55:30 -07:00
Spring Buildmaster
5d81c87b43 Next Development Version 2015-06-04 00:49:11 -07:00
Stephane Nicoll
fca192fa41 Add spring-boot-starter-cache
Closes gh-3098
2015-06-03 17:29:57 +02:00
Phillip Webb
49c4710f63 Merge branch '1.2.x' 2015-06-02 12:32:46 -07:00
Phillip Webb
968b68c322 Polish 2015-06-02 11:17:16 -07:00
Phillip Webb
67cc9d007f Add a spring-boot-developer-tools sample
Add a sample application that demonstrates how the
`spring-boot-developer-tools` module can be used.

Closes gh-3082
2015-06-01 21:27:35 -07:00
Stephane Nicoll
18d7634947 Add basic cache metrics support for Infinispan
Closes gh-3066
2015-06-01 17:41:59 +02:00
Stephane Nicoll
eef027a4f0 Polish cache sample
Update single cache sample with all supported cache providers. Add README
to shortly explain how to get started with them.

See gh-2633
2015-06-01 11:49:31 +02:00
Eddú Meléndez
23a278451a Add cache sample
See gh-2633
2015-06-01 11:49:14 +02:00
Dave Syer
8a83bd12bd Refactor annotations for metric export
Users can add @ExportMetric[Reader,Writer] to readers and writers that
they want to participate in the default exporter. There is also still an
@ActuatorMetricWriter that is used for the legacy (non-Java8) Gauge and
CounterServices.
2015-05-31 12:51:07 +01:00
Dave Syer
80ff92919c Add redis properties as convenience in spring.metrics.export
The redis export and aggregate use case is a lot nicer with this
shared data between the two component types.

Also made MetricExportProperties itself a Trigger (so the default
delay etc. can be configured via spring.metrics.export.*).
2015-05-31 12:18:43 +01:00
Alexander Heusingfeld
04776232f7 Allow auto-reload of log4j2 config
Log4j2 can auto-reload its configuration file as long as the reference
to a `java.io.File` is provided in the `ConfigurationSource`. Previously,
we always created such `ConfigurationSource` with only the URL regardless
of its type.

Detect when the configuration URL points to a File and create the
`ConfigurationSource` accordingly.

The `spring-boot-sample-actuator-log4j2` has been updated to reload the
logging configuration every 30 sec if necessary.

Fixes gh-3024, gh-3030
2015-05-28 11:24:25 +02:00
Dave Syer
c5dc3f564b Add @EnableOAuth2Sso and spring.oauth2.sso.*
User can enable OAuth2 SSO by declaring the intent (@EnableOAuth2Sso)
and also configuring the client properties (spring.oauth2.client.*).
The spring.oauth2.sso.* are only needed to change the path for the
login (defaults to /login) - any other security configuration for the
protected resources can be added in a WebSecurityConfigurerAdapter
which carries the @EnableOAuth2Sso annotation.
2015-05-26 07:23:26 +01:00
Dave Syer
af320b49bf Rationalize some features and merge in customizers from Spring Cloud 2015-05-26 06:34:43 +01:00
Greg Turnquist
53f67a448f Auto-configure Spring Security OAuth2 when detected on the classpath
* Automatically spin up Authorization Server and Resource Server
* Automatically configures method level security included OAuth2Expression handler
* Wrote extensive unit tests verifying default behavior as well as the auto-configuration backing off when custom Authorization/Resource servers are included
* Created org.springframework.boot.security.oauth2 subpackage to contain it
* Can also disable either resource of authorization server completely with a single property for each
* Print out the auto-generated secrets and other settings
* Added spring-boot-sample-secure-oauth2 to provide a sample that can be run and poked with curl as well as some automated tests.
* Make users ask for which servers to install by adding @Enable*
* User has to @EnableGlobalMethodSecurity instead of using properties files

Add Spring Security OAuth2 support to Spring Boot CLI

* Triggered from either @EnableAuthorizationServer or @EnableResourceServer
* Needs to have @EnableGlobalMethodSecurity to allow picking the annotation model.
* By default, comes with import support for @PreAuthorize, @PreFilter, @PostAuthorize, and @PostFilter via a single start import
* Also need import support for the enable annotations mentioned above.
* Added extra test case and sample (oauth2.groovy)
2015-05-26 06:34:43 +01:00
Andy Wilkinson
95f31b0d30 Polish Undertow access logs contribution
- Apply project’s code formatting and conventions
 - Don’t use the IO and worker thread configuration when creating the
   worker for the AccessLogReceiver. The IO and worker thread
   configuration is for HTTP request processing and a worker in its
   default configuration should be sufficient for the access log
   receiver.
 - Don’t use a temporary directory as the default for the access log
   directory. A temporary directory makes (some) sense for Tomcat as it
   requires a directory for its basedir. Undertow has no such
   requirement and using a temporary directory makes it hard to locate
   the logs. The default has been updated to a directory named logs,
   created in the current working directory.
 - Document the new properties in the application properties appendix

Closes gh-3014
2015-05-20 11:02:49 +01:00
Marcos Barbero
90e43737bb Add support for configuring Undertow's access log via the environment
This commit adds support for configuring Undertow's access log via the
environment using the following properties:

server.undertow.access-log-enabled
server.undertow.access-log-pattern
server.undertow.access-log-dir

See gh-3014
2015-05-20 10:50:15 +01:00
Dave Syer
64af3272a1 Extract metric export into a separate autoconfig class
This avoids a potential problems with ordering between Dropwizard and
normal repository configuration. A Dropwizard sample has been added to
verify the behaviour.
2015-05-13 13:56:03 +01:00
Dave Syer
7be13b28bd Add tests for new features 2015-05-13 13:56:03 +01:00
Dave Syer
270d5e3205 Add @ActuatorMetricRepository to qualify the "native" repository
Primarily when it is needed for metric export.
2015-05-13 13:56:02 +01:00
Dave Syer
0ce72105b9 Add JMX to Redis sample 2015-05-13 13:56:02 +01:00
Dave Syer
3fda744522 Add samples and tweak metrics reader/writers till they work 2015-05-13 13:56:02 +01:00
Dave Syer
60a4943520 Add support for metric export to OpenTSDB 2015-05-13 13:56:02 +01:00
Dave Syer
18928a62df Add sample for Redis metric exporter 2015-05-13 13:56:02 +01:00
Andy Wilkinson
681894a1f3 Start building against Spring Integration 4.2.0 snapshots
See gh-2883
2015-04-27 13:44:17 +01:00
Andy Wilkinson
6847608308 Merge branch '1.2.x'
In addition to the changes already made in 1.2.x, this commit updates
the tests in spring-boot-actuator to ensure that any Elasticsearch
data files are written into the target directory. This avoids problems
when switching branches caused by different versions of Elasticsearch
trying to read the files.
2015-04-21 15:08:02 +01:00
Andy Wilkinson
dabbb02dfe Prevents tests that use Elasticsearch from polluting the filesystem
By default, Elasticsearch writes it data to ./data. This led to data
being left on the filesystem after a mvn clean which could cause
failures when moving between branches that use different versions of
Elasticsearch.

This commit updates the tests for the Elasticsearch sample and
the Elasticsearch auto-configuration classes to write the
Elasticsearch data and logs into the target directory.
2015-04-21 14:53:43 +01:00
Andy Wilkinson
4452bb1873 Revert "Upgrade Gradle plugin’s ID so it’s suitable for the Plugin Portal"
This reverts commit b1c0a7cda4.

The plugin publishing process has moved to a new plugin-based approach
that brings with it some significant limitations:

 - There's no staging to allow the promotion of good release builds
 - There's no easy way to upload an existing artifact
 - There's no control over the published pom.

The risk brought by these limitations, particularly the first, are
too great so we will no be publishing the Boot plugin to the Portal
until they're resolved.

Changing the plugin's ID was a breaking change that would require
users to do some work when they upgrade to Boot 1.3. The ID of the
plugin was changed purely so that it met the Portal's requirements.
Given that the plugin will not be published to the Portal for the
foreseaable future there's no need for us to inflict a breaking change
on people when there will be no benefit.

See gh-1567
2015-04-21 12:37:12 +01:00
Andy Wilkinson
2085a5b0cf Work around the behaviour change in latest Spring 4.2 snapshots
The changes made in spring-projects/spring-framework@e403aefe cause
SampleTomcatTwoConnectorsApplication to fail to launch. The port bean,
typed as an int, is coerced into an Integer when the bean’s created. The
port() method is then called, and the proxy’s bean method interceptor
complains as it’s expecting the port bean to be an int but it’s actually
an Integer. Changing the port() bean method’s return type to Integer
works around the problem.
2015-04-16 11:00:12 +01:00
Andy Wilkinson
d13878e193 Upgrade to Spring Data Fowler RELEASE
The versions in the dependency management for the various datastore
dependencies have been aligned with those used by Spring Data Fowler.

The Data REST tests and sample application has been updated to configure
the base path in favour of the deprecated base uri property

Closes gh-2673
2015-04-09 12:20:45 +01:00
Andy Wilkinson
8b1022effa Upgrade to Spring Batch 3.0.4 snapshots
Closes gh-2712
2015-04-07 18:47:28 +01:00
Phillip Webb
42e69359a8 Fixup version numbers following release 2015-03-30 23:25:03 -07:00
Spring Buildmaster
e03c11dda8 Next development version 2015-03-30 22:56:20 -07:00
Andy Wilkinson
bc99ad2120 Ignore Batch tests that use JDBC as they don’t work with Spring 4.2
Spring Framework’s ParamterizedRowMapper has been deprecated since
3.1 and has been removed in 4.2. Spring Batch currently relies on
ParameterizedRowMapper, making it incompatible with 4.2. To allow us to
build successfully against 4.2, this commit ignores Spring Boot’s tests
that use Spring Batch’s JDBC support.

See gh-2575
2015-03-25 10:48:00 +00:00
Phillip Webb
53ca15b478 Polish spring-boot-sample-activemq 2015-03-23 09:50:25 -07:00
Stephane Nicoll
6488659d40 Add link to activemq sample. 2015-03-20 08:40:31 +01:00
Andy Wilkinson
b1c0a7cda4 Upgrade Gradle plugin’s ID so it’s suitable for the Plugin Portal
Gradle’s plugin portal requires each plugin’s ID to be in a namespace.
Our existing ID, spring-boot, does not meet this requirement. This
commit changes the plugin’s ID to org.springframework.boot.spring-boot.
Note that, as is recommended [1], the plugin’s ID does not include
“gradle”.

See gh-1567

[1] http://plugins.gradle.org/submit
2015-03-19 14:25:07 +00:00
Andy Wilkinson
cb067ee00c Align expectations with Spring Data REST’s new behaviour in Fowler
The response produced by Spring Data REST to a search that will always
return a single result, i.e. the return type is Foo rather than
List<Foo> or Page<Foo> has improved in Fowler. Previously, the response
would contain a single embedded resource. In Fowler, the response now
contains the resource that used to be embedded as a top-level resource.
This commit updates the expectations in one of the sample’s tests to
match this new behaviour.

See gh-2673
2015-03-18 16:16:58 +00:00
Dave Syer
2105be2358 Merge branch '1.2.x' 2015-03-17 16:29:59 +00:00
Dave Syer
c153c4e517 Make tomcat provided in a war sample 2015-03-17 16:28:22 +00:00
Eddú Meléndez
3bd1ec680e add spring-boot-sample-activemq 2015-03-17 11:10:26 +01:00
Phillip Webb
0174476ff1 Merge branch '1.1.x' into 1.2.x 2015-03-02 12:12:57 -08:00
Phillip Webb
50e1f80581 Remove .factorypath files 2015-03-02 12:12:06 -08:00
Phillip Webb
561ed99b5b Merge branch '1.1.x' into 1.2.x 2015-03-02 12:09:24 -08:00
Phillip Webb
3048f44a96 Move master to 1.3.0.BUILD-SNAPSHOT 2015-02-26 21:06:35 -08:00
Phillip Webb
a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 2015-02-26 17:01:02 -08:00
Phillip Webb
8ce39bda88 Fixup version numbers following release 2015-02-26 15:59:57 -08:00
Spring Buildmaster
8f0ad02237 Next development version 2015-02-26 15:26:53 -08:00
Phillip Webb
8a49218e82 Fixup version numbers following release 2015-02-26 14:17:25 -08:00
Spring Buildmaster
aea68f0c32 Next development version 2015-02-26 13:01:31 -08:00
Phillip Webb
a1cbd93d6b Ensure local Elasticsearch nodes are closed
Update ElasticsearchAutoConfiguration to ensure that local nodes are
closed when the context is closed. Prior to this commit the close()
method of the Client would be called which had no effect for local
Nodes.

Fixes gh-2480
2015-02-24 14:18:51 -08:00
Phillip Webb
4cac9d7382 Ensure actuator works without Spring MVC
Update MetricFilterAutoConfiguration to ensure that it is only applied
if Spring MVC is on the classpath.

Fixes gh-2542
2015-02-24 13:08:42 -08:00
Phillip Webb
8e594c790e Fix eclipse errors and warnings
Fix some eclipse errors and warnings caused by XSD validation errors and
classes in the wrong place.
2015-02-24 12:44:19 -08:00
Andy Wilkinson
17fd3d44b7 Add workaround for Undertow WebSocket client sending illegal Origin
Undertow’s WebSocket client sends an illegal Origin header – it does
not include the scheme, e.g. it’ll send “localhost” rather than
“http://localhost”. This commit works around the problem by allowing
access to the SockJS endpoints from any origin, thereby disabling
OriginHandlerInterceptor’s checking of the Origin header.
2015-02-19 14:30:23 +00:00
Andy Wilkinson
d87bf707a7 Merge branch '1.1.x' 2015-02-17 10:01:39 +00:00
Phillip Webb
636898f9ad Polish 2015-02-09 11:39:48 -08:00
Stephane Nicoll
dfdb801533 Fix use of deprecated API. 2015-02-02 11:34:49 +01:00
Andy Wilkinson
c9186c45a2 Merge branch '1.1.x' 2015-01-29 13:39:16 +00:00
Andy Wilkinson
c346e996ed Ignore temporary .writing files when finding output files
Spring Integration's FileWritingMessageHandler uses a .writing file
while it's in the process of writing a message to disk and then
performs a rename (depending on the OS and filesystem this may or may
not be atommic) to create the .msg file. Prior to this commit the
test was finding the temporary .writing files and examining them. This
could lead to a FileNotFoundException being thrown as the temporary
file was deleted while the test was trying to read its contents.

This commit updates the test to only look for files with a .msg suffix

Fixes gh-2428
2015-01-29 13:32:01 +00:00
Andy Wilkinson
8e8bf8e177 Uses the latest version of Tomcat 7 in the sample 2015-01-26 14:38:30 +00:00
Andy Wilkinson
01344c8617 Add a starter for building a RESTful service with Spring HATEOAS
Closes gh-2396
2015-01-22 15:22:50 +00:00
Andy Wilkinson
f0421801fb Update spring-boot-sample-tomcat-jsp to use Tomcat 8
Closes gh-2394
2015-01-22 11:09:19 +00:00
Andy Wilkinson
247c596f8c Remove duplicate console appender from Actuator sample's logback config
Closes gh-2381
2015-01-20 11:44:23 +00:00
Andy Wilkinson
1d312171c1 Merge branch '1.1.x' 2015-01-20 09:50:47 +00:00
Andy Wilkinson
f10c9b5312 Avoid race between file creation and its contents being written
Previously, SampleIntegrationParentApplicationTests assumed that when
an output file existed on disk its contents would have been written
in their entirety. This assumption does not hold true and causes the
test to fail intermittently as it incorrectly determines that the test
has produced no output.

This commit updates the test to wait for up to 30 seconds for the
output files to appear on disk and for the expected content to be
found in one of those files. If the files exist but do not
contain the expected content the test will keep trying until it does
or until too much time as elapsed.

Fixes gh-2380
2015-01-20 09:50:35 +00:00
Andy Wilkinson
e19bfd9251 Document how to use Tomcat 7 or Jetty 8 with Gradle
Previously, the documentation only provided examples of the required
configuration for Maven users. This commit adds equivalent configuration
snippets for those using Gradle. It also removes the recommendation to
override the version of the Servlet API as this is unnecessary. The pom
files for the Jetty 8 and Tomcat 7 samples have also been updated
accordingly.

Closes gh-2346
2015-01-19 14:20:30 +00:00
Andy Wilkinson
ff2d423fcb Correct the root context path used with Undertow
Undertow, like Tomcat, uses "" for the context path of the root
context. Previously, the Undertow deployment was being configured with
"/" for the root context. This was leading to a silent failure in
AsyncContextImpl.dispatch when it failed to look up the deployment
manager for the current request.

This commit updates UndertowEmbeddedServletContainerFactory to use the
correct context path (an empty String) for the root context.

Fixes gh-2365
2015-01-16 13:38:13 +00:00
Andy Wilkinson
492cf4ef54 Add jersey-bean-validation to spring-boot-starter-jersey
A dependency on org.glassfish.jersey.ext:jersey-bean-validation has
been added to spring-boot-starter-jersey. jersey-bean-validation’s EL
dependencies have been excluded in favour of those provided by
spring-boot-starter-tomcat (or starter-jetty or starter-undertow should
the user choose to use a different embedded container).

Closes gh-2315
2015-01-15 09:50:05 +00:00
Phillip Webb
43d577aa4c Add Atmosphere sample application
Add Atmosphere example application based on
http://github.com/Atmosphere/atmosphere-samples/tree/master/samples/chat

Closes gh-2341
2015-01-13 15:42:14 -08:00
izeye
4e109caf5c Fix copy/paste errors
Closes gh-2323
2015-01-12 10:10:10 +01:00
Dave Syer
2729c747ca Add jmustache support
The package names changed a bit from the prototype project, but wuth vanilla
autconfiguration usage that shouldn't matter. Follows closely the Groovy
templates support. Templates live in classpath:/templates/*.html by default.

Fixes gh-2242
2015-01-09 13:50:39 +00:00
Phillip Webb
9dd4d43cec Fixup version numbers following release 2015-01-08 00:19:04 -08:00
Spring Buildmaster
60725cd8bd Next development version 2015-01-07 23:37:07 -08:00
Phillip Webb
978cf8c2e6 Polish @WebIntegrationTest support
See gh-2299
2015-01-07 14:07:28 -08:00
Phillip Webb
f9c3baed33 Add TestNG sample application
Add a TestNG sample that also demonstrates @WebIntegrationTest.

See gh-2135
2015-01-06 21:03:56 -08:00
Phillip Webb
98135c964b Remove Principal handler logic from security
Update ManagementSecurityAutoConfiguration so that MVC Endpoints that
have Principal arguments are not treated in any special way. This
restores Spring Boot 1.1.x behavior where the 'sensitive' flag is used
to determine access rules.

The HealthMvcEndpoint still uses the Principal (when available) to
determine if full status information can be displayed. It now also
explicitly checks the environment for `endpoints.health.sensitive`
to determine if the user has opted-out and requires complete health
details.

The health MVC endpoint should now work as follows:

* Default configuration - No login is required, full information is only
  displayed if a Principal is available.
* endpoints.health.sensitive=true - Login is required, full information
  is displayed.
* endpoints.health.sensitive=false - Login is not required, full
  information is displayed.

Fixes gh-2211
2014-12-25 12:42:45 -08:00
Phillip Webb
ea84479e9a Fix HATEOAS sample application version number 2014-12-22 20:29:18 -08:00
Phillip Webb
4ed42aac37 Merge branch '1.1.x' 2014-12-22 20:29:11 -08:00
Phillip Webb
7d017a2a6b Add HATEOAS sample application 2014-12-22 20:28:15 -08:00
Phillip Webb
425f989a26 Polish velocity sample POM name 2014-12-19 16:06:31 -08:00
Phillip Webb
5afd0b4858 Polish sample POM names 2014-12-19 15:59:44 -08:00
Phillip Webb
8fd99bde8b Update samples to use specific log configuration 2014-12-17 11:33:29 -08:00
Phillip Webb
a6adeab319 Fixup version numbers following release 2014-12-10 19:50:05 -08:00
Phillip Webb
43fb5b63a8 Fixup version numbers following release 2014-12-10 19:49:23 -08:00
Spring Buildmaster
63e6a25097 Next development version 2014-12-10 18:06:30 -08:00
Spring Buildmaster
1a788c1741 Next development version 2014-12-10 16:35:50 -08:00
Phillip Webb
a69afa0dca Support ServletContextListener with Jetty 9
Call `context.getServletContext().setExtendedListenerTypes(true)` to
ensure that ServletContextListeners can be registered with Jetty 9.

Fixes gh-2058
2014-12-09 09:20:55 -08:00
Phillip Webb
6e0f1f3d98 Use wesocket dependency from Undertow starter 2014-12-08 08:45:41 -08:00
Dave Syer
79aa6e7713 Add undertow websockets dependency 2014-12-08 09:20:24 +00:00
Phillip Webb
c22aee9817 Polish WebSocket samples 2014-12-03 16:23:15 -08:00
Phillip Webb
8928012943 Add Undertow WebSocket sample application
See gh-2028
2014-12-03 15:41:36 -08:00
Phillip Webb
5f2b60eff2 Polish POM 2014-12-03 14:19:08 -08:00
Phillip Webb
48db5457f1 Polish 2014-12-01 19:32:05 -08:00
Dave Syer
998c29c4aa Add java.version to Tomcat WAR projects 2014-12-01 13:40:53 +00:00
Dave Syer
3c1e48c89a Better handling of anonymously accessible endpoints
Shares the /health endpoint request mapping between security config
and MVC dispatcher. Generalizes so that instead of a marker
interface (AnonymouslyAccessibleMvcEndpoint), an MvcEndpoint
signals that it wants to control its own access rules by adding
a Principal to the @RequestMapping method parameters (more @MVC).

Fixes gh-2015 slightly differently
2014-11-28 06:33:30 +00:00
Andy Wilkinson
2ce057ca96 Allow /health to be accessed anonymously irresepctive of its sensitivity
The changes in 3bb598a overload the health endpoint's sensitive
property such that it's now considered sensitive if management
security is enabled. When an endpoint is sensitive anonymous
access is prevented. This breaks the health endpoint which should
return a filtered view of the server's health when it's accessed
anonymously rather than rejecting the request.

This commit introduces AnonymouslyAccessibleMvcEndpoint, a marker
extension of the MvcEndpoint interface. It is implemented by
HealthMvcEndpoint. ManagementSecurityAutoConfiguration has been
updated to allow anonymous access to endpoints that aren't sensitive
or that implement AnonymouslyAccessibleMvcEndpoint.

Fixes gh-2015
2014-11-27 14:51:57 +00:00
Andy Wilkinson
6d97785030 Add a plain JPA sample application
Closes gh-1761
2014-11-25 10:23:32 +00:00
Andy Wilkinson
5b671847d3 Merge branch '1.1.x' 2014-11-24 10:56:31 +00:00
Andy Wilkinson
ccbc606dad Use relative paths so index is unaffected by its context path
Previously, index.html used absolute paths to load its CSS and
JavaScript. This meant that it had to be deployed to /. This commit
updates the HTML to use relative paths for its CSS and JavaScript,
thereby ensuring that they can be loaded irrespective of the context
path to which the application is deployed.

Closes gh-1988
2014-11-24 10:55:37 +00:00
Dave Syer
f21d58ada7 Use constructor injection for Jersey sample 2014-11-23 07:27:49 +00:00
Dave Syer
9f7bd0cddc Inject ResourceConfig instance (not class) into Jersey
If you inject the class (via a servlet parameter) it seems that
Jersey tries to create all the beans for you (and fails). I thought
it was supposed to work (according to the docs), so I'm a bit confused
but the sample now has Spring DI and the tests pass.

Fixes gh-1981
2014-11-22 17:17:53 +00:00
Phillip Webb
670ba33bec Improve MongoDataAutoConfiguration
Update MongoDataAutoConfiguration to provide easier configuration of
CustomConversions, the MappingMongoConverter, MongoMappingContext
and an authentication database.

Fixes gh-1619
Fixes gh-1730
2014-11-20 14:55:19 -08:00
Andy Wilkinson
90af8bf54a Add auto-configuration for Jetty 9's WebSocket support
Closes gh-1269
2014-11-19 14:44:54 +00:00
Dave Syer
6ad626de49 Allows /configprops endpoint to show nested properties
Including maps and lists. Beans with no metadata (in
/META-INF/*spring-configuration-metadata.json) are just serialized
as they come (so might have problems like cycles). Serialization
errors are caught and rendered as an "error" for that bean. Any
problems can be fixed by preparing metadata and specifying which
properties are to be rendered that way.

Fixes gh-1746, fixes gh-1921
2014-11-19 14:10:01 +00:00
Phillip Webb
a641f0c72a Polish 2014-11-18 15:45:14 -08:00
Andy Wilkinson
7a783f5a18 Merge branch '1.1.x' 2014-11-18 21:31:19 +00:00
Andy Wilkinson
863c099161 Add missing copyright headers 2014-11-18 21:29:54 +00:00
Andy Wilkinson
1864d79077 Polish Undertow contribution
Closes gh-1779
2014-11-18 21:20:34 +00:00
sopov.ivan
c501b889af Add support for using Undertow as an embedded container
See gh-1779
2014-11-18 21:20:34 +00:00
Phillip Webb
21115f29cf Remove accidental SampleControllerAdvice test
Accidentally committed in 4668f59723

See gh-1950
2014-11-18 12:45:53 -08:00
Phillip Webb
4668f59723 Improve relaxed enum binding
Update RelaxedConversionService to support more relaxed enum binding.

Fixes gh-1950
2014-11-18 11:24:32 -08:00
Andy Wilkinson
35b7ba5cda Deprecate http.mappers.* properties
The http.mappers.* configuration properties assumed that the mapping
was JSON (on of the property names was jsonPrettyPrint) and also only
exposed a small subset of the configuration options supported by
Jackson (and GSON). The property names implied that it would configure
all HTTP mapping, however it was ignored by GsonAutoConfiguration.

This commit deprecates the support for http.mappers.* in favour of
configuring Jackson or Gson instead. Jackson can be configured
declaratively using the spring.jackson.* properties or programtically.
Gson can be configured programatically by using a GsonBuilder to
create a Gson instance with the desired configuration.
gh-1946 has been opened to add support for declarative configuration
of Gson.

Closes gh-1945
2014-11-18 13:51:48 +00:00
Andy Wilkinson
bebf26d91e Restore compatibility with Jetty 8 when SSL is being used
ServerConnector is in different packages in Jetty 8 and Jetty 9 which
was leading to a NoClassDefFounderError when SSL was used with
Jetty 8.

This commit updates SslServerConnectorFactory to return an
AbstractConnector, a super class of ServerConnector, that is in the
same package in both Jetty 8 and Jetty 9. This class does not provide
a setPort method so the setting of the port has been pushed down into
the SslServerConnectorFactory implementation.

SSL samples for both Jetty 8 and Jetty 9 have been added to verify
SSL with both supported versions of Jetty.

Closes gh-1925
2014-11-17 17:18:31 +00:00
Phillip Webb
345ced1675 Fixup version numbers following release 2014-11-11 18:05:23 -08:00
Spring Buildmaster
46b7738334 Next development version 2014-11-11 17:12:24 -08:00
Phillip Webb
b947d6001d Polish 2014-11-11 09:47:54 -08:00
Stephane Nicoll
109c3a3439 Auto configure CharacterEncodingFilter
Provide a default UTF-8 encoding for HTTP requests and responses unless
specified otherwise.

Fixes gh-1182
2014-11-11 12:01:15 +01:00
Andy Wilkinson
7d1606dcfa Merge branch '1.1.x'
Conflicts:
	spring-boot-dependencies/pom.xml
2014-11-11 10:13:51 +00:00
Andy Wilkinson
f07c090876 Upgrade to Mongo Java Driver 2.12.4
The exception message for a connection timeout has been updated to
include the timeout period. The tests for the sample have been updated
accordingly.

Closes gh-1884
2014-11-11 10:10:16 +00:00
Andy Wilkinson
150b85e10d Merge branch '1.1.x'
Conflicts:
	spring-boot-dependencies/pom.xml
2014-11-10 11:29:21 +00:00
Andy Wilkinson
a9b88d6955 Document need for ServerEndpointExporter and show its use in a sample
Traditionally, a @ServerEndpoint-annotated bean is found by a servlet
container initialiser, however Boot does not run servlet container
initialisers when an embedded container is being used. To be able to use
@ServerEndpoint in a Boot app that uses embedded Tomcat a
ServerEndpointExporter bean must be declared.

This commit updates the documentation to describe this requirement and
also updates the WebSockets sample to illustrate the use of
ServerEndpointExporter. The version of Spring Framework has been updated
to 4.0.8.BUILD-SNAPSHOT. This picks up the fix for SPR-12340.

Closes gh-1722
2014-11-10 11:27:56 +00:00
Phillip Webb
d039f43107 Update samples to use @SpringBootApplication
Update the relevant samples to use the new @SpringBootApplication
annotation.

Closes gh-1842
2014-11-06 22:51:09 -08:00
Phillip Webb
96a031cf20 Default spring.datasource.jmx-enabled to false
Change the default value of spring.datasource.jmx-enabled to false
to prevent InstanceAlreadyExistsException problems when using the
Spring Test Framework.

Fixes gh-1590
2014-11-06 21:38:07 -08:00
Phillip Webb
9d4ada7939 Add Tomcat 7 and Jetty 8 samples
Switch the Tomcat 8 and Jetty 9 samples to Tomcat 7 and Jetty 8. Since
Tomcat 8 and Jetty 9 are now the default versions the previous samples
are no longer relevant, however, we do need integration tests to check
that we remain compatible with Tomcat 7 and Jetty 8.

See gh-1832
2014-11-05 16:35:44 -08:00
Phillip Webb
48d651c753 Add Jetty 9 sample
See gh-369
2014-11-05 09:14:14 -08:00
Phillip Webb
39037e0cab Use the Mongo starter for the sample application
See gh-1831
2014-11-05 07:47:25 -08:00
Phillip Webb
a973fd41f4 Polish 2014-11-03 18:49:20 -08:00
Dave Syer
f304d46955 Add JMX MBean for Tomcat DataSource
If the DataSource is a Tomcat one we force it to register an MBean
if spring.jmx.enabled=true

Fixes gh-1590
2014-11-03 13:38:05 +00:00
Andy Wilkinson
a85e02fbb9 Update to Spring Data Evans SR1
Closes gh-1709
2014-11-03 11:31:58 +00:00
Dave Syer
a7e1ec842d Use @*@ delimiters in Maven resource filtering
It *is* very useful to have filtering on by default, so that is now
the case (in spring-boot-starter-parent). Users can filter resources
by default by adding @*@ placeholders (so as not to clash with Spring
${} placeholders).

Fixes gh-1199
2014-11-03 11:12:11 +00:00
Phillip Webb
cf24af0bfb Rework logging to prevent double initialization
Prior to this commit LoggingSystem initialization would happen multiple
times. Once to configure "quiet" logging, and again to configure correct
settings once the Application was initialized. This could cause problems
if `logging.groovy` logback files were used.

The logging system is now only initialized once (when possible) by
following these steps:

- Standard logging initialization occurs via the actual logging
  implementation used (e.g. logback will load a logback.xml file if it
  exists)
- beforeInitization() is called to prevent early log output.
  Implementations now either use a Filter or simply set the root logging
  level.
- initialize() is called with an optional log configuration file (e.g
  a custom logback.xml location) and an optional log output file (the
  default is null indicating console only output).

The initialize() method will attempt to prevent double initialization
by checking if a standard configuration file exists. Double
initialization now only occurs in the following situations:

- The user has a standard configuration file (e.g. classpath:logback.xml)
  but also specifies a logging.config property. Double initialization is
  required since the specified configuration file supersedes the default.
- The user has a standard configuration file (e.g. classpath:logback.xml)
  and specifies a logging.file property. Double initialization is
  required since the standard configuration may use a ${LOG_FILE}
  reference.

In addition this commit removes the `logging.console` option and now
assumes that logging either occurs only to console or to both the
console and a file. This restriction helps simplify the LoggingSystem
implementations. If file only logging is required a custom logback.xml
can be used.

Fixes gh-1091
See gh-1612, gh-1770
2014-10-30 00:13:13 -07:00
Phillip Webb
d17b7c8195 Polish 2014-10-29 12:08:37 -07:00
Andy Wilkinson
ba40f13370 Update expectation to match response from anonymous access to /health 2014-10-28 09:39:40 +00:00
Dave Syer
24e71e868f Allow /health and /info to authenticate anonymously
Then we can optionally find a non-anonymous principal if there
is one. If the user is anonymous then the health result is cached
up to endpoints.health.ttl (default 1000ms) to prevent a DOS attack.

Fixes gh-1353
2014-10-27 16:58:01 +00:00
Phillip Webb
2e7aa4685b Polish 2014-10-21 20:34:00 -07:00
Andy Wilkinson
47285f9f02 Merge branch '1.1.x' 2014-10-21 16:08:31 +01:00
Andy Wilkinson
186b3a66e3 Update WebSocket sample with new SockJS CDN
Closes gh-1740
2014-10-21 16:07:15 +01:00
Andy Wilkinson
6b1f76ad6b Merge branch '1.1.x' 2014-10-20 11:20:56 +01:00
Andy Wilkinson
160d609bd4 Protect against race condition where output file exists but it is empty
Previously, there was a timing window where the output file had been
created but it was empty. This would cause the test to fail as the
output was read from the empty file and didn’t match the expected “Hello
World”.

This commit updates the test to only process the resources in the output
directory when all the resolved resources have a non-zero content
length. An @Before method has also been added to delete the output
produced by the test so that the outcome of the test isn’t affected by
files generated by previous runs.

Fixes gh-1735
2014-10-20 11:04:14 +01:00
Andy Wilkinson
886bbc3b41 Merge branch '1.1.x' 2014-10-15 16:36:11 +01:00
Andy Wilkinson
9a2d654eba Rename test classes so that their tests are run by Maven 2014-10-15 16:35:48 +01:00
Dave Syer
89197eb03b Add org.hibernate.SQL to the --debug logger levels
I think this fixes gh-446 (it seems unreasonable to want to log the DDL
even if it is not being executed)
2014-10-13 17:53:48 +01:00
Phillip Webb
3228cfa9bd Fixup version numbers following release 2014-10-10 15:53:54 -07:00
Spring Buildmaster
3e71a21b30 Next development version 2014-10-10 15:19:47 -07:00
Phillip Webb
a3527521a2 Also resolve favicon.ico from resource folders
Update FaviconConfiguration to allow favicon.ico files to be resolved
from static resource folders (/META-INF/resources, /resources, /static,
/public) in addition to the root classpath.

Fixes gh-1656
2014-10-10 13:09:30 -07:00
Andy Wilkinson
07cb8f2836 Ensure that spring.data.rest.* configuration takes effect
Previously, RepositoryRestMvcBootConfiguration was not annotated with
@Configuration. This meant that it was processed in lite mode.
Crucially, in lite mode, there’s no proxying so each call to the
config() @Bean method from within other @Bean methods resulted in the
creation of a new RepositoryRestConfiguration instance. Furthermore, as
each of these instances wasn’t a Spring bean the configuration
properties were not applied.

This commit updates RepositoryRestMvcBootConfiguration to annotate it
with @Configuration so that it’s no longer processed in lite mode. It
also updates the unit tests and the Spring Data REST sample to verify
that the baseUri can be configured using application.properties.

Fixes gh-1675
2014-10-09 14:29:38 +01:00
Phillip Webb
4c51aa8e28 Polish 2014-10-08 11:34:11 -07:00
Andy Wilkinson
7287c66d88 Fix Actuator sample's health test 2014-10-08 18:58:34 +01:00
Daniel Fullarton
1dbc94d0f7 Add a logging system, starter and sample for Log4j 2
Closes gh-1565
2014-10-08 15:30:00 +01:00
Andy Wilkinson
8e000f3da1 Merge branch '1.1.x' 2014-10-08 15:13:52 +01:00
Andy Wilkinson
b85926e6f0 Fix the rest of the typo InMemoryRepository's name 2014-10-08 15:13:25 +01:00
Andy Wilkinson
b8759ebf69 Merge branch '1.1.x' 2014-10-08 14:48:26 +01:00
matzschmanski
02fef4295d Fix typo: InMemoryMessageRespository -> InMemoryMessageRepository
Closes gh-1671
2014-10-08 14:48:00 +01:00
Phillip Webb
62eb01f0b8 Polish 2014-10-06 12:03:51 -07:00
Phillip Webb
09d5812c3b Merge branch '1.1.x' 2014-10-06 11:07:28 -07:00
Phillip Webb
b616e9fdc4 Rename SampleIntegrationApplicationTests 2014-10-06 10:47:40 -07:00
Dave Syer
64ef03aafd Fix Jersey1 integration test 2014-10-02 15:28:27 +01:00
Dave Syer
339f3b7bf0 Add autoconfig support for Jersey (2)
Jersey 2 has some Spring support built in but it's a bit awkward to
use in a Boot app, so autoconfiguration seems appropriate. The tests
and sample show how to use it, but the short story is that any
@Component can define JAX-RS endpoints via @GET etc.

There's a sample for Jersey 1 as well (pay careful attention to
the plugin configuration if you want to build an executable jar)

Fixes gh-1651
2014-10-02 11:22:00 +01:00
Manuel Doninger
02e33c125c Use reflection to load Hibernate version specific classes
This adds support for Hibernate 4.2 again by loading the specific
classes with reflection.

Fixes gh-1460, fixes gh-1557
2014-10-02 09:49:11 +01:00
Andy Wilkinson
fcd855cd5e Merge branch '1.1.x' 2014-09-30 10:30:08 +01:00
Andy Wilkinson
61e90f5b6e Add tests to Data REST sample for search operations
Closes gh-1627
2014-09-30 10:29:38 +01:00
bangsen.yin
b798d001d7 Add missing @Param annotations to CityRepository in Data REST sample
Without the @Param annotations, using either of the search URIs would
resulted in a 400 response and an error describing the lack of @Param
annotation.

See gh-1627
2014-09-30 10:18:26 +01:00
Phillip Webb
4f9258a345 Fixup version numbers following release 2014-09-25 21:37:40 -07:00
Spring Buildmaster
edb4b7ed7d Next development version 2014-09-25 21:02:37 -07:00