Commit Graph

733 Commits

Author SHA1 Message Date
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
Phillip Webb
0d0e5eb590 Merge branch '1.1.x' 2014-09-25 10:05:35 -07:00
Dave Syer
336b96b81c Copy server customization to management context
If the actuator endpoints are configured on a different port then there
are some settings in the main ServerProperties that we would like to
re-use (e.g. the access log). The easiest way to do that is to just
configure the management server using the same ServerProperties instance
and then overwrite the things that are different (and stored in
ManagementServerProperties).

Fixes gh-1581
2014-09-25 09:57:24 -07:00
Stéphane DERACO
68ff7d4592 Fix broken documentation links
Fix links to `actuator-noweb`, `actuator-log4j` and `hornetq` samples.

Fixes gh-1613
2014-09-25 09:47:07 -07:00
Phillip Webb
4f610fa5a1 Merge branch '1.1.x'
Conflicts:
	spring-boot-samples/spring-boot-sample-tomcat-ssl/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-ssl/src/test/java/sample/tomcat/SampleTomcatSslApplicationTests.java
	spring-boot/src/main/java/org/springframework/boot/context/embedded/ConfigurableEmbeddedServletContainer.java
	spring-boot/src/main/java/org/springframework/boot/context/embedded/Ssl.java
2014-09-17 10:11:30 -07:00
Phillip Webb
62a5ce52d0 Backport Jetty/Tomcat SSL support
Fixes gh-1570
Cherry-picked from 0960908 and 258c6f1
2014-09-17 10:08:05 -07:00
Andy Wilkinson
5a160fbe5a Reinstate repository configuration in spring-boot-samples pom
The repository configuration is there in 1.1.x but missing in master.
This commit brings the two branches back into line.

Closes gh-1473
2014-09-15 17:48:01 +01:00
Dave Syer
389c4f3e0b Merge branch '1.1.x' 2014-09-13 06:44:03 -05:00
Dave Syer
bf0c8fc8bb Remove JDBC from secure-web sample
Fixes gh-1534
2014-09-13 06:42:59 -05:00
Dave Syer
9902f98a3d Ensure the AuthenticationManager is created when needed
There was too much state really in the old implementation of
AuthenticationManagerConfiguration, and it was leading occasionally
to null pointers when method A assumed that method B had already
been called and it hadn't. This change manages to concentrate all the
references to an AuthenticationManagerBuilder into a single method
call, removoing the need for storing it at all.

Fixes gh-1556
2014-09-13 06:42:46 -05:00
Phillip Webb
338288205b Fixup version numbers following release 2014-09-04 15:40:55 -07:00
Spring Buildmaster
d63e4b4329 Next development version 2014-09-04 12:15:18 -07:00
Dave Syer
73a5a8730b Fix versions in simple sample 2014-09-04 10:20:54 +01:00
Dave Syer
fea9ee8faa Merge branch '1.1.x' 2014-09-04 08:51:51 +01:00
Dave Syer
8a66d50edf Remove binary files 2014-09-04 08:51:37 +01:00
Phillip Webb
6ee18fbabd Remove workaround for SPR-12118 2014-09-03 18:32:17 -07:00
Phillip Webb
6f62fc854b Merge branch '1.1.x' 2014-09-03 11:45:54 -07:00
Stephane Nicoll
f46fe32264 Add group discriminant in case of conflict
Prior to this commit, the repackage goal silently ignored the case of
two libraries having the same name and version but a different group.
As a result, the second library was overwriting the first one in the
repackaged jar.

This commit adds support for custom Library names and updates the
Maven and Gradle plugins so that the name includes the group ID
when there would otherwise be a duplicate.

Fixes gh-1475
2014-09-03 11:22:53 -07:00
Phillip Webb
236026a43a Support mixed XA/non-XA ConnectionFactory beans
Update ActiveMQ and HornetQ XA configurations to also expose non-xa
ConnectionFactory variants.

Fixes gh-1461
2014-09-02 13:00:59 -07:00
Phillip Webb
104b724446 Fix Windows Atomikos/Bitronix ApplicationTests
Update SampleAtomikosApplicationTests and SampleBitronixApplicationTests
to not depend on any specific System.out order.

Fixes gh-1472
2014-09-01 17:46:52 -07:00
Andy Wilkinson
a9c2eb3919 Update JTA sample tests to work on Windows
Rather than hard-coding assumptions about the line endings, use a
PrintWriter to produce the multi-line expected output
2014-08-27 11:42:21 +01:00
Josh Long
85cfd016a6 Add JNDI Sample
Add a sample application that can be deployed to WildFly to demonstrate
how JTA can be used when running in a application server.

See gh-947
2014-08-26 22:34:16 -07:00
Josh Long
c15e3a7e2f Add Atomikos and Bitronix JTA samples
Add samples and integration tests for Atomikos and Bitronix JTA.

See gh-947
2014-08-26 22:34:04 -07:00
Dave Syer
ef2898a2f9 Fix version in new sample 2014-08-26 14:38:03 +01:00
Dave Syer
3404850b2e Merge branch '1.1.x' 2014-08-26 09:19:38 +01:00
Dave Syer
95d65c2ff5 Add indirection to avoid runtime dependency on MVC in templates
Velocity and Freemarker share some common properties so the base class for
configuring their properties makes some sense. Unfortunately the implementation
pulls in Spring MVC at runtime because of the signature of one method (that
would never be called). We can fix that in a number of ways, but the least
disruptive is probably to change the signature of that method and only refer
to the concrete template view resolver type if the method is called.

