Commit Graph

987 Commits (e16f5d03ab8213ec2354f775b12886e9d25aab3f)

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
10 years ago
Andy Wilkinson d5b7f49f83 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9270303a9a Remove double “and” from DataSourceInitializer’s javadoc 10 years ago
Andy Wilkinson d5ad502d31 Disable Undertow auto-config if required XNIO classes are unavailable
Fixes gh-1986
10 years ago
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
10 years ago
Phillip Webb 2a9a749329 Polish 10 years ago
Dave Syer 5b044356dc Clarify the deprecation status of HttpMapperProperties 10 years ago
Phillip Webb 70a1438c6f Don't replace MappingJackson2HttpMessageConverter
Guard against Spring Data REST TypeConstrained Jackson converters
replacing the default MappingJackson2HttpMessageConverter.

Fixes gh-1968
10 years ago
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
10 years ago
Phillip Webb 2b57c5a4dd Rename spring.data.mongo.repositories.enabled
Rename mongo to mongodb.

Fixes gh-1966
10 years ago
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
10 years ago
Phillip Webb 2a8579026f Polish 10 years ago
Stephane Nicoll 11894a5412 Fix manual metadata format inconsistency
Fixes gh-1961
10 years ago
Dave Syer 12a7df6c40 Be defensive about classloader in MessageSourceAutoConfiguration
Fixes gh-1960
10 years ago
juzer 428d2caac1 Fixed potential ClassCastException getting error
Update DefaultErrorAttributes to expect a `Throwable` ERROR_ATTRIBUTE
rather than an `Exception`.

Fixes gh-1931
10 years ago
Phillip Webb c34cfb27a3 Polish 10 years ago
Phillip Webb 3a4d62fb3a Gracefully ignore placeholder exceptions
Update BeanTypeRegistry to gracefully ignore LoadBeanClassException and
BeanDefinitionStoreException exceptions in the same way as
DefaultListableBeanFactory.doGetBeanNamesForType() does.

Fixes gh-1955
10 years ago
Dave Syer 7fa0ea7c3b Add support for spring.jersey.type=filter
Fixes gh-1756
10 years ago
Dave Syer 3a4f1f6f39 Attempt to get Jersey working as filter 10 years ago
Andy Wilkinson 90af8bf54a Add auto-configuration for Jetty 9's WebSocket support
Closes gh-1269
10 years ago
Phillip Webb b583262211 Use SmartInitializingSingleton when possible
Switch implementations of ApplicationListener<ContextRefreshEvent> for
SmartInitializingSingleton when possible.

Fixes gh-1939
10 years ago
Andy Wilkinson 7a783f5a18 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 863c099161 Add missing copyright headers 10 years ago
Andy Wilkinson 1864d79077 Polish Undertow contribution
Closes gh-1779
10 years ago
sopov.ivan c501b889af Add support for using Undertow as an embedded container
See gh-1779
10 years ago
Andy Wilkinson f43d6925c5 Apply spring.jackson.* config to HypermediaAutoConfiguration’s ObjectMapper
Previously, HypermediaAutoConfiguration would trigger the creation of
an ObjectMapper bean named _halObjectMapper. This bean did not have the
spring.jackson.* configuration applied to it, however its presence
would revent JacksonAutoConfiguration from creating its
ObjectMapper. This left the user with an ObjectMapper that did not
honour the spring.jackson.* configuration.

This commit updates HypermediaAutoConfiguration to use the
Jackson2ObjectMapperBuilder that may have been created by
JacksonAutoConfiguration. If the builder exists it is used to configure
the _halObjectMapper bean.

Fixes gh-1949
10 years ago
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
10 years ago
Andy Wilkinson 6cfd6cad64 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 9eae29938c Test that http.mappers props are applied by JacksonAutoConfiguration
Closes gh-1919
10 years ago
Nicolás J. García f51b304c2a Update JackonAutoConfiguration to apply all http.mappers properties
Previously, only the http.mappers.json-sort-keys property was applied
by JacksonAutoConfiguration. This commit updates it to also apply the
http.mappers.json-pretty-print property as well.

See #1919
10 years ago
Andy Wilkinson b8d6b34038 Test that HttpMapper properties are only used when they’re defined
Closes gh-1923
10 years ago
Sebastien Deleuze c053540b03 Use HttpMapper properties only if defined
See gh-1923
10 years ago
Andy Wilkinson 05cf686713 Allow servlet context parmeters to be configured via declaratively
Previously, configuration of a ServletContext init parameter required
the use of a ServletContextInitializer bean. This commmit adds
support for declarative configuration via the environment using
server.context_parameters.<name>=<value>.

Closes gh-1791
10 years ago
Stephane Nicoll 16e2130896 Add missing properties metadata
Fixes gh-1829
10 years ago
Stephane Nicoll fba69821cc Fix typo 10 years ago
Spring Buildmaster 46b7738334 Next development version 10 years ago
Stephane Nicoll 630c145645 Fix order of JMS auto configuration
Add additional @AutoConfigureAfter elements to ActiveMQAutoConfiguration
and HornetQAutoConfiguration to ensure that they are configured after
JndiConnectionFactoryAutoConfiguration.

