Commit Graph

46858 Commits

Author SHA1 Message Date
Dave Syer
990627b328 [bs-144] Make EmbedddedContainerConfiguration an import selector
Previously EmbedddedContainerConfiguration cannot be imported directly.
This change ensures that the nested classes are not loaded automatically
so there can be no issues with the annotation parameters.

There might be a case for a change in Spring here since the framework
itself could just be more cautious when processing nested classes.

[Fixes #50880927]
2013-05-31 13:24:04 +01:00
Dave Syer
6c22e0ab6e [bs-140] Extract framework-provided @ConfigurationProperties into @Bean
Allows @ConfigurationProperties beans to be declared explicitly (to set default values)

[#50804109]
2013-05-31 13:02:30 +01:00
Dave Syer
cf201ffd80 [bs-142] Add @AssertMissingBean
Example usage is to fail fast if trying to provide
a @ConfigurationProperties bean and it was already
defined

[Fixes #50812235]
2013-05-30 14:15:06 +01:00
Dave Syer
8023a862c3 Add test for @ConfigurationProperties
Various parent context topologies are tried to ensure that the properties
are bound sensibly.

[#50804109] Allow @ConfigurationProperties beans to be declared
explicitly (to set default values)
2013-05-30 11:22:03 +01:00
Dave Syer
3ba5f56808 [bs-138] Add @OnManagementContext for management beans
User adds @OnManagementContext to a bean or @Configuration and
it should be included in the management context (if there is one)
whether it is the main context or a child.

Makes it easy to secure the management endpoints and keep
the rest open (see actuator-ui-sample).

[#50721675]
2013-05-30 08:43:50 +01:00
Dave Syer
729cfe813b [bs-22] Add more unit tests 2013-05-29 09:37:31 +01:00
Dave Syer
aabff1a774 [bs-61] Allow non-default servlets and filters to be registered
* The RegistrationBean (ServletInitializer) now exposes a registration
target object, and this is used to prevent double registration of those
objects.
* If there is a Servlet with bean id "dispatcherServlet" it is mapped to
"/" (unless already registered as a ServletRegistrationBean).

[Fixes #48645559]
2013-05-29 07:41:48 +01:00
Dave Syer
bf30e2de90 [bs-135] Add support for closure-style options declarations
E.g.

    options {
	option "foo", "Foo set"
	option "bar", "Bar has an argument of type int"
          withOptionalArg() ofType Integer
    }

    println "Hello ${options.nonOptionArguments()}: " +
      "${options.has('foo')} ${options.valueOf('bar')}"

[#50427095] [bs-135] Plugin model for spring commands
2013-05-28 17:03:01 +01:00
Dave Syer
dcdf2d00b8 [bs-135] Simplify Command interface a bit more 2013-05-28 17:03:01 +01:00
Dave Syer
fc1012e77d [bs-135] Remove support for option commands
Command names stating with "--" work just as well.

[#50427095]
2013-05-28 17:03:01 +01:00
Dave Syer
d950d15f9b [bs-135] Plugin model for spring commands
* Added CommandFactory and a ServiceLoader model for providing
implementations
* Added ScriptCommand (wrapping groovy script). Service providers
are recommended to implement OptionHandler in their script, but a
regulare Script or a Runnable will also work.

[#50427095]
2013-05-28 17:03:01 +01:00
Phillip Webb
51e6c8c8b6 Merge pull request #1 from gregturn/fix-annotation-and-typos
# By Greg Turnquist
* fix-annotation-and-typos:
  Fixed name of annotation and a typo in the code.
2013-05-27 18:38:06 -07:00
Greg Turnquist
6c4e39d4c1 Fixed name of annotation and a typo in the code. 2013-05-27 18:37:56 -07:00
Dave Syer
25f68404f3 [bs-137] "spring help" prints "Unexpected error" (when it isn't)
[#50523561]
2013-05-24 16:44:42 +01:00
Dave Syer
750b193fe4 Packaging: ensure executable bit is set 2013-05-24 14:27:56 +01:00
Dave Syer
a112717fd3 [bs-136] Add 'spring run --local ...'
Use this to download and cache the dependencies to ./grapes.
Good for running on virgin system (like PaaS).

[Fixes #50511883] Add --local to RunCommand
2013-05-24 13:51:10 +01:00
Dave Syer
35a376b403 Fix bug in test 2013-05-24 12:02:03 +01:00
Dave Syer
514cf3dcc1 [bs-129] Split up SecurityConfiguration and makes bits of it optional
* Added security.basic.* and security.sessions
* Also security.enabled (so you can switch it off on command line)

[Fixes #50181269]
2013-05-24 06:01:40 +01:00
Dave Syer
e649ef44cc [bs-107] Finish off varz->metrics
[Fixes #49496887] [bs-107] Remove trailing "z" from management endpoint URLs
2013-05-23 19:26:25 +01:00
Dave Syer
b7c0e3279e [bs-22] Add loads of actuator tests
Discovered a few issues along the way and refactored
accordingly.

[#48127729] [bs-22] Add missing unit tests
2013-05-23 18:37:48 +01:00
Dave Syer
19d8315639 Update for Spring Security snapshot 2013-05-23 14:22:08 +01:00
Dave Syer
5f7f69ad93 [bs-132] Actuator should use delegating version of MVC support
The delegating version delegates to other configurers, and it's what
@EnableWebMvc uses.  You effectively switch off the delegation if you
use the base class by mistake.

[Fixes #50267017] [bs-132] Static resources in /css/**
cannot be served by Actuator project
2013-05-22 18:23:25 +01:00
Dave Syer
29a81b8795 [bs-130] Prevent double registration
* A simple check to see if it is already registered
fixed the original problem
* Also removed the need to have @ConfigurationProperties
on a bean class (unless you want to specify the target name
etc.)

[Fixes #50256421] [bs-130] When actuator app starts the
@ConfigurationProperties are registered with the bean
factory several times
2013-05-22 15:21:07 +01:00
Dave Syer
a700ed4479 [bs-133] Move ServerProperties to spring-bootstrap core
[Fixes #50345533]
2013-05-22 13:08:12 +01:00
Dave Syer
6e52d7dd39 [bs-134] CLI app cannot resolve snapshot jars
Moved the Grab.addResolver() call to before any other compiler
customizations.

That got it working locally (removed ~/.m2 and ~/.groovy/grapes)
but still not working on cloudfoundry for some reason.  We need
more help from buildpacks there (to get a cache going for the
grapes), but there seems to be more than just that stopping it
(maybe just timeouts?).

[#50351963]
2013-05-22 11:36:54 +01:00
Dave Syer
a71bb1c972 [bs-120] Support for groovy templates
* Added GroovyTemplate.template() utility and static import in webapp CLI, so

        @RequestMapping("/")
        @ResponseBody
        String home(Model model) {
           template "home.html", model
        }

    renders the template in /templates/home.html

[Fixes #49832753]
2013-05-21 15:28:00 +01:00
Dave Syer
f73fbfc901 [bs-131] Use MapPropertySource instead of SimpleCommandLinePropertySource
[Fixes #50267831] --server.port=9000 not working on command line
2013-05-21 15:26:16 +01:00
Dave Syer
caf1aab9db [bs-22] Add tests for variour @Conditional implementations
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:51:49 +01:00
Dave Syer
c6b4c48181 [bs-22] Add tests for OnResourceCondition
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:37:07 +01:00
Dave Syer
c675d9c76e [bs-22] Add tests for Yaml processing
* Gap in logic identified, so DocumentMatcher refactored to
return an enum

[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:26:35 +01:00
Dave Syer
7531c5acfb [bs-22] Add test for Batch auto config
[#48127729] [bs-22] Add missing unit tests
2013-05-21 09:26:01 +01:00
Dave Syer
09cb2f8436 [bs-76] Implement plugin model for cli support
* Because Spring is not on the classpath we don't particularly
want to use SpringFactoriesLoader
* Adopted the JDK (>=6) ServiceLoader model instead

[Fixes #48789783]
2013-05-18 19:54:20 +01:00
Dave Syer
8bb968d8f5 Switch favicon.ico value 2013-05-18 18:58:08 +01:00
Dave Syer
2861ad4106 [bs-122] Support for Spring Data DomainClassConverter
[#49906951]
2013-05-18 16:52:17 +01:00
Dave Syer
bd5fea0d8c Updates for Security snapshots 2013-05-18 16:38:48 +01:00
Dave Syer
ab121dc91b [bs-127] Add DataSourceTransactionManager if no others are in use
* If the auto config class has a high Order it can check for
an existing transaction manager
* Unit tests added, and checked also witrh petclinic

[Fixes #50064347]
2013-05-18 16:20:22 +01:00
Dave Syer
8dae41f24c Fix missing trailing / in resource paths 2013-05-18 16:03:27 +01:00
Dave Syer
a12f0dcd12 [bs-51] Add support for h2 and Derby embedded database
Also included support for database shutdown in @PreDestroy

[Fixes #48387903]
2013-05-17 17:57:56 +01:00
Dave Syer
1a0902b32a Improve logging for @Conditional processing
[Fixes #49989913] [bs-125] @Conditional* seem to get processed multiple times?
2013-05-17 17:31:31 +01:00
Dave Syer
00c227ac01 Add favicon.ico 2013-05-17 16:12:06 +01:00
Dave Syer
10573d2c74 Remove dependency-reduced-pom.xml 2013-05-17 16:10:59 +01:00
Dave Syer
6d844eb978 Allow mvn launch and shade plugin of UI sample 2013-05-17 16:08:55 +01:00
Dave Syer
a1dd6e3293 Fix data sample (needed an enum for spring.jpa.ddl_auto) 2013-05-17 16:07:40 +01:00
Dave Syer
369b0834a0 Re-order spring.factories so vanilla JPA users get component scan detection 2013-05-17 13:58:09 +01:00
Dave Syer
50f3a2c614 Add logging to BasicDataSourceConfiguration 2013-05-17 12:11:42 +01:00
Dave Syer
2dc296caa9 [bs-98] Add support for Tomcat database pool
* If Tomcat jdbc is available and the driverClassName and url
are provided or can be guessed (e.g. for HSQL) it is used.
Properties spring.database.{driverClassName,url} are consulted.

* If Commons DBCP is available it is used (if Tomcat is not)

* Otherwise an EmbeddedDatabase is created if all the bits are
available

* A JdbcOperations and a NamedParameterJdbcOperations are
available by default if a DataSource is created

* The data source is initialized from spring.database.schema (csv
of resource patterns)

[Fixes #49393511]
2013-05-17 11:57:02 +01:00
Dave Syer
74fffeba73 Rename LoggingInitializer to be consistent with others 2013-05-17 11:56:30 +01:00
Dave Syer
83b5240a0f Add some dependencies 2013-05-17 11:54:52 +01:00
Dave Syer
430ec347fd Tweak dependency versions 2013-05-16 16:38:59 +01:00
Dave Syer
73f28a3809 [bs-22] Add tests for JPA auto configuration
* Extracted the component scan detector so it can be used
without @EnableAutoConfiguration
* Added unit tests
* Improve logging in @Conditional processing

[#48127729]
2013-05-16 14:05:07 +01:00