Commit Graph

1348 Commits

Author SHA1 Message Date
Andy Wilkinson
41f0a5cdca Merge branch '1.3.x' 2016-02-29 13:01:18 +00:00
Andy Wilkinson
4eda91d6db Allow logging.file and logging.path to refer to logging system properties
Closes gh-5274
2016-02-29 12:32:47 +00:00
Andy Wilkinson
65234ce4a1 Start building against Spring Framework 4.3 snapshots
See gh-4900
2016-02-26 18:24:56 +00:00
Spring Buildmaster
225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson
06fb2d6d3e Upgrade to Log4j2 2.5
Closes gh-5242
2016-02-25 20:40:42 +00:00
Andy Wilkinson
01b7a7d9d3 Add missing copyright headers 2016-02-25 12:12:57 +00:00
Andy Wilkinson
44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Andy Wilkinson
6075682e64 Polishing
- Code formatting
 - Javadoc warnings
 - Deprecation warnings
2016-02-24 17:05:54 +00:00
Andy Wilkinson
6bb9eb421f Merge branch '1.3.x' 2016-02-24 16:49:27 +00:00
Andy Wilkinson
1c715ab282 Upgrade to Jetty 9.2.15.v20160210
Upgrade to Jetty 9.2.15 and replace use of API that was deprecated
and changed to throw an UnsupportedOperationException in the same
release.

Closes gh-5218
2016-02-24 16:49:22 +00:00
Andy Wilkinson
7d84273d98 Merge branch '1.3.x' 2016-02-24 16:25:02 +00:00
Andy Wilkinson
1735fac3ab Upgrade to Logback 1.1.5
Closes gh-5212
2016-02-24 16:24:10 +00:00
Phillip Webb
89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
2016-02-19 19:28:37 -08:00
Phillip Webb
4b55144d80 Polish 2016-02-19 16:19:22 -08:00
Phillip Webb
03dad33b0c Polish diagnostics support
Rework a few parts of the diagnostics support:

- Move code from SpringApplication to FailureAnalyzers
- Allow AbstractFailureAnalyzer to take generic cause type
- Move own analyzers into a new package and make package private

See gh-4907
2016-02-19 16:11:26 -08:00
Phillip Webb
a9afe0a944 Formatting 2016-02-19 16:07:10 -08:00
Andy Wilkinson
742df6b63b Polish contribution
Rename the new property to enabledProtocols to align more closely with
Undertow and Tomcat’s underlying configuration setting.

Closes gh-2109
2016-02-19 16:54:11 +00:00
Pedro Costa
766ccd753b Make TLS protocols and cipher suites configurable via the environemnt
Closes gh-4823
2016-02-19 16:48:53 +00:00
Andy Wilkinson
df6c204193 Provide better diagnostics when an application fails to start
This commit introduces a new failure analysis mechanism that can be
used to provide diagnostics to a user when their application fails
to start.

When application context refresh fails. FailureAnalyzer
implementations are loaded via spring.factories. The analyzers are
called in order, with the first non-null analysis of the failure
being used. The analysis is reported to the use by
FailureAnalysisReporters which are also loaded via spring.factories.

A single FailureAnalysisReporter is provided out of the box. It logs
an error message with details of the analysis, providing the user
with a description of the failure and, if available, some actions
that they may be able to take to resolve the problem without also
displaying a stack trace that is of little value.

Two analysers are provided initially. One for an embedded servlet
container port clash and another for BeanCurrentlyInCreationExceptions.
More analysers are planned (for UnsatisfiedDependencyException and for
NoUniqueBeanDefinitionException) once some updates have been made
to Spring Framework to make those failures more amenable to analysis.

Closes gh-4907
2016-02-19 15:44:03 +00:00
Andy Wilkinson
9be69f1ac7 Improve JDBC driver dependency management and class name test coverage
Previously, the DatabaseDriver enumeration contained entries for
some databases without having dependency management for the database
driver dependency. This leads to the possibility of a user inadvertently
using the wrong version of a driver where the class names do not match
those listed in the enumeration. A further problem is that we do not
test that the class names listed in the enumeration match the
names of Driver and XADataSource implementations in the database driver.