The possible sources for a JMS ConnectionFactory are:

1. JNDI
2. HornetQ (embedded broker or an external broker)
3. ActiveMQ (embedded broker or an external broker)

The last two auto configurations must run after JTA auto-configuration
has completed as it may register additional beans that are necessary to
enable XA.

Previously, the HornetQ embedded broker would start regardless of the
presence of a ConnectionFactory as a ConditionalOnMissingBean was
missing. Furthermore, there was no order condition for the JNDI
auto-configuration so it may just run after one of the broker has been
found.

JNDI takes now precedence to be consistent with the regular DataSource
auto configuration.

Fixes gh-1821
10 years ago
Phillip Webb 8cac63e239 Drop hibernate-jpa-2.0-api managed dependency
Fixes gh-1898
10 years ago
Phillip Webb b947d6001d Polish 10 years ago
Andy Wilkinson f9221e24ef Polish method name in HibernateJpaAutoConfiguration 10 years ago
Stephane Nicoll 109c3a3439 Auto configure CharacterEncodingFilter
Provide a default UTF-8 encoding for HTTP requests and responses unless
specified otherwise.

Fixes gh-1182
10 years ago
Phillip Webb 143a62b6bf Polish 10 years ago
Phillip Webb 3e1841a53b Remove JpaBaseConfiguration.configure() method
Remove the JpaBaseConfiguration.configure() method since it is no
longer called.

Fixes gh-1865
10 years ago
Phillip Webb 5811f6e3f5 Merge branch '1.1.x' 10 years ago
Phillip Webb 4f67a20214 Ensure JpaUserDetailsTests closes embedded DB
Fixes gh-1712
10 years ago
Phillip Webb b79934a7a4 Detect existing MultipartResolver beans
Update MultipartAutoConfiguration to detect any MultipartResolver beans
rather than just StandardServletMultipartResolvers.

Fixes gh-1857
10 years ago
Phillip Webb 8023ddd0c2 Rename AbstractBasicTemplateViewResolverProperties
Rename AbstractBasicTemplateViewResolverProperties to
AbstractViewResolverProperties.

See gh-1835
10 years ago
Stephane Nicoll 6d9abdc8ca Harmonize view resolver properties
Move shared properties to avoid duplication in GroovyProperties

Fixes gh-1835
10 years ago
Phillip Webb e76a571dd3 Add @SpringBootApplication annotation
Add a new @SpringBootApplication which is equivalent to @Configuration,
@EnableAutoConfiguration and @ComponentScan.

See gh-1842
10 years ago
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
10 years ago
Phillip Webb 58d660d10d Allow DAO ExceptionTranslator to proxy classes
Update the auto-configured PersistenceExceptionTranslationPostProcessor
to proxy target classes as well as interfaces. Also provide a config
property to disable registration all together.

Fixes gh-1844
10 years ago
Michael Cramer f966b3b1b7 Provide Liquibase -> Commons Logging adapter
Add `CommonsLoggingLiquibaseLogger` implementation to adapt Liquibase's
`Logger` to Apache Commons Logging.

The `LiquibaseAutoConfiguration` class has also been updated to
automatically use the adapter

Fixes gh-1840
10 years ago
Phillip Webb ba0dd60de9 Rename charSet to charset
Rename AbstractTemplateViewResolverProperties.setCharSet/getCharSet to
setCharset/getCharset, deprecating the old method.

Fixes gh-1835
10 years ago
Phillip Webb b6bacd5e8a Upgrade to Servlet 3.1, Tomcat 8 and Jetty 9
Upgrade to latest versions of Tomcat and Jetty and to the latest Servlet
API whilst will remaining compatible with Tomcat 7 and Jetty 8.

Fixes gh-1832, gh-369
10 years ago
Phillip Webb edaed415fb Polish 10 years ago
Stephane Nicoll 9dec27e7bf Permit to disable JTA using a single property
Disable JTA auto-configuration altogether with a simple property. This
can be useful if the environment is JTA capable but the application does
not require it.

Fixes gh-1457
10 years ago
Stephane Nicoll 814803046a polishing 10 years ago
Stephane Nicoll 47cd9e0765 Fix ConditionalOnJndi evaluation
Enable ConditionalOnJndi evaluation and add tests that validate it works
as expected

Fixes gh-1820
10 years ago
Stephane Nicoll cbd3c39640 Override StringHttpMessageConverter with UTF-8
Override the default StringHttpMessageConverter provided by the standard
Spring MVC configuration so that is uses UTF-8 instead of the aging
default of the servlet spec (that is ISO-8859-1)

Fixes gh-1800
10 years ago
Phillip Webb 43c07e8b44 Protect against duplicate datasource MBeans
See gh-1590
10 years ago
Phillip Webb a973fd41f4 Polish 10 years ago
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
10 years ago
Dave Syer 3e97cdbc3b Trim some fat from groovy templates
The old resolver class is deprecated already, and there's no reason
to continue to support the View and View resolver implementations
from Boot 1.1, so I removed those. Also there is no need to support
older versions of Groovy, so I removed a config class that was
conditional on a groovy version (by looking for the markup support).