Fixes gh-1437
2014-08-26 09:19:07 +01:00
Dave Syer
43de5f3df8 Bump version in new sample 2014-08-25 17:21:17 +01:00
Dave Syer
5fd9af23d6 Merge branch '1.1.x' 2014-08-25 17:18:36 +01:00
Dave Syer
607f78a779 Add secure sample with JDBC and data.sql
We can't easily solve the problem by not allowing Spring Security to
eagerly instantiate everything, but we can be defensive about data.sql
and make sure it is executed even if the listener isn't yet registered.

Fixes gh-1386
2014-08-25 17:16:32 +01:00
Phillip Webb
7d4fbacecd Fix invoker to not download remote artifacts
Updates to prevent the maven-invoker-plugin from downloading remote
snapshot jars. Possibly caused by the recent changes to the
spring-boot-dependencies POM.

See gh-1413
2014-08-21 00:52:00 -07:00
Phillip Webb
6634af6a25 Fix broken parent POM version
Update the parent POM version in spring-boot-sample-web-secure-custom
2014-08-12 13:45:19 -07:00
Dave Syer
300910f7d5 Merge branch '1.1.x' 2014-08-11 17:43:14 -07:00
Dave Syer
0cf1c6f0e5 Refactor AuthenticationManagerConfiguration to make sure it works
if user also adds @EnableWebMvcSecurity. The problem is that the ordering
of the init() and configure() methods in the Spring Security configurers
can force things to happen too early unless we are careful. It's still a bit
twitchy I would say, but this relatively small change seems to fix the GS guide
and not break any existing tests.

I added a sample which mimic ths GS guide so we get an integration test that
executes the new code paths.

Fixes gh-1364
2014-08-11 17:42:30 -07:00
Phillip Webb
7d0a3ddcce Rename VanillaHealthIndicator to Application...
Rename `VanillaHealthIndicator` to `ApplicationHealthIndicator` and
changed the exposed bean name from `statusHealthIndicator` to
`applicationHealthIndicator`.

This provides less confusing JSON output:

  {"status":"UP","application":{"status":"UP"}}

vs:

  {"status":"UP","status":{"status":"UP"}}

Fixes gh-1291
2014-08-11 09:04:01 -07:00
Phillip Webb
6b083d7e0b Merge branch '1.1.x'
Conflicts:
	pom.xml
	spring-boot-actuator/pom.xml
	spring-boot-autoconfigure/pom.xml
	spring-boot-cli/pom.xml
	spring-boot-dependencies/pom.xml
	spring-boot-docs/pom.xml
	spring-boot-full-build/pom.xml
	spring-boot-integration-tests/pom.xml
	spring-boot-parent/pom.xml
	spring-boot-samples/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-log4j/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-noweb/pom.xml
	spring-boot-samples/spring-boot-sample-actuator-ui/pom.xml
	spring-boot-samples/spring-boot-sample-actuator/pom.xml
	spring-boot-samples/spring-boot-sample-amqp/pom.xml
	spring-boot-samples/spring-boot-sample-aop/pom.xml
	spring-boot-samples/spring-boot-sample-batch/pom.xml
	spring-boot-samples/spring-boot-sample-data-elasticsearch/pom.xml
	spring-boot-samples/spring-boot-sample-data-gemfire/pom.xml
	spring-boot-samples/spring-boot-sample-data-jpa/pom.xml
	spring-boot-samples/spring-boot-sample-data-mongodb/pom.xml
	spring-boot-samples/spring-boot-sample-data-redis/pom.xml
	spring-boot-samples/spring-boot-sample-data-rest/pom.xml
	spring-boot-samples/spring-boot-sample-data-solr/pom.xml
	spring-boot-samples/spring-boot-sample-flyway/pom.xml
	spring-boot-samples/spring-boot-sample-hornetq/pom.xml
	spring-boot-samples/spring-boot-sample-integration/pom.xml
	spring-boot-samples/spring-boot-sample-jetty/pom.xml
	spring-boot-samples/spring-boot-sample-liquibase/pom.xml
	spring-boot-samples/spring-boot-sample-parent-context/pom.xml
	spring-boot-samples/spring-boot-sample-profile/pom.xml
	spring-boot-samples/spring-boot-sample-secure/pom.xml
	spring-boot-samples/spring-boot-sample-servlet/pom.xml
	spring-boot-samples/spring-boot-sample-simple/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat/pom.xml
	spring-boot-samples/spring-boot-sample-tomcat8-jsp/pom.xml
	spring-boot-samples/spring-boot-sample-traditional/pom.xml
	spring-boot-samples/spring-boot-sample-web-freemarker/pom.xml
	spring-boot-samples/spring-boot-sample-web-groovy-templates/pom.xml
	spring-boot-samples/spring-boot-sample-web-jsp/pom.xml
	spring-boot-samples/spring-boot-sample-web-method-security/pom.xml
	spring-boot-samples/spring-boot-sample-web-secure/pom.xml
	spring-boot-samples/spring-boot-sample-web-static/pom.xml
	spring-boot-samples/spring-boot-sample-web-ui/pom.xml
	spring-boot-samples/spring-boot-sample-web-velocity/pom.xml
	spring-boot-samples/spring-boot-sample-websocket/pom.xml
	spring-boot-samples/spring-boot-sample-ws/pom.xml
	spring-boot-samples/spring-boot-sample-xml/pom.xml
	spring-boot-starters/pom.xml
	spring-boot-starters/spring-boot-starter-actuator/pom.xml
	spring-boot-starters/spring-boot-starter-amqp/pom.xml
	spring-boot-starters/spring-boot-starter-aop/pom.xml
	spring-boot-starters/spring-boot-starter-batch/pom.xml
	spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml
	spring-boot-starters/spring-boot-starter-data-gemfire/pom.xml
	spring-boot-starters/spring-boot-starter-data-jpa/pom.xml
	spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml
	spring-boot-starters/spring-boot-starter-data-rest/pom.xml
	spring-boot-starters/spring-boot-starter-data-solr/pom.xml
	spring-boot-starters/spring-boot-starter-freemarker/pom.xml
	spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml
	spring-boot-starters/spring-boot-starter-hornetq/pom.xml
	spring-boot-starters/spring-boot-starter-integration/pom.xml
	spring-boot-starters/spring-boot-starter-jdbc/pom.xml
	spring-boot-starters/spring-boot-starter-jetty/pom.xml
	spring-boot-starters/spring-boot-starter-log4j/pom.xml
	spring-boot-starters/spring-boot-starter-logging/pom.xml
	spring-boot-starters/spring-boot-starter-mobile/pom.xml
	spring-boot-starters/spring-boot-starter-parent/pom.xml
	spring-boot-starters/spring-boot-starter-redis/pom.xml
	spring-boot-starters/spring-boot-starter-remote-shell/pom.xml
	spring-boot-starters/spring-boot-starter-security/pom.xml
	spring-boot-starters/spring-boot-starter-social-facebook/pom.xml
	spring-boot-starters/spring-boot-starter-social-linkedin/pom.xml
	spring-boot-starters/spring-boot-starter-social-twitter/pom.xml
	spring-boot-starters/spring-boot-starter-test/pom.xml
	spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml
	spring-boot-starters/spring-boot-starter-tomcat/pom.xml
	spring-boot-starters/spring-boot-starter-velocity/pom.xml
	spring-boot-starters/spring-boot-starter-web/pom.xml
	spring-boot-starters/spring-boot-starter-websocket/pom.xml
	spring-boot-starters/spring-boot-starter-ws/pom.xml
	spring-boot-starters/spring-boot-starter/pom.xml
	spring-boot-tools/pom.xml
	spring-boot-tools/spring-boot-dependency-tools/pom.xml
	spring-boot-tools/spring-boot-gradle-plugin/pom.xml
	spring-boot-tools/spring-boot-loader-tools/pom.xml
	spring-boot-tools/spring-boot-loader/pom.xml
	spring-boot-tools/spring-boot-maven-plugin/pom.xml
	spring-boot-versions/pom.xml
	spring-boot/pom.xml