This commit completes the database driver dependency management so that
dependency management is provided for every driver that is both listed
in DatabaseDriver and available in Maven Central. It also adds tests
for DatabaseDriver that ensures that each class that is listed exists
and implements the required interface (java.sql.Driver or
javax.sql.XADataSource).

Closes gh-4946
2016-02-19 12:41:13 +00:00
Andy Wilkinson
ff99bb0730 Set main thread's context class loader when starting Tomcat
When an app is deployed to Tomcat, all of the application's startup
is performed with a WebAppClassLoader being the thread context
class loader. When an app is using embedded Tomcat, the
WebAppClassLoader is created as part of the application starting but
is never set as the thread context class loader. This difference
in TCCL can cause problems. For example, it breaks the use of JNDI
during application startup with embedded Tomcat.

This commit updates the embedded Tomcat servlet container to set
the TCCL to be the WebAppClassLoader once the Tomcat context has
been started. Once Tomcat is stopped, it sets the TCCL back to the
ClassLoader that loaded it.

Closes gh-2308
2016-02-19 11:40:02 +00:00
Andy Wilkinson
d6e0b5a165 Use @DirtiesContext to avoid unwanted context caching in the tests
We rarely use the same configuration in multiple test classes, but
Spring’s Test framework caches each context by default. For projects
with large numbers of integration tests, this can lead to tens of
contexts being cached. This increases memory usage, live thread count,
etc for no benefit.

This commit adds @DirtiesContext to the integration tests in
spring-boot, spring-boot-autoconfigure, and spring-boot-actuator so
that the context is closed once the test class has completed.

See gh-5141
2016-02-19 11:20:22 +00:00
Andy Wilkinson
4189e145bb Polishing
- Remove usages of deprecated APIs
 - Remove redundant version on dependency declaration
2016-02-17 16:53:09 +00:00
Stephane Nicoll
90f0fc6ce3 Harmonize JTA properties
Previously, both Atomikos and Bitronix were bound on the `spring.jta`
namespace which makes very hard to figure out which property belong to
which implementation. Besides, `AtomikosProperties` only exposed public
setter which does not generate any useful meta-data.

This commit moves the external configuration for Atomikos and Bitronix to
`spring.jta.atomikos.properties` and `spring.jta.bitronix.properties`
respectively. It also improves the meta-data support for those two
namespaces.

Closes gh-5165
2016-02-16 16:44:50 +01:00
Andy Wilkinson
1c365662b0 Don't leave so many threads lying around in the tests
See gh-5141
2016-02-12 17:39:14 +00:00
Andy Wilkinson
2cee11620e Merge branch '1.3.x' 2016-02-11 19:40:04 +00:00
Andy Wilkinson
295dc65b78 Fix LoggingSystem tests following System property changes 2016-02-11 19:38:47 +00:00
Andy Wilkinson
2be90eca98 Merge branch '1.3.x' 2016-02-11 18:02:07 +00:00
Andy Wilkinson
7787321db4 Polishing 2016-02-11 18:02:04 +00:00
Andy Wilkinson
72928de518 Merge branch '1.3.x' 2016-02-11 18:00:10 +00:00
Andy Wilkinson
ddfadce94d Set all documented system properties in LoggingApplicationListener
Closes gh-5073
2016-02-11 17:52:16 +00:00
Stephane Nicoll
63d9f9e91f Merge branch '1.3.x' 2016-02-11 14:49:35 +01:00
Stephane Nicoll
594c8910c5 Clarify precedence of property sources
When the `locations` attribute is set for a given bean annotated with
`@ConfigurationProperties`, the configuration at these specified
locations take precedence over any other property sources. This means
that such values can't be overridden by a system property or a command
line switch for instance.

This commit clarifies this rules in the documentation.

Closes gh-5111
2016-02-11 14:49:11 +01:00
Stephane Nicoll
1f106ddf8c Enable connection validation by default
Hikari and Commons DBCP2 are already validating that the connection is
valid before borrowing it from the pool. This commit makes that behaviour
consistent by enabling that feature for the Tomcat and Commons DBCP data
sources.