Fixes gh-1578
10 years ago
Brian Clozel 18b8929335 Migrate to groovy templates from Spring 4.1
Update `GroovyTemplateAutoConfiguration` to use Spring 4.1 Groovy
Markup Template infrastructure instead of Boot's.

Fixes gh-1552
10 years ago
Stephane Nicoll a46396f691 Add @NestedConfigurationProperty meta-data support
Add a @NestedConfigurationProperty annotation which can be used to
customize how configuration mete-data is generated.

Prior to this commit only inner-classes where considered nested
(see Tomcat in ServerProperties). Using this new annotation, the Ssl
property in ServerProperties can be detected as well.

See gh-1001
10 years ago
Stephane Nicoll fbf8f56a97 Generate standard configuration meta-data
Update the `spring-boot`, `spring-boot-autoconfigure` and
`spring-boot-actuator` project to generate configuration meta-data
files during compilation.

See gh-1001
10 years ago
Phillip Webb 45b579c439 Improve OnBeanCondition Performance
Update OnBeanCondition to use a new BeanTypeRegistry which includes
optimized code when using a DefaultListableBeanFactory. The optimized
version calculates bean types only once per bean and caches the result.

Prior to this change the sample "pet clinic" application would spend
400-500 milliseconds evaluating OnBeanConditions, after this change it
spends around 120 milliseconds.

Fixes gh-1803
10 years ago
Phillip Webb a490aef888 Merge remote-tracking branch 'springsource/1.1.x'
Conflicts:
	spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java
10 years ago
Phillip Webb 8ba71c88f5 Polish 10 years ago
Dave Syer b20d02a31d Make a lazy AuthenticationManager if we think it's already configured
Instead of just blindly creating the default authentication manager, after
thic change we count the beans of type GlobalAuthenticationManagerConfigurer
and assume that if we detect more than we expect (one from Boot and one from
Spring Security) then the user is telling us they want to configure the
AuthenticationManager themselves.

Fixes gh-1801
10 years ago
Phillip Webb 8e16dfc951 Polish 10 years ago
Dave Syer f15cb7a720 Add tests for AuthenticationManager injected into security configurer
See gh-1801
10 years ago
Andy Wilkinson 36ffad2bb7 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 0f17142366 Make GroovyWebConfiguration conditional on spring-webmvc's availability
GroovyWebConfiguration creates a GroovyTemplateViewResolver which is
a UrlBasedViewResolver sub-class. UrlBasedViewResolver is provided
by spring-webmvc. Previously, if a user configured a web application
but did not have spring-webmvc on the classpath, the application
would fail to start with a NoClassDefFoundError for
UrlBasedViewResolver.

This commit makes GroovyWebConfiguration conditional on
UrlBasedViewResolver being on the classpath so that it backs of in
the absence of spring-webmvc.

Fixes gh-1793
10 years ago
Andy Wilkinson 0cdb1d3f22 Make Spring Security's filter's order configurable and default to zero
Previously, Spring Security's filter had no configured order. Due to
the use of AnnotationAwareOrderComparater this meant that its order
defaulted to LOWEST_PRECEDENCE. This meant that a user had to declare
a FilterRegistrationBean for the filter and explicitly set its order
if they want another filter to run after Spring Security's.

This commit updates the security auto-configuration to assign a
default order of zero to Spring Security's filter, allowing filters
to be easily configured to run before it or after it. This default
value can overridden using the server.filter-order property. The
default order is also exposed as a constant on SecurityProperties,
allowing it to be referenced from other filter declarations.

Closes gh-1640
10 years ago
Phillip Webb d17b7c8195 Polish 10 years ago
Andy Wilkinson 466ed469eb Merge branch '1.1.x' 10 years ago
Andy Wilkinson e2dd659dd1 Include condition's location (class or method name) in message
Closes gh-1787
10 years ago
Andy Wilkinson 8a1e010d0a Allow multiple templateLoaderPaths to be configured for FreeMarker
Closes gh-1767
10 years ago
Andy Wilkinson ef2455938e Align new JavaMail dependencies with Spring IO Platform
Spring IO Platform already provides dependency management for JavaMail.
This commit updates Boot’s new JavaMail dependency management to align
with the Platform, thereby allowing the Platform to inherit Boot’s
dependency management instead of defining its own.
10 years ago
Stephane Nicoll 429da743f5 Add missing close 10 years ago
Stephane Nicoll ccc5e65779 Add email support
This commit adds a new starter to auto-configure a MailSender when the
necessary classes are present and when the property "spring.mail.host" is
set.

The auto-configuration also accepts any arbitrary properties that
JavaMail might need using the "spring.mail.properties" prefix.