2014-08-07 13:16:27 -07:00
Phillip Webb
cac3865ffa Fixup version numbers following release 2014-08-07 13:11:16 -07:00
Spring Buildmaster
74d0c5185a Next development version 2014-08-07 11:59:17 -07:00
Dave Syer
178386abc4 Merge branch '1.1.x' 2014-08-06 19:33:57 -07:00
Dave Syer
38f8d65756 Use ApplicationEvent to ensure that authentication event publisher is registered
There was a reference to an old (fixed) issue in Spring which led to some simplification
of the AuthenticationManager layering as well.

Fixes gh-1335
2014-08-06 19:30:27 -07:00
Andy Wilkinson
7f9ef1cf5b Merge branch '1.1.x' 2014-08-06 14:01:36 +01:00
Andy Wilkinson
e185793396 Update test to correct name of metric for request that returns a 401
The request is being made to '/' and, while the application does have
a mapping for '/', that mapping is not looked for before Spring
Security's filter rejects the request with a 401. This means that the
request is considered to be unmapped and this is reflected in the
metric's name.

See #1331 and #1333
2014-08-06 13:38:42 +01:00
Phillip Webb
da5c36c3a9 Polish 2014-07-29 13:06:47 -07:00
Andy Wilkinson
0960908bd7 Add support for configuring SSL declaratively
Both Tomcat and Jetty can now be configured to use SSL via the
environment (typically application.properties or application.yml)

Closes #1084
2014-07-24 15:10:09 +01:00
Andy Wilkinson
d04f325294 Merge branch '1.1.x' 2014-07-23 15:57:53 +01:00
Andy Wilkinson
7945b29669 Correct the descriptions of two sample projects 2014-07-23 15:57:44 +01:00
Stephane Nicoll
249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
Phillip Webb
3c7d825658 Fixup version numbers following release 2014-07-08 03:07:03 -07:00
Spring Buildmaster
40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
Dave Syer
3978700b4a More specific pointcut to be safe 2014-07-07 08:24:34 +01:00
Phillip Webb
8054426803 Format source code 2014-07-02 15:17:25 -07:00
Phillip Webb
fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Dave Syer
fd757cb371 Add logging.level to application.properties
E.g.

logging.level.org.springframework: DEBUG
logging.level.org.hibernate: WARN

Fixed gh-788
2014-06-27 15:49:17 +01:00
Phillip Webb
cc61d92b88 Fixup build following release 2014-06-27 07:00:57 -07:00
Spring Buildmaster
981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb
200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster
67189477fe Next development version 2014-06-26 10:51:35 -07:00
Phillip Webb
9632abf825 Formatting and cleanup 2014-06-26 09:41:15 -07:00
Phillip Webb
e220f0806a Attempt to fix Windows CI 2014-06-25 17:25:31 -07:00
Phillip Webb
8be3f33cfb Be defensive detecting when Mono not running 2014-06-25 17:05:28 -07:00
Dave Syer
b0bf9c776f Fix logic error in ErrorPageFilter (fixes gh-1149) 2014-06-25 08:47:24 +01:00
Phillip Webb
91bbd20ca0 Fixup version numbers following release 2014-06-24 14:53:08 -07:00
Spring Buildmaster
542f3cbda8 Next development version 2014-06-24 13:53:56 -07:00
Dave Syer
542896b28f Support for non-executable JAR in addition to the repackaged one
Stretches the Gradle boot plugin a bit, so there's a sample build
in the "profile" sample. Howto docs give examples.

