Commit Graph

135 Commits

Author SHA1 Message Date
Dave Syer 4ce6b64dce [bs-175] Generic dispatcher features for SpringApplication
* Move Spring.main into SpringApplication.main
* User can bind command line or application.properties into
SpringApplication
* User can provide sources dynamically with --spring.main.sources
(a CSV list of class names, package names or XML resource locations)
* One side effect was to make DocumentMatchers stateless

[#52830829]
2013-07-16 10:45:36 +01:00
Dave Syer f52d624be5 Add option in @OnBeanCondition to *only* look in parent
[Fixes #53374039] [bs-231] Broken tests for management port configuration
2013-07-15 11:16:02 +01:00
Phillip Webb 14aa163731 Start to breakup README.md documentation 2013-07-14 20:50:44 -07:00
Phillip Webb 30bf5dcb0d Do not using static finals for PID and format
Update SimpleFormatter so that the PID and format can be different per
formatter instance.
2013-07-14 06:55:15 -07:00
Dave Syer 217a6a4cd1 Unify log format of default JDK logger with other systems 2013-07-14 08:58:47 +01:00
Phillip Webb dc1b787a01 Support color log output
Rework logback formatting to include ansi color output. Also added
support for JUL over SLF4J to ensure that tomcat logging looks OK.

Issue: #53249833
2013-07-13 21:05:07 -07:00
Phillip Webb 5c46a39494 Polish ANSI code 2013-07-13 16:05:56 -07:00
Phillip Webb a324beadac Create LoggingSystem class to configure logging
Add LoggingSystem class that can be used to configure various logging
systems in a consistent way. Mostly the code is migrated from the
LoggingApplicationContextInitializer.
2013-07-13 16:04:08 -07:00
Phillip Webb ae20d389c4 Add SpringApplicationInitializer strategy
Add SpringApplicationInitializer that can be used to initialize a
SpringApplication before it runs. An ApplicationContextInitializer
can optionally implement this interface.
2013-07-13 16:04:07 -07:00
Phillip Webb 0b673d82e2 Add simple ANSI encoder and colorize the banner
Issue: #51754753
2013-07-12 13:51:50 -07:00
Phillip Webb 2a4454b524 Add simple Java Util Logging formatter
Add simple formatter used with the default logging.properties to
improve JUL output.
2013-07-12 00:44:16 -07:00
Phillip Webb d4b9014b64 Log useful information on startup
Include the bootstrap version number in the banner and log information
such as the host name when starting.

Issue: #53030523
2013-07-12 00:44:05 -07:00
Phillip Webb 7d0c0fc0dd Polish 2013-07-11 11:21:34 -07:00
Dave Syer 6dbd6d7c4c [bs-178] Use OpenEntityManagerInView by default in webapp with JPA
If JPA is used and the context is a webapp we add the OEMIV interceptor.
It can be switched off by the user declaring a bean of type OEMSIVI or
the corresponding Filter, or by setting spring.jpa.open_in_view=false.

[Fixes #52939983]
2013-07-11 18:13:49 +01:00
Dave Syer a7c3edefe8 Tied up loose end for spring profile binding in YAML
The short story: we only support comma-separated spring.profiles
in YAML documents.

[#51968679]
2013-07-11 15:24:25 +01:00
Dave Syer d5aad97d1f [bs-168] Support convenient binding of @Bean to external source
@ConfigurationProperties now has a path() attribute that can be used
to specify a resource location explicitly.

[Fixes #51968657]
2013-07-11 13:23:24 +01:00
Dave Syer 15ba11f302 [bs-167] Fixed YamlProcessor to not create a key for an array
[Fixes #51968679] YamlPropertiesFactoryBean creates unbindable keys
(the toString() of the whole map for instance)
2013-07-11 11:07:42 +01:00
Phillip Webb 86ce60593b Relax logging tests for CI 2013-07-10 10:50:04 -07:00
Phillip Webb fbc68fe145 Tweak EmbeddedServletContainerCustomizer javadoc
Make it a little clearer that a
EmbeddedServletContainerCustomizerBeanPostProcessor is usually involved.

Issue: #53029445
2013-07-10 09:02:04 -07:00
Phillip Webb 3ba700a861 Revert accidentally changed logging.properties 2013-07-09 13:15:43 -07:00
Phillip Webb 02ae46d40e Further attempt to fix CI log test failures 2013-07-08 21:35:00 -07:00
Phillip Webb 83d3b508a8 Revert "@Ignore logging tests that fail on CI"
This reverts commit 2630aa732f.
2013-07-08 20:27:40 -07:00
Phillip Webb dbd29f36ec Protect against malformed logging.config
Ensure that any user specified logging.config exists. Required for
CI build as bamboo sets a "LOGGING_CONFIG" environment variable.
2013-07-08 19:30:34 -07:00
Phillip Webb 2630aa732f @Ignore logging tests that fail on CI 2013-07-08 17:56:23 -07:00
Phillip Webb abad5aa8e4 Attempt to fix logging tests that fail in CI 2013-07-08 17:45:27 -07:00
Phillip Webb c52972ceec Polish 2013-07-08 16:38:15 -07:00
Phillip Webb 0b863611d9 Package restructure 2013-07-08 13:42:46 -07:00
Phillip Webb cd51f357a3 Further maven module restructure 2013-07-08 13:42:44 -07:00
Phillip Webb 40bf334871 Restructure projects layout 2013-07-08 13:42:39 -07:00
Dave Syer 3996353e35 Make logging config come after config file
...otherwise you can't control the log configuration from
application.properties.
2013-07-08 12:32:32 +01:00
Dave Syer 7e579d3652 Revert strange looking DataSource chamge 2013-07-05 12:03:58 +01:00
Phillip Webb 510e16a809 Don't consider system ClassLoader in Tomcat
Modify TomcatEmbeddedServletContainerFactory to ensure that the
system ClassLoader is not considered when loading classes.

This is required to fix issues when working with executable JARs
created with the maven plugin.
2013-07-04 22:37:58 -07:00
Dave Syer f3cb6d46ce Add test for Spring integration tests 2013-07-01 09:14:52 +01:00
Greg Turnquist db05637e06 Add MultipartAutoConfigure to spring.factories
Update META-INF/spring.factories to include MultipartAutoConfigure.
Also tweaked the class @Conditionals and Javadoc.

Issue: BS-157
2013-06-20 15:29:03 -07:00
Greg Turnquist 9ab2f98df0 Tune expected exceptions to support more platforms
It appears that some machines break when looking for ConnectionException,
but not SocketException, both of which are IOExceptions. This seems to make
tests pass on more machines without compromising the intentions of the API.

[BS-162]
2013-06-17 18:44:10 -07:00
Greg Turnquist f8c20919f9 [BS-157] Fix misnamed method
Fix typo in EmbeddedServletContainerFactory.
e enter the commit message for your changes. Lines starting
2013-06-17 10:33:27 -07:00
Phillip Webb 018231d20a Polish 2013-06-17 10:29:44 -07:00
Dave Syer 7bf3e35249 Remove some try/catch blocks from test methods 2013-06-15 07:29:31 +01:00
Greg Turnquist 4b1c58d736 [BS-157] Add MultipartConfig support
Use Servlet 3.0 features to autodetect a MultipartConfigElement and
hence autowire multipart support in the servlet container.
2013-06-15 07:23:28 +01:00
Dave Syer 697c210155 Add cacheable switch to Thymeleaf template resolver
User can set spring.template.cache=false to change the behaviour
2013-06-13 13:46:21 +01:00
Dave Syer e1bac589fb Use available Converters for @ConfigurationProperties binding 2013-06-13 06:54:11 +01:00
Phillip Webb 9782747027 Use SpringZero Banner 2013-06-12 15:46:20 -07:00
Phillip Webb 8c347fc99b Numerous changes to actuator
Numerous changes to the actuator project, including:
- Specific Endpoint interface
- Spring MVC/Enpoint adapter
- Management server context changes
- Consistent auto-configuration class naming
- Auto-configuration ordering
- Javadoc, code formatting and tests
2013-06-12 15:42:56 -07:00
Phillip Webb dd69d0f660 Polish and Fixup
Polish and fixup:
- Ordered auto-configuration
- @ConditionalOnBean default on @Bean methods
- Improved separation of auto-configure classes
- Consistent naming
- Javadoc, code formatting and tests
2013-06-12 15:42:55 -07:00
Phillip Webb 2f84df66b6 Always store @ComponentScan details
Refactor JpaComponentScanDetector to a more general use utility and
ensure that details are always stored.
2013-06-12 15:42:55 -07:00
Phillip Webb b572d98cbf Support ordering of auto-configuration classes
Update EnableAutoConfigurationImportSelector to sort auto-configuration
classes based on @Order and @AutoConfigureAfter annotations.
2013-06-12 15:42:55 -07:00
Phillip Webb 3536fc68f5 Update On(Missing)Bean Condition logic
Update OnBeanCondition and OnMissingBeanCondition to work better
with @Configuration classes and to support an optional considerHierarchy
annotation value.

The class value for conditions can now also be inferred when used on
@Bean methods.
2013-06-12 15:42:55 -07:00
Phillip Webb 6a2f36a68a Obtain ServletContextInitializer beans later
Update EmbeddedWebApplicationContext to obtain ServletContextInitializer
beans after self initialization. Allows @Configuration beans to be
ServletContextAware.
2013-06-12 15:42:54 -07:00
Dave Syer 20cce0c69c [bs-52] Added support for SpringApplication in a ServletContextInitializer
WAR applications should extend SpringServletInitializer to take advantage
of Servlet 3.0 initialization and SpringApplication context loading features.

[#48386505] [bs-52] Support for running "traditional" webapps in place
2013-06-11 07:40:33 +01:00
Dave Syer e011312c68 [bs-138] Make it easy to secure only the management endpoints
Example: web UI with publicly available static assets

    # application.properties:
    security.ignored: /css/**,/script/**

Example: web UI with publicly available everything, but secure
management endpoints.

    # application.properties:
    # Empty path for basic security (default is /**)
    security.basic.path=

[Fixes #50721675]
2013-06-06 22:10:20 +01:00