Fixes gh-1760
10 years ago
Sebastien Deleuze 7546f10aad Fix a typo in error.whitelabel.enabled 10 years ago
Dave Syer 015377f9de Exclude log4j in a couple of places (see gh-1660)
also rename spring-cloud starter
10 years ago
Andy Wilkinson cebfd44d16 Upgrade to Spring AMQP 1.4.0.RC1 10 years ago
Dave Syer f39d4978c3 Fix tests for JSON error rendering
See gh-1762
10 years ago
Dave Syer 254ab55476 Re-arrange priority of error message 10 years ago
Dave Syer 7bac7370c8 Use request attribute if available for error message
Fixes gh-1762, gh-1731
10 years ago
Phillip Webb 2e7aa4685b Polish 10 years ago
Phillip Webb d1ce83e3c3 Merge branch '1.1.x' 10 years ago
Phillip Webb 41b2e58476 Polish 10 years ago
Stephane Nicoll d2198c417d Fix ConnectionFactory auto-configuration with XA
Previously, the regular jms connection factory was always overriding
the xaConnectionFactory when using ActiveMQ. While
ActiveMQAutoConfiguration is namely shielded with a condition on a
missing ConnectionFactory bean, said configuration class also imports the
XA and regular configuration classes that both can create the connection
factory.

This commit adds a ConditionalOnMissingBean in the second class that is
imported in case the XA configuration has already defined what it needs.

Fixes gh-1727
10 years ago
Andy Wilkinson 31874090b8 Fix ArrayStoreException caused by JerseyAutoConfiguration again
This is a follow-on from the changes made in 2b7bf3e. In addition to the
problematic use of @ConditionalOnClass that was addressed in 2b7bf3e,
JerseyAutoConfiguration also used @ConditionalOnBean referencing a 
Jersey class. This has the same problem when used on a class that
implements WebApplicationInitializer. Implementing
WebApplicationInitializer causes the class’s annotations to be
introspected during servlet container initialiser processing. If a
@ConditionalOnBean annotation references a Class that cannot be
loaded an ArrayStoreException occurs.

This commit updates JerseyAutoConfiguration to reference ResourceConfig
as a String. This allows it annotations to be introspected without
attempting to load a Jersey class that may not be on the classpath.

Fixes gh-1733
Fixes gh-1719
10 years ago
Brett Wooldridge 9984939c47 Update HikariCP to 2.1.0, compile against the Java 6-compatible artifact
For those running applications on Java 8, dependency management for the
Java 8-compatible artifact is also provided.

Closes gh-1721
10 years ago
Andy Wilkinson 01fd8cb8f3 Reinstate Bitronix's default server ID, provide property to override it
Previously, Bitronix's server ID was hard-coded to be
spring-boot-jta-bitronix. This created the possibility of multiple
transaction managers performing recovery on each other's behalf as
they would be unable to identify their own XIDs due to the common
server ID.

This commit reinstates the default (which is the IP address of the
machine on which Bitronix is running), and introduces a new
property, spring.jta.transaction-manager-id, that can be used to
configure the id for both Atomikos and Bitronix. A cautionary note
has also been added to the documentation for Atomikos and Bitronix
explaining the need to configure this property.

Closes gh-1548
10 years ago
Andy Wilkinson 261b3afca1 Apply spring.jackson.* config to Spring Data REST object mappers
Closes gh-1698
10 years ago
Andy Wilkinson 9a2d654eba Rename test classes so that their tests are run by Maven 10 years ago
Andy Wilkinson 0a3d8a9bfb Merge branch '1.1.x' and fix failure caused by XML response
Spring 4.1 has added support for XML HTTP message conversion using
Jackson. This was resulting in the response being sent back as XML
rather than JSON. Jackson's XML support doesn't cope well with lists
when it's being asked to deserialize to a Map [1] which is what the
test was doing.

This commit updates the test to indicate that it only accepts
application/json, thereby ensuring that the response can be correctly
deserialized into a Map.

Fixes gh-1715

[1] https://github.com/FasterXML/jackson-dataformat-xml/issues/122
10 years ago
Andy Wilkinson fff94733ef Rename class so Maven runs its tests
Maven is configured to run tests found in classes ending in Tests.
This meant that the tests in BasicErrorControllerIntegrationTest (note
the missing s) were not being run.

This commit renames the test class so that it's picked up by Maven.
10 years ago
Dave Syer cd3729b49d Merge branch '1.1.x' 10 years ago
Dave Syer ecee19057c Add some precautionary tests for documenting AuthenticationManager config 10 years ago
Andy Wilkinson a156ae3434 Add missing @since tag 10 years ago
Stephane Nicoll e60cc57807 Fix typo
Fixes gh-1701
10 years ago
Andy Wilkinson 4b9f14f55b Separate out the auto-configuration of Spring Data’s web support
Previously, Spring Data’s web support was auto-configured as part of the
JPA repositories auto-configuration. However, Spring Data’s web support
isn’t dependent on the use of Spring Data JPA or even repositories.

This commit moves the auto-configuration into a standalone class, making
it independent of the use of Spring Data JPA and Spring Data
repositories.