Fixes gh-1135
2014-06-23 11:08:58 +01:00
Dave Syer
772df9bea7 Add inputs to gradle bootRepackage task
See gh-1113
2014-06-20 22:25:11 +01:00
Phillip Webb
a2efe17fc9 Polish 2014-06-18 16:30:22 -07:00
Phillip Webb
179e1558f6 Polish 2014-06-18 12:48:42 -07:00
Dave Syer
f8e847a6fc Change ordering of DataSourceInitializer a bit
It needs to run as soon as the DataSource is available really otherwise
anything else that depends on the DataSource (like Security JDBC
initializers) might fail when it tries to use it.

One change from 1.1.1 is that if you have a schema.sql you had better
make sure your data.sql talks to the same tables. In 1.1.1 you could
sometimes get away with letting Hibernate initialize the tables for
your data.sql and *also* have a schema.sql. This was fragile and doomed
to fail eventually if the DataSourceInitializer somehow got
initialized earlier (e.g. through a @DependsOn), so in the spririt
of honesty being the best policy we explicitly disallow it now.

Fixes gh-1115
2014-06-18 15:19:53 +01:00
Dave Syer
7fc1f19389 Fix WS sample to use a random port 2014-06-18 12:48:26 +01:00
Dave Syer
e39fafcc33 Add JDBC user details to web-secure sample
See gh-1115
2014-06-18 12:48:26 +01:00
Dave Syer
18d8c4a8d9 Add additional samples to README
Fixes gh-1068
2014-06-17 11:28:34 +01:00
Dave Syer
2f12dc823c Remove workaround for bug they fixed in Groovy 2014-06-13 14:24:17 +01:00
Phillip Webb
143e1918b7 Fixup versions following release 2014-06-11 12:16:08 -07:00
Spring Buildmaster
4ca26a21dc Next development version 2014-06-11 10:46:27 -07:00
Phillip Webb
9e93719922 Fixup version numbers following release 2014-06-10 14:20:41 -07:00
Spring Buildmaster
05ed7b3bcd Next development version 2014-06-10 12:40:35 -07:00
Phillip Webb
3007a777d0 Roll back to 1.1.0.BUILD-SNAPSHOT 2014-06-10 09:00:08 -07:00
Dave Syer
36130b27e1 Support for Jmx (and Integration) autoconfig in parent contexts
When there are parent contexts we already had a strategy for registering
the actuator endpoints, but not the regular JMX or Integration MBeans.
This chnage makes the autoconfigs for JMX aware of the parent context.

Also adds a sample with a parent context.

See gh-847
2014-06-10 15:12:30 +01:00
Phillip Webb
5adbf32c18 Fixup version numbers following release 2014-06-09 22:13:54 -07:00
Spring Buildmaster
c650f2391e Next development version 2014-06-09 21:55:19 -07:00
Phillip Webb
f0c0f00089 Polish 2014-06-09 15:20:37 -07:00
Andy Wilkinson
b585afe537 Polishing 2014-06-09 21:17:19 +01:00
Maciej Walkowiak
e40320a8ed Added integration test for Spring Web Services Sample project 2014-06-09 21:17:19 +01:00
Maciej Walkowiak
95a6ce9e48 Spring Web Services Starter
- upgraded Spring WS to 2.2.0.RELEASE
- replaced default MVC DispatcherServlet with MessageDispatcherServlet
- migrated XML based config with nww Spring WS Java config

Fixes: gh-412
2014-06-09 21:17:19 +01:00
Marten Deinum
e2a449da97 Spring Web Services Starter and Sample Project
Fixes gh-412
2014-06-09 21:17:19 +01:00
Dave Syer
bc85f388aa Add test for gh-1058 2014-06-09 17:05:12 +01:00
Javier Gayoso
b7d94d1364 Optimized login form - delegated CSRF token creation to thymeleaf
Also added additional test to verify behaviour.

Fixes gh-1039
2014-06-09 10:56:01 +01:00
Phillip Webb
2df4ead4d6 Convert README.md -> README.adoc 2014-06-06 22:56:44 -07:00
Dave Syer
09200361de Align expectations of various JMX configurations
They all want to create an MBeanServer and when that happens
user sees no MBeans, or sometimes just one set (Spring Core,
Spring Integration or Spring Boot). To harmonise them we
create a @Bean of type MBeanServer and link to it in the
other autoconfigs

Fixes gh-1046
2014-06-06 17:52:14 +01:00
Dave Syer
0ccfba939e Switch to a matches-none filter for security.basic.enabled=false
There were some residual issues to do with the changes to the implementation
of security.basic.enabled=false. It was a good idea to have a filetr chain
triggered by the flag being off because it smooths the way for user-defined
filter chains to use the Boot AuthenticationManager (as a first step at least),
but it wasn't a goog idea to add any actual secuity features to that filter.
E.g. if it has HSTS then even an app like Sagan that has some secure endpoints
that it manages itself and the rest is unsecured has issues because it can't
accept connections over HTTP even on unsecure endpoints.

TODO: find a way for security.ssl_enabled=true to apply to only the user-
defined security filter (maybe not possible or worth the effort, since they
can inject a SecurityProperties if they need it?).

See gh-928
2014-06-05 07:04:07 +01:00
Phillip Webb
d2fbef02e7 Fixup POM errors 2014-06-01 13:27:34 +01:00
Phillip Webb
e5cda040b0 Restore test classes
Restore test classes accidentally deleted and ignored in c43fd04f3e.
2014-06-01 13:11:25 +01:00
Artur Konczak
99940337a9 Add support for Elasticsearch
Add auto-configuration and starters for Elasticsearch.