Since a validation query is required in those cases, the infrastructure
of `DataSourceHealthIndicator` has been merged in a single place: the
`DatabaseDriver` enum provides not only the driver class names but also
the validation query, if any.

Closes gh-4906
2016-02-11 12:03:18 +01:00
Stephane Nicoll
ebffa493e4 Harmonize ConfigurationProperties bean name
When `@EnableConfigurationProperties` is defined, Spring Boot
automatically registers a bean in the context for each class specified
on the annotation. Previously, the name of the bean only included the
prefix which leads to conflict if two different classes use the same
prefix.

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

Closes gh-4395
2016-02-09 17:19:11 +01:00
Andy Wilkinson
f12bb26649 Merge branch '1.3.x' 2016-02-08 16:07:53 +00:00
Andy Wilkinson
29c7b93640 Update SpringApplicationBuilder to pass args to parent when it's run
Closes gh-5103
2016-02-08 16:02:03 +00:00
Phillip Webb
cc5d4b8b7f Add AssertJ checkstyle rule
Closes gh-5083
2016-02-06 15:51:27 -08:00
Phillip Webb
e19e3209d9 Use AssertJ in spring-boot
See gh-5083
2016-02-06 15:15:21 -08:00
Phillip Webb
8b4d801dd6 Add support for AssertJ
Add AssertJ as a managed dependency and also include it in
spring-boot-starter-test. Also provide a simple adapter class to allow
Hamcrest matchers to be used as AssertJ Conditions.

Fixes gh-5048
2016-02-06 15:06:23 -08:00
Andy Wilkinson
8f57f4ca63 Merge branch '1.3.x' 2016-02-04 13:52:21 +00:00
Andy Wilkinson
c0a2c88da1 Stop referring to optional classes in BeanDefinitionLoader’s signature
Previously, BeanDefinitionLoader declared a field of type
GroovyBeanDefinitionReader which is a GroovyObject subclass. This is
problematic as BeanDefinitionLoader is always loaded but Groovy is an
optional dependency. Even on a JVM where class verification is performed
lazily, this can still cause problems if something reflectively tries
to access the class’s declared fields. On a JVM where classes are
verified at load time, it would be impossible to start a Spring Boot
application without having Groovy on the classpath.

This commit changes the field to be a BeanDefinitionReader, removing
the indirect reference to GroovyObject form BeanDefinitionLoader’s
signature. The reader is downcast to a GroovyBeanDefinitionReader in the
body of a method body that will only be invoked when Groovy is on the
classpath.

Closes gh-5040
2016-02-04 13:52:13 +00:00
Phillip Webb
34a864447f Merge branch '1.3.x' 2016-02-03 20:58:49 -08:00
Phillip Webb
43a5b77256 Ensure logback is reset after test
Update SpringBootJoranConfiguratorTests to ensure that logback
is left in a sane state. Prior to this commit, running all tests
in eclipse would fail due to ErrorPageFilterTests expecting
specific log output.
2016-02-03 20:56:45 -08:00
Phillip Webb
bbc0dc69eb Polish 2016-02-02 16:04:09 -08:00
Phillip Webb
acbb4e63f2 Clear caches on ApplicationContext load
Ensure that JarFile caches are cleared once the ApplicationContext has
loaded. Caches are cleared manually with the assumption that no
further class loading is likely.

Closes gh-4882
2016-01-29 21:42:19 -08:00
Phillip Webb
50e78b9c99 Allow package private spring.factories classes
Update SpringApplication to allow classes loaded from spring.factories
to be package private.

Fixes gh-5043
2016-01-29 21:42:18 -08:00
Phillip Webb
26dfbeb8f4 Share MetadataReaderFactory
Add SharedMetadataReaderFactoryContextInitializer to ensure that a
shared caching MetadataReaderFactory is used between configuration
classes and auto-configure sorting.

Fixes gh-4993
2016-01-29 21:42:18 -08:00
Phillip Webb
f276ff4bd0 Polish 2016-01-27 16:02:36 -08:00
Stephane Nicoll
cafe1dc4c6 Polish contribution
Fix additional use of \n

Closes gh-4707
2016-01-25 15:43:04 +01:00