Closes gh-1097
10 years ago
Andy Wilkinson 2b7bf3e733 Fix ArrayStoreException caused by JerseyAutoConfiguration
JerseyAutoConfiguration is annotated with @ConditionalOnClass. It
references both SpringComponentProvider.class and
ServletRegistration.class. Normally, this wouldn't be a problem as, in
the absence of either of those classes, the configuration class bean
will not be present in the bean factory and, therefore, its
annotations will never be introspected using reflection.

However, JerseyAutoConfiguration is a WebApplicationInitializer. This
means that when it's deployed to a standalone container,
JerseyAutoConfiguration is found by the container and its class is
passed to SpringServletContainerInitializer.
SpringServletContainerInitializer introspects every
WebApplicationInitializer class so that it can order them. This blows
up if Jersey's SpringComponentProvider class isn't on the classpath as
the annotation is referencing SpringComponentProvider as a Class and
the attempt to load it fails. The problem can be avoided by
referencing SpringComponentProvider using a String.

Fixes gh-1696
10 years ago
Spring Buildmaster 3e71a21b30 Next development version 10 years ago
Phillip Webb c40aab657f Don't import JmsBootstrapConfiguration directly
Remove the direct unconditional JmsBootstrapConfiguration @Import from
JmsAnnotationDrivenConfiguration in favor of the nested
EnableJmsConfiguration class.

Fixes gh-1513
10 years ago
Phillip Webb 517b40d9b9 Don't call close() on JNDI DataSource
Update the JNDI auto-configured DataSource so that the close method
isn't called when the ApplicationContext is closed.

Fixes gh-1520
10 years ago
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
10 years ago
Phillip Webb 001f2d6c69 Improve performance of MessageSource condition
Update the MessageSourceAutoConfiguration condition to skip scanning for
well known JARs. Results are now also cached.

Fixes gh-1689
10 years ago
Phillip Webb dca637f51f Replace @ConditionalOnExpression with OnProperty
Replace where possible all @ConditionalOnExpression annotations with
@ConditionalOnProperty which is both faster to run and more descriptive.

Fixes gh-1685
10 years ago
Phillip Webb b87a591d27 Revert "Add ActiveMQ MQTT connection URL auto-detection"
This reverts commit 0d8bde58c9.

Fixes gh-1679
10 years ago
Phillip Webb 30f8954b4a Add @since tag 10 years ago
Phillip Webb 6281070d0a Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
10 years ago
Phillip Webb 6009f41782 Polish 10 years ago
Andy Wilkinson 4cf9e0457f Provide auto-configuration of persistence exception translation
Closes gh-1435
10 years ago
Dave Syer fa95a6f6bd Merge branch '1.1.x' 10 years ago
Dave Syer 3135c7f8ae Escape strings in whitelabel error page (HTML) 10 years ago
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
10 years ago
Henryk Konsek 0d8bde58c9 Add ActiveMQ MQTT connection URL auto-detection
Fixes gh-1638
10 years ago
Michael Stummvoll 5d32ec7463 Add VelocityProperties.preferFilesystemAccess
Update VelocityProperties to include a preferFilesystemAccess attribute.

Fixes gh-1652
10 years ago
Phillip Webb 62eb01f0b8 Polish 10 years ago
Sebastien Deleuze 315213ea4e Support Jackson based XML serialization and Jackson2ObjectMapperBuilder
This commit introduces support for Jackson based XML serialization, using the
new MappingJackson2XmlHttpMessageConverter provided by Spring Framework
4.1. It is automatically activated when Jackson XML extension is detected on the
classpath.

Jackson2ObjectMapperBuilder is now used to create ObjectMapper and XmlMapper
instances with the following customized properties:
 - MapperFeature.DEFAULT_VIEW_INCLUSION is disabled
 - DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabled

JodaModuleAutoConfiguration and Jsr310ModuleAutoConfiguration have been removed
since their behaviors are now handled directly by the ObjectMapper builder.

In addition to the existing @Bean of type ObjectMapper support, it is now
possible to customize Jackson based serialization properties by declaring
a @Bean of type Jackson2ObjectMapperBuilder.

Fixes gh-1237
Fixes gh-1580
Fixes gh-1644
10 years ago
Stephane Nicoll 30351c6277 Provide native JtaTransactionManager when applicable
This commit updates JndiJtaConfiguration to provide the same detection
algorithm as <tx:jta-transaction-manager>. If a native JTA transaction
manager exists for the current platform, it is used instead of the regular
JtaTransactionManager implementation.

Fixes gh-1576
10 years ago
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
10 years ago
Andy Wilkinson de8a2a71d0 Turn (Jackson|Gson)AutoConfiguration into true auto-configuration
Previously JacksonAutoConfiguration and GsonAutoConfiguration were
not actually auto-configuration classes. They were only processed
due to being imported by HttpMessageConvertersAutoConfiguration.
In addition to being misleadingly named, this meant that they could
not be included or excluded individually and were also tightly coupled
to HTTP message conversion.

This commit updates spring.factories to make both
JacksonAutoConfiguration and GsonAutoConfiguration actual
auto-configuration classes. As a result, they can now be enabled or
disabled individually and are no longer coupled to HTTP message
conversion.