Fixes gh-408
2014-06-01 12:54:42 +01:00
Stephane Nicoll
5a69bb9267 Add HornetQ JMS support
Provide auto-configuration support for HornetQ JMS broker, along with
an additional starter POM.

The connection factory connects to a broker available on the local
machine by default. A configuration switch allows to enable an embedded
mode that starts HornetQ as part of the application.

In such a mode, the spring.hornetq.embedded.* properties provide
additional options to configure the embedded broker. In particular,
message persistence and data directory locations can be specified. It is
also possible to define the queue(s) and topic(s) to create on startup.

Fixes: gh-765
2014-05-30 23:26:07 +01:00
Dave Syer
1d7caf8e31 Man up and deal with CSRF in integration test
Fixes gh-979
2014-05-30 08:21:57 +01:00
Dave Syer
5e3cc95ccf Adjust security.basic.enabled=false behaviour
Actually the web-secure sample is misusing
security.basic.enabled=false (IMO) - it should be a flag
to say that you want to temporarily disable the basic security
fallback on application endpoins, not  way to disable all
security autoconfiguration.

Added test case to web-secure sample to ensure a user
can log in.

Fixes gh-979
2014-05-29 13:25:01 +01:00
Dave Syer
dba9667e93 Add spring-boot-starter-groovy-templates
Fixes gh-974
2014-05-28 16:13:16 +01:00
Phillip Webb
4417d05f3a Fixup incorrect parent version
Inadvertently missed during a 1.0.x merge.
2014-05-28 15:26:05 +01:00
Phillip Webb
99af5dbe23 Merge branch '1.0.x'
Conflicts:
	spring-boot-dependencies/pom.xml
2014-05-28 14:57:13 +01:00
Phillip Webb
30b181573e Fix Jasper on Tomcat 8
Refactor Jasper initialization code to call JasperInitializer during
server start.

Fixes gh-962
See gh-919
2014-05-28 14:52:21 +01:00
Dave Syer
f659a2e253 Use the ServerProperties to add prefixes to paths
when server.servletPath is set we need to add prefixes to
the security filter paths, and the /error path.

Conflicts:
	spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementSecurityAutoConfiguration.java
2014-05-28 08:41:22 +01:00
Dave Syer
68448a8c68 Use the ServerProperties to add prefixes to paths
when server.servletPath is set we need to add prefixes to
the security filter paths.

Fixes gh-945
2014-05-24 08:33:14 +01:00
Phillip Webb
1a475102de Polish 2014-05-22 20:33:08 +01:00
Andy Wilkinson
e45ef06b56 Polish Spring Data Solr integration 2014-05-22 17:29:12 +01:00
Christoph Strobl
6ed69709d7 Add auto configuration support for Spring Data Solr
Registers required components in application context if not available to
set up environment for usage with Spring Data Solr. Will listen on
SolrServer and SolrRepositories for configuration.

By default an HttpSolrServer is registered unless a zkHost (zookeeper
host) is defined. In that case an instance of CloudSolrServer will be
created.

By default multicore support is enabled, creating instances of
SolrServer for each core defined via @SolrDocument.
2014-05-22 17:29:12 +01:00
Christian Dupuis
4648188782 Rework HealthEndpoint and HealthIndicator
With this commit the state of a component or subsystem becomes a first-class citizen in Boot's application health support. HealthIndicators now return a Health instance with status and some contextual details.

An aggregation strategy has been introduced to aggregate several Health instances into one final application Health instance. Out of the box OrderedHealthAggregator can be configured to allow different ordering or a custom HealthAggregator bean can be registered.
2014-05-22 12:27:03 +02:00
Andy Wilkinson
733e12e215 Merge branch '1.0.x' 2014-05-21 16:38:24 +01:00
Andy Wilkinson
426c5680d4 Use Boot’s base Logback configuration in the Integration sample
Fixes #922
2014-05-21 16:38:02 +01:00
Andy Wilkinson
58b768b204 Merge branch '1.0.x' 2014-05-21 13:55:44 +01:00
Andy Wilkinson
6dafa15eef Remove mouldy start.groovy from the actuator sample
Fixes #900
2014-05-21 13:55:07 +01:00
Dave Syer
f123fd5a4a Remove reference to resolved issues in Groovy 2014-05-21 08:29:35 +01:00
Phillip Webb
8bcda1bcbe Polish 2014-05-20 18:26:56 +01:00
Andy Wilkinson
b94e8f54f6 Fix name of Groovy Templates sample project 2014-05-20 13:59:32 +01:00
Dave Syer
523956e2fe Add sample project for Groovy templates 2014-05-20 13:32:44 +01:00
Dave Syer
e118515d7a Use Flyway to bind flyway.*
Since Flyway has bean properties (with getters and setters)
it can be used to bin directly to the Environment (instead of
copying all the properties into FlywayProperties).

Fixes gh-806
2014-05-20 11:28:56 +01:00
Andy Wilkinson
2378fe0900 Add support for using Velocity templates 2014-05-19 12:01:20 +01:00
Dave Syer
a5543f18b9 Add callback for modifying or inspecting LocalContainerEntityManagerFactoryBean
A callback is added in autoconfig, so that if users inject the EntityManagerFactoryBuilder
into their app and use it to create multiple EntityManagerFactories, they all get the
same deferred DDL behaviour. The deferred DDL can also be disabled by setting
spring.jpa.hibernate.deferDdl=true.

