Commit Graph

5742 Commits

Author SHA1 Message Date
Oliver Gierke
123b90fa64 Register all packages where @EnableAutoConfiguration is used
Previously, when @EnableAutoConfiguration was used in multiple packages,
the last @EnableAutoConfiguration that was processed would
win and only its package would be stored as an auto-configuration
package.

This commit updates AutoConfigurationPackages to allow multiple package
name registrations. AutoConfigurationPackages.set(…) has been altered to
augment the constructor arguments of the BeanDefinition registered for
the initial call to the method so that the packages handed to the method
call will be added to the bean definition and not replace the previous
ones. The method has been renamed register(…) to reflect the changed
behavior.

Closes gh-1994
2014-11-26 11:21:58 +00:00
Andy Wilkinson
a83f9c6311 Correct markup in documentation of how to configure Undertow 2014-11-26 10:55:33 +00:00
Andy Wilkinson
d1cb3c7ce1 Polish names in pom.xml of Jersey and Cloud Connectors starters 2014-11-26 10:47:49 +00:00
Andy Wilkinson
d5b7f49f83 Merge branch '1.1.x' 2014-11-26 10:22:06 +00:00
Andy Wilkinson
9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 2014-11-26 10:21:57 +00:00
Spencer Gibb
2fb4d2ece6 Check if managementServerProperties.getSecurity() is not null
before checking isEnabled(). It is explicitly constructed as null
in ManagementServerProperties to prevent class not found errors
at runtime when Security is not on the classpath.

Fixes gh-2003, fixes gh-2004
2014-11-26 07:59:22 +00:00
Dave Syer
3bb598a421 Only hide /health details if the app is actually secure
Also gives the user the option to override (by setting
endpoints.health.sensitive=false).

Fixes gh-1977 in a slightly different way
2014-11-25 16:40:18 +00:00
Andy Wilkinson
337e9bd013 Use and wait for a latch to check that the interceptor is called
Spring MVC drives the postHandle method on any interceptors after the
response has been sent to the client. This meant that there was a
race between the test receiving the response and asserting that the
interceptor had been driven and Spring MVC driving the interceptor.

This commit updates the interceptor to use a CountDownLatch to track
whether or not it's been called. The test now waits for up to 30
seconds for the latch to be decremented.

Closes gh-1997
2014-11-25 14:19:07 +00:00
Andy Wilkinson
55fadf1231 Merge branch '1.1.x' 2014-11-25 13:54:06 +00:00
Andy Wilkinson
02e925cb4e Merge branch 'gh-1989' into 1.1.x 2014-11-25 13:53:57 +00:00
Andy Wilkinson
2b4eee5e53 Add a note explaining that double backslashes are unnecessary in YAML
Closes gh-1989
2014-11-25 13:52:26 +00:00
Sjoerd Mulder
cc557833a4 Escape backslashes in .properties examples of setting internal-proxies
In a properties file, a backslash is used as an escape character for
the line terminator sequence to allow values to be split across
multiple lines. When a backslash is used elsewhere they're stripped
out of the property's value.

This commit updates .properties-based examples for configuring
server.tomcat.internal-proxies to escape the backslahes so that they
are retained in the property's value at runtime.

See gh-1989
2014-11-25 13:39:25 +00:00
Andy Wilkinson
092b861ee3 Merge branch '1.1.x' 2014-11-25 12:32:21 +00:00
Andrea Vacondio
9ef8335881 Fix broken link to the MVC section of the Spring reference docs
Closes gh-1998
2014-11-25 12:31:57 +00:00
Andy Wilkinson
a708b28d9d Document restrictions when /health is accessed anonymously
Closes gh-1978
2014-11-25 12:22:23 +00:00
Andy Wilkinson
26a511495e Allow the user to opt-out of anonymous access restrictions for /health
By default, when /health is accessed anonymously, the details are
stripped, i.e. the response will only indicate UP or DOWN. Furthermore
the response is cached for a configurable period to prevent a denial
of service attack.

This commit adds a configuration property,
endpoints.health.restrict-anonymous-access, that can be set to false
to allow full anonymous access to /health. When full access is
allowed, the details will be included in the response and the response
will not be cached.

Closes gh-1977
2014-11-25 12:04:45 +00:00
Andy Wilkinson
5854ea189e Make TestInterceptor thread-safe
Previously, TestInterceptor used an int to keep a count of how often
it had been called. The count was incremented on one thread and
read on another thread. This lead to intermittent test failures as the
field was not declared volatile and a stale value would sometimes be
returned.

This commit updates TestInterceptor to use an AtomicInteger that's
held in a final field. This ensures that getCount() will not return
stale values and also ensures that the count can safely be incremented
concurrently.