Closes gh-1562
10 years ago
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
10 years ago
Andy Wilkinson c601c09ecc Upgrade to Hibernate Validator 5.1.2.Final
Closes gh-1595
10 years ago
Dave Syer 8d5f26f6bd Fix missing resource exception if spring-cloud not on classpath 10 years ago
Marcel Overdijk e070d55491 Make Jackson date format and property naming strategy configurable
Allow the environment to be used to configure Jackson's date format
and property naming strategy

Closes gh-1628
10 years ago
Phillip Webb a7a337a14f Merge branch '1.1.x' 10 years ago
Phillip Webb d0990c06a6 Fix typo in HttpMessageConverters auto-conf Tests 10 years ago
Spring Buildmaster edb4b7ed7d Next development version 10 years ago
Phillip Webb 08f2522eba Add missing @since tag 10 years ago
Phillip Webb 1ed90df630 Merge branch '1.1.x' 10 years ago
Phillip Webb bff39e954e Add `server.tomcat.port-header` support
Update Tomcat ServerProperties to support the RemoteIpValve portHeader
property.

Fixes gh-1616
10 years ago
Phillip Webb 0dc46a2fe7 Drop protocolHeader and remoteIpHeader defaults
The `protocolHeader` and `remoteIpHeader` no longer have default values
and must be opt-in.

Fixes gh-1624
10 years ago
Phillip Webb abed1f4d4c Restore ThymeleafAutoConfiguration test
Restore the test removed during the merge.
10 years ago
Phillip Webb 38585ec4eb Merge branch '1.1.x' 10 years ago
Phillip Webb 258059ea08 Fix failing ThymeleafAutoConfigurationTests
Remove accidental addition of a 1.2 test.
10 years ago
Phillip Webb 0d0e5eb590 Merge branch '1.1.x' 10 years ago
Dave Syer 304920df07 Make Thymeleaf @ConditionalOnWebApplication
If user creates a Thymeleaf app with a parent-child context then the
child should contain all the web-specific pieces (and they are likely
to fail fast if they need to be ServletContextAware, or slower if they
try to locate a WebApplicationContext at runtime). This can't happen
if the view resolver is being added to the parent.

Freemarker and Velocity already have similar tests because it is assumed
that they should be usable outside a web app, so this change just does the
same for Thymeleaf.

Fixes gh-1611
10 years ago
Phillip Webb 0b50fe4eff Support String to char[] bindings
Update RelaxedConversionService to also support String to char[]
conversion. Primarily to support the `password` field in
MongoProperties.

Fixes gh-1572
10 years ago
Andy Wilkinson 5d1a114aa6 Merge branch '1.1.x'
Redundant @ConditionalOnMissingBean annotation has been removed.
ActiveMQConnectionFactoryConfiguration is not auto-configuration and
is imported by ActiveMQAutoConfiguration which is protected by
@ConditionalOnMissingBean(ConnectionFactory.class)
10 years ago
Andy Wilkinson cf22e28ddc Add tests to verify that ActiveMQAutoConfiguration backs off
See gh-1599
10 years ago
Andy Wilkinson 42821990f4 Merge branch '1.1.x' 10 years ago
Tomas Lin 38d8a5cda0 Fix typo in comment
Closes gh-1596
10 years ago
Phillip Webb 0468cf5a8f Merge branch '1.1.x' 10 years ago
Phillip Webb 468db03aef Formatting 10 years ago
Dave Syer b06d10ddb0 Merge branch '1.1.x' 10 years ago
Dave Syer d6165d97dd A few tweaks that might improve performance on startup
... or couldn't hurt anyway.

1. Extends the definition of a web application for @ConditionalOnWebapp
so that a StandardEnvironment can be used (cutting out JNDI failures
for Environment properties)

2. Doesn't bother using StandardServletEnvironment in integration tests

3. Make the NON_ENUMERABLE_ENUMERABLES in PropertySourcesPropertyValues
static so they only get initialized once (not a huge issue at all)
10 years ago
Phillip Webb 3c5b007ff9 Add @Order annotations to conditions
Fixes gh-1574
10 years ago
Andy Wilkinson 3c93d9a803 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 6dcaec2fef Make all @Bean methods public
This is a continuation of the changes made in 611f978. It makes some
more @Bean methods public and adds tests to spring-boot-actuator and
spring-boot-autoconfigure to prevent against non-public methods being
introduced in the future