Fixes gh-894
2014-05-19 11:08:11 +01:00
Dave Syer
2cc5bdfa09 Hack to force Flyway to initialize early 2014-05-19 11:08:11 +01:00
Dave Syer
58379e7593 Add hibernate-validator to spring-boot-starter-web
Fixes gh-616
2014-05-17 06:47:15 +01:00
Phillip Webb
01fcf61140 Polish 2014-05-15 09:51:16 +01:00
Dave Syer
5249f54c5a Integrate @ConfigurationProperties @Beans with DataSource configuration
We now have a much simpler DataSourceAutoConfiguration that binds to whatever
DataSource concrete type it finds at runtime. To be able to quickly switch between
Hikari and the other types of DataSource there's a minute shim for translating
the common properties (username, password, url, driverClassName), but actually
only url is different. The shim and also DataSource initialization is supported
through DataSourceProperties, but the other native properties get bound directly
through the concrete runtime type of the DataSource.

The /configprops endpoint works (and is exposed in the actuator sample).

Fixes gh-840, fixes gh-477, see also gh-808.
2014-05-13 16:46:04 +01:00
Dave Syer
5dd77a725c Enable access log explicitly in sample 2014-05-12 10:51:47 +01:00
Phillip Webb
61232395d8 Fixup versions 2014-05-10 23:47:31 +01:00
Christian Dupuis
c38f9bcdfa Add missing tests 2014-05-08 16:58:52 +02:00
Dave Syer
14d3b46809 Add constants to SecurityProperties and ManagementServerProperties
For the convenience of users who want to selectively override the
access rules in an application without taking complete control of the
security configuration we now have some constants:

* SecurityProperties.ACCESS_OVERRIDE_ORDER for overriding just the
application endpoint access rules

* ManagementServerProperties.ACCESS_OVERRIDE_ORDER for overriding the
application endpoint and management endpoint access rules