Closes gh-1997
2014-11-25 10:52:34 +00:00
Andy Wilkinson
023d5bea3b Merge branch '1.1.x' 2014-11-25 10:51:44 +00:00
Andy Wilkinson
feddb2e8a1 Note that @IntegrationTest and @WebAppConfiguration can be used with Spock
Closes gh-1908
2014-11-25 10:51:27 +00:00
Andy Wilkinson
6d97785030 Add a plain JPA sample application
Closes gh-1761
2014-11-25 10:23:32 +00:00
Stephane Nicoll
4402c6b4a0 Haromonize configuration keys to lowercase hyphen 2014-11-25 09:00:02 +01:00
Stephane Nicoll
76451d13f5 Add metadata for info.*
Closes gh-1993
2014-11-24 21:32:49 +01:00
Stephane Nicoll
c05b387457 Add metadata for logging.level
Closes gh-1992
2014-11-24 21:22:25 +01:00
Andy Wilkinson
efe50ebcad Document WebSocket exclusions that are required when using Jetty 8
Closes gh-1969
2014-11-24 16:59:07 +00:00
Andy Wilkinson
27569f5845 Add an EL implementation to the Undertow Starter
Unlike the Tomcat and Jetty starters, the Undertow starter does not
provide an EL implementation. This leads to failures when you try to use
Hibernate Validator with the Undertow starter.

To bring the Undertow starter into line with the other two embedded
container starters, this commit adds Glassfish’s EL implementation to
the Undertow starter. This is the implementation that’s used by the
Jetty starter. If/when Undertow provides JSP support and, therefore,
starts using EL itself, we should align with it.

Closes gh-1979
2014-11-24 11:34:15 +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
Andy Wilkinson
d5ad502d31 Disable Undertow auto-config if required XNIO classes are unavailable
Fixes gh-1986
2014-11-24 10:46:11 +00:00
Stephane Nicoll
dea1ca9855 Update description of property type 2014-11-24 10:38:13 +01:00
Dave Syer
9db86bbd2a Lookup metadata bean from context instead of injecting
That way, if there is one, it will always be the right one
(otherwise you might be processing teh parent context with
metadata from the child).

Fixes gh-1982
2014-11-23 11:16:45 +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
e56a1ba561 Refine inner class detection algorithm
Update the ConfigurationMetadataAnnotationProcessor nested class
algorithm to prevent inner classes being added as both groups and
properties.

Fixes gh-1975
2014-11-21 14:16:37 -08:00
Phillip Webb
2a9a749329 Polish 2014-11-21 13:27:19 -08:00
Phillip Webb
5220f584db Revert spring-boot-configuration-metadata for now
See gh-1970
2014-11-21 11:43:34 -08:00
Stephane Nicoll
2f4a46a180 Associate logging.* properties to group 2014-11-21 17:43:32 +01:00
Stephane Nicoll
2b19955cee Remove useless System.out.println 2014-11-21 17:39:42 +01:00
Stephane Nicoll
7b4de0921f Remove useless @ConfigurationProperties
Fixes gh-1972
2014-11-21 17:39:12 +01:00
Stephane Nicoll
32efff3f30 Avoid creating a nested group for an Enum
Previously, an Enum that is defined as an inner class of a
@ConfigurationProperties pojo was wrongly detected as an nested group.

This case is now handled explicitly and covered by a test.

Fixes gh-1971
2014-11-21 17:20:35 +01:00
Stephane Nicoll
5f673c9e84 Fix usage of putIfAbsent 2014-11-21 16:13:26 +01:00
Stephane Nicoll
0f64a04780 Add easy way to consume configuration metadata
Add a companion module that IDE developers can use to read configuration
metadata from multiple sources into a single repository.

ConfigurationMetadataRepository provides access to groups and items as
well as an harmonized view on "sources" (that is the POJOs that have
contributed to a given group).

Closes gh-1970
2014-11-21 16:02:04 +01:00
Dave Syer
5b044356dc Clarify the deprecation status of HttpMapperProperties 2014-11-21 09:19:32 +00:00
Phillip Webb
08988fd182 Update docs about Jetty 9 and Tomcat 8
Fixes gh-1951
2014-11-20 17:55:15 -08:00
Phillip Webb
70a1438c6f Don't replace MappingJackson2HttpMessageConverter
Guard against Spring Data REST TypeConstrained Jackson converters
replacing the default MappingJackson2HttpMessageConverter.

Fixes gh-1968
2014-11-20 17:36:55 -08:00
Phillip Webb
bf0629522c Only use Gson if Jackson is missing
Update HttpMessageConvertersAutoConfiguration to only register Gson
support when Jackson is not on the classpath.

Fixes gh-1967
2014-11-20 17:21:25 -08:00
Phillip Webb
2b57c5a4dd Rename spring.data.mongo.repositories.enabled
Rename mongo to mongodb.

Fixes gh-1966
2014-11-20 14:57:49 -08: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
Phillip Webb
eb035398b2 Add SqlScriptsTestExecutionListener
Update @IntegrationTest to include SqlScriptsTestExecutionListener.

Fixes gh-1965
2014-11-20 12:12:27 -08:00
Phillip Webb
2a8579026f Polish 2014-11-20 10:16:33 -08:00
Phillip Webb
182ce21542 Clarify configuration meta-data details
Update the configuration meta-data appendix to clarify a few things.
2014-11-20 10:07:02 -08:00