Closes gh-1571
10 years ago
Phillip Webb 88f8eb7fa4 Merge branch '1.1.x' 10 years ago
Phillip Webb 611f978181 Make all @Bean methods public
Fixes gh-1571
10 years ago
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
10 years ago
Phillip Webb 62a5ce52d0 Backport Jetty/Tomcat SSL support
Fixes gh-1570
Cherry-picked from 0960908 and 258c6f1
10 years ago
Phillip Webb c0f69d28d3 Remove inadvertently committed debug System.out 10 years ago
Dave Syer 5946ade199 Merge branch '1.1.x' 10 years ago
Dave Syer 95c15733bc Use ErrorController.getErrorPath() to ignore the error path for security
Fixes gh-1548 again
10 years ago
Andy Wilkinson e8ce93715a Merge branch '1.1.x' 10 years ago
Andy Wilkinson eed58eecb4 Improve error handling in EnableAutoConfigurationImportSelector
Previously, EnableAutoConfigurationImportSelector assumed that it
would always find auto-configuration attributes from an
@EnableAutoConfiguration annotation. This assumption does not hold
true in certain circumstances, although exactly what those
circumstances are is unclear. It could occur if the import selector
were used directly, but it's package-private making that unlikey. In
such circumstances a NullPointerException was being thrown.

This commit asserts that the attributes are non-null and, should the
assertion fail, produces an error that is more helpful than an NPE.

Closes gh-1512
10 years ago
Andy Wilkinson 284e7b2091 Merge branch '1.1.x' 10 years ago
Andy Wilkinson 468b6cb1f7 Add support for configuring RemoteIpValve’s internalProxies
Closes gh-1522
10 years ago
Andy Wilkinson 4b25b0e7a2 Allow Jackson features to be configured via the environment
Enhance JacksonAutoConfiguration to configure features on the
ObjectMapper it creates based on the following configuration
properties:

spring.jackson.deserialization.* = true|false
spring.jackson.generator.* = true|false
spring.jackson.mapper.* = true|false
spring.jackson.parser.* = true|false
spring.jackson.serialization.* = true|false

The final part of each property name maps onto an enum. The enums are:

deserialization: com.fasterxml.jackson.databind.DeserializationFeature
generator: com.fasterxml.jackson.core.JsonGenerator.Feature
mapper: com.fasterxml.jackson.databind.MapperFeature
parser: com.fasterxml.jackson.core.JsonParser.Feature
serialization: com.fasterxml.jackson.databind.SerializationFeature

Closes gh-1227
10 years ago
Phillip Webb 26ac68df05 Polish Redis sentinel support 10 years ago
Phillip Webb b129bc261a Polish 10 years ago
Phillip Webb 565e449d89 Merge branch '1.1.x'
Conflicts:
	spring-boot-docs/src/main/asciidoc/howto.adoc
10 years ago
Phillip Webb 5ba86a103d Polish 10 years ago
Andy Wilkinson c02804931f Merge branch '1.1.x' 10 years ago
Andy Wilkinson 6f9f335ea1 Add additional class conditions for JTA auto-configuration
Previously, JTA auto-configuration would fail with a variety of
ClassNotFoundExceptions and NoClassDefFoundErrors if it was used with
an “incomplete” classpath. This commit adds a number of classes to
@ConditionalOnClass annotations so that the auto-configuration backs
off gracefully in the absence of certain classes.

Specifically, the following now work as expected:

 - Deploying an app to a server with JTA available via JNDI when the
   app does not use transactions
 - Auto-configuration of Atomikos without JMS
 - Auto-configuration of Bitronix without JMS

Both XADataSourceAutoConfiguration and JndiDataSourceAutoConfiguration
have been updated to back off in the absence of spring-jdbc; a
dependency of DataSourceProperties which is used by both classes.

Error handling in AtomikosDependsOnBeanFactoryPostProcessor and
BitronixDependentBeanFactoryPostProcessor has been enhanced so that the
correct dependencies are established, even in the absence of JMS.

Fixes gh-1538
10 years ago
Dave Syer 6456f2a542 Add url,user,password to LiquibaseProperties
User can set those properties (optionally) to use a different
DataSource than the default.