Fixes gh-803
2014-05-08 05:32:43 -07:00
Andy Wilkinson
62ac51eead Upgrade to the Spring Data Dijkstra release train
In addition to the upgrade to Dijkstra (#743) Spring HATEOAS has been
upgraded to 0.11.0 (#801) and Mongo's Java driver has been upgraded to
2.12.1 (#689). In both cases this is the same version as is used by
Dijkstra RC1.

The new version of Mongo's Java driver changes the exception that's
thrown when Mongo isn't running and a connection attempt fails. The
Mongo sample has been updated accordingly.

RepositoryRestMvcAutoConfiguration has been updated to be configured
before JpaRepositoriesAutoConfiguration. This ensures that the
former's transitive import of SpringDataJacksonConfiguration takes
precedence over the latter's import of the same. This is necessary as
RepositoryRestMvcConfiguration requires a bean that's declared by
SpringDataJacksonConfiguration and, if JpaRepositoriesAutoConfiguration
is processed first, its conditions may cause the import
SpringDataJacksonConfiguration to be skipped causing instantiation
of RepositoryRestMvcConfiguration to fail.

Closes #689
Closes #743
2014-05-07 13:44:28 +01:00
Dave Syer
9ba88cf6b4 Add JPA to flyway sample 2014-05-06 18:03:15 -07:00
Christian Dupuis
941c5560eb Remove duplicate hibernate-validator dependency from pom 2014-05-06 12:38:53 +02:00
Stephane Nicoll
789f506b5b Fix freemarker integration tests
Freemarker integration tests now use a random port so boot
builds properly when port 8080 is taken.
2014-05-05 14:50:48 +02:00
Phillip Webb
34b7bb20fd Add maven implicit plugin group ID
Add previously implicit <groupId>org.apache.maven.plugins</groupId>
to plugin declarations.
2014-05-02 23:03:31 +01:00
Dave Syer
41395d08e3 Upgrade flyway to 3.0
Fixes gh-771
2014-05-02 15:52:08 +01:00
Dave Syer
7e3614e6e0 Fix samples that need jdbc and don't import it 2014-05-02 15:15:39 +01:00
Dave Syer
ded6a707db Drop starters for flyway and liquibase
They only add a single extra dependency, so not really
much value.

Fixes gh-770
2014-05-02 13:10:20 +01:00
Dave Syer
5548b24c4c Add autoconfig support for Flyway migrations
Flyway starts up with its default settings if it is on the classpath.
You can also ask Boot to barf if the migration scripts are missing.

Fixes gh-730
2014-05-02 11:15:33 +01:00
Marcel Overdijk
68e33b25c1 Added liquibase autoconfiguration for database migrations
If Liquibase is on the classpath it will fire up on startup. Various
config options are available (as well as the option to disable it).
Liquibase uses a YAML format for changes (in classpath:db/changelog).
2014-05-02 11:12:12 +01:00
Dave Syer
240788862e Make RunMojo fork a new process
By forking a new process we get to attach the agent
much earlier and JPA can co-exist.

Fixes gh-648
2014-05-01 09:48:05 +01:00
Phillip Webb
6025f45aa0 Polish 2014-04-30 21:53:24 +01:00
Phillip Webb
decee8d871 Polish templates code 2014-04-30 21:36:09 +01:00
Phillip Webb
1d5cddc1e9 Polish gemfire sample 2014-04-30 20:54:39 +01:00
Dave Syer
2c087d4787 Update Boot version in gradle samples 2014-04-30 17:51:13 +01:00
Fermin Gallego
a09722272e Minor improvement in simple sample test 2014-04-30 13:11:55 +01:00
Dave Syer
030f00c36d Convert actuator-ui sample to FreeMarker
See gh-679
2014-04-30 13:04:19 +01:00
Stephane Nicoll
a27be338c6 Replace column name using reserved keyword
This commit replaces the "index" property of Review to use a custom
column name ("idx") as index is a reserved keyword in some RDMS such
as Oracle and MySQL.

Fixes gh-752
2014-04-30 10:51:08 +02:00
Andy Wilkinson
7c91176186 Add FreeMarker support
This commit adds auto-configuration and a starter,
spring-boot-starter-freemarker, for using FreeMarker view templates in
a web application.

A new abstraction, TemplateAvailabilityProvider, has been introduced.
This decouples ErrorMvcAutoConfiguration from the various view
technologies that Spring Boot now supports, allowing it to determine
when a custom error template is provided without knowing the details of
each view technology.

Closes #679
2014-04-29 19:46:09 +01:00
Dave Syer
27580e726f Add generic error handling to BasicErrorController
Since Spring supports gobal error handling through
@ControllerAdvice, it is quite easy to set up more meta-data
about an exception for the BasicErrorController. You need
to be careful not to swallow Security exceptions, and probably
others (optionally) so this feature needs a bit more work.

See gh-538
2014-04-29 15:23:28 +01:00
Dave Syer
4fb6e7ec42 Fix versions and repository declarations
Fixes gh-606
2014-04-28 08:28:52 +01:00
John Blum
34cbe1e60b Created a Spring Data GemFire Starter POM
... as well as a Spring Boot Sample Application with associated tests
for demonstrating how to get started using both Spring Data GemFire
and GemFire.
2014-04-28 08:28:37 +01:00
Phillip Webb
fba08e7811 Polish 2014-04-25 15:57:43 +01:00
Rob Winch
ae7098ae1d Add RepositoryRestMvcAutoConfiguration
Fixes gh-626
2014-04-25 11:13:31 +01:00
Phillip Webb
64a835e91a Move master to 1.1.0.BUILD-SNAPSHOT 2014-04-24 12:45:20 +01:00
Spring Buildmaster
d3954a1703 Next development version 2014-04-24 02:24:28 -07:00
Phillip Webb
4119ef5cf4 Use random ports for tests
Update remaining tests to use random ports.

Fixes gh-337
2014-04-23 19:11:54 +01:00
Phillip Webb
fad5ce45db Polish 2014-04-23 12:35:33 +01:00
Dave Syer
0aa93036fa Fix secure method configuration global authentication
This fixes a bug in the sample, where the AuthenticationManager it builds
is a local one for the filter chain containing "/login", whereas it was
expecting to override the Boot default, which is "global". The fix is
to extract the authentication configuration out into a
GlobalAuthenticationConfigurerAdapter.

Fixes gh-699
2014-04-20 10:18:04 -07:00
Dave Syer
e4b8e174e8 Add test case for gh-699 2014-04-20 10:00:34 -07:00
Dave Syer
7b07fe8ce0 Convert remaining samples to use random port
Partial fix for gh-337. See also gh-607 which complements this, but might
conflict on a merge.
2014-04-17 20:29:04 -07:00
Dave Syer
f134e96053 Convert Actuator sample to dynamic ports 2014-04-17 17:36:09 -07:00
Dave Syer
559009b8cf Support for random ports in @IntegrationTest
User can now set up default properties in the Environment using
@IntegrationTest("foo:bar", "x:y") etc. Using "server.port:0" you
can get Tomcat or Jetty to spin up on a random port. We also add
a test listener that populates "local.server.port" with the actual
port the server started on so you can @Value("${local.server.port}")
inject it into the test case.

See gh-607 (this should make the extension of that PR to samples
much easier)
2014-04-17 13:09:25 -07:00
Dave Syer
d613cc795e SpringSource->spring-projects 2014-04-16 08:16:54 -07:00
Dave Syer
b8b883de31 Fix springloaded co-ordinates
Apparently springloaded 1.1.5 was released to Maven Central with a
different groupId than to repo.spring.io. It would have worked in
milestones because the repository was declared.

See gh-648
2014-04-09 11:50:00 +01:00
Spring Buildmaster
a5864ebcd0 Next development version 2014-04-06 22:43:18 -07:00
Dave Syer
72d7c286c0 Add Spring MVC-generated path suffixes to endpoint paths
Spring Security doesn't know that Spring MVC maps /foo, /foo.json
and /foo/ all to the same handler. This change explicitly adds
suffixes to the actuator endpoint matchers so they are properly
protected.
2014-04-03 14:03:09 +01:00
Spring Buildmaster
15e9dbe98b Next development version 2014-04-01 03:05:51 -07:00
Phillip Webb
1e68b7e0a9 Remove superfluous <packaging> tags from POMs 2014-04-01 02:07:43 -07:00
Phillip Webb
0af7f7e347 Add missing POM info 2014-04-01 02:07:42 -07:00
Phillip Webb
488b03387f Polish POM formatting 2014-04-01 02:07:36 -07:00
Phillip Webb
6f9bb233ad Revert "Next development version"
This reverts commit b67bb70ee3.
2014-04-01 00:38:48 -07:00
Spring Buildmaster
b67bb70ee3 Next development version 2014-03-31 22:38:42 -07:00
Phillip Webb
ac4cdd33c3 Revert "Next development version"
This reverts commit 1d0eea12eb.
Returning to 1.0.0.BUILD-SNAPSHOT for an updated release.
2014-03-31 17:14:30 -07:00
Spring Buildmaster
1d0eea12eb Next development version 2014-03-28 11:47:09 -07:00
Dave Syer
41b4041c78 Add systemProperties to run task in sample 2014-03-28 17:14:39 +00:00
Phillip Webb
aca67066bf Rename RestTemplates to TestRestTemplate
Rename the RestTemplates to TestRestTemplate to help indicate that it's
primarily intended for testing. Also now extend RestTemplate to allow
direct use, rather than via factory methods.

Fixes gh-599
2014-03-27 11:22:03 -07:00
Phillip Webb
d117a6b22b Polish 2014-03-27 11:21:51 -07:00
Dave Syer
71c2c69c92 Return actual status code not 200 to machine client
Machine clients are much more fussy than browsers and we
should take care to preserve the HTTP status for them.

Fixes gh-596
2014-03-27 17:23:47 +00:00
Dave Syer
8491f8eb07 Simplify build config for actuator sample 2014-03-27 08:59:03 +00:00
Phillip Webb
beaddb2362 Polish 2014-03-26 13:29:26 -07:00
Phillip Webb
f70d6fb411 Declare all repositories in build samples
Update Gradle and Ant samples to consistently declare all repositories
(local, central, release, snapshot, milestone).

Fixes gh-426
2014-03-25 16:00:55 -07:00
Phillip Webb
44d708ef7a Polish 2014-03-25 14:33:27 -07:00
Dave Syer
809a5a711f Add a @EnableWebSecurity if it looks like the user needs one
If the user explicitly disables the basic security features and forgets to
@EnableWebSecurity, and yet still wants a bean of type
WebSecurityConfigurerAdapter, he is trying to use a custom
security setup and the app would fail in a confusing way without
this change.

Fixes gh-568
2014-03-25 12:19:56 +00:00
Dave Syer
b21fdd3463 Switch default security filter back on
If the user sets security.basic.enabled=false he has to remember
to @EnableWebSecurity.  Possibly we could be more helpful about the
exception, but I think this might be pilot error.

Fixes gh-568
2014-03-25 07:51:25 +00:00
Phillip Webb
d42bedf295 Rename @ConfigurationProperties attributes
Rename `name` to `prefix` and `path` to `locations`.
2014-03-24 11:44:52 -07:00
brockwmills
8b77a0298f Allow multiple connectors with Tomcat
Update TomcatEmbeddedServletContainerFactory to allow for additional
containers (e.g. SSL or AJP in addition to HTTP).

Fixes gh-528
2014-03-21 11:10:11 -07:00
Phillip Webb
47eb8180b3 Rename spring-boot-starter-shell -> remote-shell
Fixes gh-462
2014-03-21 09:05:56 -07:00
Phillip Webb
632af6b1ab Polish gradle examples
Spaces -> Tabs, version number, whitespace.
2014-03-19 16:50:55 -07:00
Phillip Webb
4024450c5f Rename starter-shell-remote to starter-shell
Fixes gh-462
2014-03-19 16:28:36 -07:00
Andy Wilkinson
a20f8b4be0 Add missing JQuery and Bootstrap dependencies
Fixes #531
2014-03-19 11:42:01 +00:00
Andy Wilkinson
e90bc49988 Add dependency on spring-boot-starter-test
Fixes #530
2014-03-19 11:32:25 +00:00
Phillip Webb
08b9592606 Polish spaces -> tabs 2014-03-18 10:23:54 -07:00
Dave Syer
a8ba80bbf4 Add build.gradle samples and docs for deployable WAR
Fixes gh-518
2014-03-18 09:29:35 +00:00
Phillip Webb
c5ee3c7eba Remove duplicate documentation
Remove README files that have been since been migrated to the reference
documentation. Also updated remaining markdown files to asciidoctor to
save having a mix of different formats.

Fixed gh-503
2014-03-16 23:00:12 -07:00
Phillip Webb
80ac1fb0cd Polish 2014-03-15 13:02:01 -07:00
Phillip Webb
22e397cda2 Polish 2014-03-13 13:11:54 -07:00
kozazz
ba9f92e74f Add validation test to ws sample
Fixes gh-481
2014-03-12 09:28:55 +00:00
Dave Syer
d82a728efe Remove redundant managed dependency version 2014-03-12 09:24:51 +00:00
Dave Syer
14d52b6c18 Avoid creating a new EmbeddedServletContainerFactory for websockets
User can now also switch off and customize the websockets customizer by adding
a bean named "websocketContainerCustomizer".

Fixes gh-479
2014-03-12 09:21:07 +00:00
Dave Syer
34efda1890 Remove duplicate dependency declaration in sample
Fixes gh-476
2014-03-11 19:39:12 +00:00
Dave Syer
7a285cf65d Convert all sample tests to @IntegrationTest where appropriate
Makes them a lot more readable IMO, and also enables @Autowiring
from the context into the test case (sweeet). I added @DirtiesContext
to all of them as well to be on the safe side, but possbly that can be
optimized in some way as well.
2014-03-11 13:54:30 +00:00
Dave Syer
6657e3ef84 More care taken with management.contextPath
The management.contextPath property should now be respected in a
secure application, whether or not the management.port is different.

Added some test cases in the sample to verify.

Fixes gh-469
2014-03-10 16:28:13 +00:00
Sebastien Deleuze
ab6c8dfee3 Use org.springframework.boot groupId in spring-boot-samples
Use org.springframework.boot instead of ${project.groupId}
groupId in order to make it easier to use spring-boot-samples
modules as a starting point for new projects.
2014-03-07 17:02:20 +00:00
Dave Syer
77fd127e09 Use redis starter in sample 2014-03-05 17:25:36 +00:00
Dave Syer
de9b6a6a22 Switch off debug in secure sample
Fixes gh-438
2014-03-05 14:46:31 +00:00
Dave Syer
3bc37ddde0 Strip out most of websocket autoconfig
... leaving only the embedded Tomcat enabling feature (registering
the WsSci).

Fixes part of gh-65
2014-03-04 16:25:10 +00:00