Fixes gh-1558
10 years ago
Dave Syer 59ce634437 Use class name not value to support non-Hibernate JPA vendors
With this change I got a simple Eclipselink version of the data-jpa
sample working. I'll push that when I get time to research it a bit more
(I needed to set up a Java agent so either that might be a problem
for our integration tests if we can't work around it).

Fixes gh-1268. Cherry picked onto master after (apparently) a failed
merge of commit ac2ab39.
10 years ago
Dave Syer 049cd4b85b Merge branch '1.1.x' 10 years ago
Dave Syer 437fb75424 Add /error to ignored paths for security autoconfig
Protecting /error doesn't make a great deal of sense and if it is
protected you don't get the ErrorPageFilter for the attempt at loading
it, so Tomcat renders its own HTML error page (when deployed as WAR).

Fixes gh-1548
10 years ago
Dave Syer 389c4f3e0b Merge branch '1.1.x' 10 years ago
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
10 years ago
Dave Syer 0950072b5e Fix integration test (shared context by accident) 10 years ago
Christoph Strobl c8a4891441 Add support for Redis Sentinel configuration
Spring Data Redis 1.4.0 introduced Redis Sentinel support. When
specified, RedisConnectionFactory uses the Sentinel configuration to
determine the current master.

Sentinel configuration can be specified using two new properties:
spring.redis.sentinel.master and spring.redis.sentinel.nodes.

For example:

spring.redis.sentinel.master=mymaster # name of redis server
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26380

Alternatively, a bean of type RedisSentinelConfiguration can be declared
and it will be used to configure the connection factory.

Note: At this time, Sentinel support is only available for Jedis

Closes gh-1337
10 years ago
Andy Wilkinson fbeb8c966c Upgrade to Spring Data Evans
The missing bean condition on the auto-configuration classes for
Elasticsearch, Jpa, Mongo and Solr repositories have been tightened to
look for ElasticsearchRepositoryFactoryBean, JapRepositoryFactoryBean,
MonoRepositoryFactoryBean, and SolrRepositoryFactoryBean respectively.

In Spring Data Evans, when there are multiple repository types on the
classpath, a strict mode is entered to prevent the different
repositories from trampling over each other. A side-effect of this is
that for the Mongo domain types in the tests to be discovered they
must be explicitly annotated with @Document.

Closes gh-1338
10 years ago
David Liu 8e9e502b6a Add support for auto-configuration of Commons DBCP2
Closes gh-1292
Closes gh-1477
10 years ago
Stephane Nicoll 02a8a9c07b Add auto configuration for Spring AMQP 1.4 features
This commit adds two additional auto-configuration items that are new
in Spring AMQP 1.4:

* A RabbitMessagingTemplate is automatically created if none is present
* A default RabbitListenerContainerFactory is automatically created if
none is present.

Besides @EnableRabbit is enabled automatically if the necessary classes
are present and a ConnectionFactory is available.

Fixes gh-1495
10 years ago
Phillip Webb 84249da941 Add @ConditionalOnBean to Thymeleaf dialect beans
Fixes gh-1507
10 years ago
Spring Buildmaster d63e4b4329 Next development version 10 years ago
Phillip Webb 4d27458fee Replace MongoProperties condition for spring-cloud
Replace @ConditionalOnBean(MongoProperties.class) on
MongoDataAutoConfiguration with @EnableConfigurationProperties since
MongoAutoConfiguration will not be applied in a cloud environment.

Fixes gh-1502
10 years ago
Phillip Webb 8bf1f9567a Apply eclipse formatting and cleanup rules 10 years ago
Andy Wilkinson 8399fc990c Verify that @EnableIntegrationMBeanExport can set custom JMX domain
Add a test to JmxAutoConfigurationTests which verifies that
@EnableIntegrationMBeanExport can be used on a @Configuration class
to customize the default domain used for MBeans created by Spring
Integration. See https://jira.spring.io/browse/SPR-12128.

Closes gh-1451
10 years ago
Phillip Webb 1697174cd8 Remove ExtendedPathMatchingResourcePatternResolver
Remove ExtendedPathMatchingResourcePatternResolver which is not required
with Spring 4.1

Fixes gh-1420
10 years ago
Phillip Webb f7cffce695 Allow custom JNDI ConnectionFactory lookup
Add a `spring.jms.jndi-name` property to allow a JMS ConnectionFactory
to be obtained from a custom JNDI location.

Fixes gh-1471
10 years ago
Phillip Webb 0326abfe01 Support for composed "any" condition
Add `AnyNestedCondition` which can be used to create a logical 'or' of
other conditions contained on nested classes. For example:

	static class OnJndiOrProperty extends AnyNestedCondition {

		@ConditionalOnJndi()
		static class OnJndi {
		}

		@ConditionalOnProperty("something")
		static class OnProperty {
		}

	}

Fixes gh-1490
10 years ago
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
10 years ago
Phillip Webb ba5c3526da Merge branch '1.1.x' 10 years ago
Phillip Webb 34cbcf5e50 Support better HttpMessageConverters manipulation
Add additional constructor and a protected postProcessConverters method
to make it easier to manipulate the final converter list that will
be used.

Fixes gh-1482
10 years ago
Phillip Webb 5774e808c7 Fix HornetQ ClassNotFound issues when not embedded
Update HornetQConnectionFactoryConfiguration and
HornetQXAConnectionFactoryConfiguration so that they no longer depend
on the HornetQ EmbeddedJMS class. EmbeddedJMS beans are started
(when possible) from the HornetQConnectionFactoryFactory.

Fixes gh-1480
10 years ago
Phillip Webb 4c8d35db43 Rename CompositeDataSourcePoolMetadataProvider
Rename CompositeDataSourcePoolMetadataProvider to
DataSourcePoolMetadataProviders.
10 years ago
Phillip Webb a512bcf766 Always auto-configure pool metadata providers
Import DataSourcePoolMetadataProvidersConfiguration from
DataSourceAutoConfiguration so that PoolMetadataProviders are configured
even if actuator is not used.
10 years ago
Phillip Webb 69107cb1df Create metadata sub-package
Create `org.springframework.boot.autoconfigure.jdbc.metadata` package
and move DataSourcePoolMetadata classes.
10 years ago
Phillip Webb e56be6cf3d DataSourceMetadata -> DataSourcePoolMetadata
Rename DataSourceMetadata to DataSourcePoolMetadata
10 years ago
Phillip Webb e17769fc2f Polish DataSourceMetrics code 10 years ago