Commit Graph

1616 Commits

Author SHA1 Message Date
Dave Syer 09f3ee14a4 Skip unnecessary attempt at executing Job
...that was already executed as part of the "local" set.

Also added some howto docs on executing Batch jobs.

See gh-382
2014-02-24 14:56:17 +00:00
hoserdude 3ad6c96ce5 Adding support for multiple configured job names 2014-02-24 14:33:08 +00:00
Dave Syer 08d8cb8efd Add /mappings endpoint
Lists AbstractUrlMappings and AbstractHandlerMethodMappings
in a loose Map structure. E.g.

{
  "/**/favicon.ico": {
    "bean": "faviconHandlerMapping"
  },
  "/**": {
    "bean": "resourceHandlerMapping"
  },
  "/webjars/**": {
    "bean": "resourceHandlerMapping"
  },
  "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}":
     {
       "bean": "requestMappingHandlerMapping",
       "method": "public java.util.Map<java.lang.String, java.lang.Object> org.springframework.boot.actuate.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)"
...
}

Fixes gh-378
2014-02-24 13:34:07 +00:00
Dave Syer d98bfdea37 Make sure metricsExecutor is shutdown cleanly
The default executor for publishing metrics was a single
thread (native JDK) ExecutorService with a non-daemon thread.
Changed it to a Spring-managed thread pool of size 1, which
is then shutdown with e ApplicationContext automatically.

Fixes gh-388
2014-02-24 11:32:27 +00:00
Dave Syer f38a36ff70 Fail on startup if Thymeleaf template directory missing
Better even than logging would be to fail fast? Surely it's a
mistake not to have any /templates if Thymeleaf is in use.
User can disable failfast by exlcuding thymeleaf configuration
or by providing their own ITemplateResolver.

Fixes gh-294
2014-02-24 09:53:07 +00:00
Dave Syer 8d9c26b2df Switch default to fail on error in SQL initialization
User can switch the behaviour on and off with
spring.datasource.continueOnError:true|false. I decided
not to add an extra nested level of property resolution
because of the existing spring.datasource.schema
(and other properties relating to initialization) because
concision seemed like a good thing with those more common
settings.

Fixes gh-374
2014-02-24 09:30:21 +00:00
Dave Syer 766da91137 Fix shade configuration in parent pom
The Spring resource transformer class name changed
(at least once) since the parent was originally
created.

Fixes gh-384
2014-02-24 08:57:13 +00:00
Dave Syer 511fff05bb Check for a mainClass in "run" task if there is one
If there is a run task with an explicit main it can be used
by the repackage task (assuming its own native setting is
not used).

Fixes gh-389
2014-02-24 08:54:04 +00:00
joschs b7802f98bb Applying RelaxedNames before filtering PropertySources
... to allow for OS_VAR to be bound to a @ConfigurationPropertes("os")
class with field "var".

Fixes gh-387, Fixes gh-391
2014-02-24 07:39:30 +00:00
Dave Syer 1f69ef69cb Add (ignored) test suite for tracking down ordering bugs 2014-02-20 16:55:35 +00:00
Christian Dupuis b2327cb5f9 Fix comment 2014-02-20 17:44:23 +01:00
Dave Syer 56a693198b Fix test (but not gh-380) 2014-02-20 11:50:27 +00:00
Dave Syer 41d80bc031 Fix spring.factories 2014-02-20 10:54:01 +00:00
Dave Syer 23991dd94d Participant -> Listener 2014-02-20 10:29:02 +00:00
Dave Syer 2aa5623116 Disable JMX autoconfig by default in user tests 2014-02-20 10:28:42 +00:00
Dave Syer b2b487ee5f Add ServletRegistrationBean for DispatcherServlet
Mapping is exposed via server.servletPath.

Fixes gh-379
2014-02-20 09:49:24 +00:00
Dave Syer 44b877cd7d Remove @ConditionalOnBean(DataSource.class) from JPA config
Stacktrace is then obviously about DataSource, not EntityManager.

Fixes gh-375
2014-02-20 09:09:50 +00:00
Dave Syer 33db285b6c Fix empty console logs with logback 2014-02-20 08:48:48 +00:00
Dave Syer 0aa3b00fdf Ensure shutdown endpoint is disabled by default
Fixes gh-377
2014-02-20 08:36:18 +00:00
Dave Syer c5d8150fd4 Add docs on initializing a database
Fixes gh-364
2014-02-19 18:06:28 +00:00
Dave Syer e663b44f94 For pre-initialization phase use console only
Added basic-* log configuration files that are loaded in the
beforeInitialization() phase. They don't contain any file
logger so no empty spring.log is ever created.

Fixes gh-303
2014-02-19 17:43:03 +00:00
Dave Syer 825fc2f7df Omit jar: prefix from jarFileUrl 2014-02-19 13:59:05 +00:00
Dave Syer ed15345df1 Try to make Jetty scan TLDs in nested JARs
Jetty apparently does it differently (different version of
Jasper maybe), so you need a unique jarFileURL for each
nested JAR (previously they were all set to the parent
archive URL).

Also added the root of the main archive as a valid
document root.

For gh-367
2014-02-19 13:41:09 +00:00
Dave Syer 6631dd025c Ensure DispatcherServlet is available in a deployed WAR
The DispatcherServletAutoConfiguration had a condition on it that
meant it wasn't used at all if there was no EmbeddedServletContainerFactory.
It's amazing that any WAR ever deployed.

Also added some info logging to servlet and filter registrations.
2014-02-19 13:41:08 +00:00
Phillip Webb d984cc0826 Restore loading order of 'application.properties'
Restore the order that `ConfigFileApplicationListener` attempts to load
application.properties so that local files always have a higher
precedence than bundled classpath files.

This fixes a regression introduced with 1.0.0.RC2.

Fixes gh-370
2014-02-18 23:13:09 -08:00
Phillip Webb b69c659d8f Polish 2014-02-18 21:58:09 -08:00
Dave Syer d84a77e4a7 Add JettyServerCustomizer for Jetty container customization
E.g. can be used to add SSL support to a Jetty container, similarly
to a TomcatConnectorCustomizer.

Fixes gh-345
2014-02-18 14:17:50 +00:00
Dave Syer c973847d1f Revert change that breaks tests in werid way 2014-02-18 13:07:38 +00:00
Dave Syer b088f60082 Investigated JSP support
Summary: Tomcat works with WARs. Jetty doesn't work.

See gh-367
2014-02-18 12:14:25 +00:00
Dave Syer da26c614f2 Update YAML refs in docs 2014-02-18 10:48:38 +00:00
Dave Syer 8778e82752 Add snakeyaml to spring-boot-starter
Fixes gh-366
2014-02-18 10:25:26 +00:00
Dave Syer 77bac876ce Add support for Spring Loaded in Maven and Gradle
Requires Loaded 1.1.5 (or better).

For Maven you can just add springloaded to the dependencies of the
spring-boot plugin (and also set MAVEN_OPTS=-noverify).

For Gradle add springloaded to the build dependencies (-noverify
can be added by the plugin).

In both cases there is also support for adding an arbitrary java agent
via configuration. Samples are provided in
spring-boot-sample-[simple,web-ui].

The ApplicationPlugin is only added if there is no JavaExec task
already present, and additionally it computes its own man class if
none is provided. So "gradle run" and "gradle bootRun" look
superficially similar, but "bootRun" has extra options, including
the agent and Loaded support.

Fixes gh-251, gh-183
2014-02-18 10:05:28 +00:00
Dave Syer f888567c1d Be defensive about Spring Security dependencies
In particular don't assume that Spring Security Web is on the
classpath, just because Spring Security Core is.

Fixes gh-363
2014-02-17 18:08:23 +00:00
Jakub Kubrynski 5d591edbf8 Consider FactoryBean classes in OnBeanCondition
Update OnBeanCondition to attempt to consider FactoryBean classes
for bean type matches. To ensure early instantiation does not occur, the
object type from the FactoryBean is deduced by resolving generics on the
declaration.

Fixes gh-355
2014-02-17 13:34:03 +00:00
Dave Syer fa9a506e3e Straighten out profile ordering semantics
Here's what I think works best:

* Any profile in the Environment before application.yml
is processed takes precedence (i.e. it will be last in the
list of active profiles in the live app)

* Any profile in the Environment before SpringApplication
starts takes precedence (so any added on the command line or
with System properties come after ones added using
the SpringApplication API)

* The order of profiles in application.yml is irrelevant -
profiles are applied in the order they come out of
Environment.getActiveProfiles()

Fixes gh-342
2014-02-17 12:58:36 +00:00
Dave Syer d5de29b76c Add test case for profile ordering
The command line profile (or equivalently System property) is
not winning right now. Arguably that should be fixed. (Thinking...)

Relevant to gh-342
2014-02-17 11:06:22 +00:00
Andy Wilkinson 05fd50d190 Dependency version upgrades
- spring-integration-core 3.0.1.RELEASE (closes #360)
 - Logback 1.1.1 (closes #361)
 - maven-settings-builder 3.1.1 (closes #359)
 - maven-aether-provider 3.1.1 (closes #356)
 - jopt-simple 4.6 (closes #357)
 - SLF4J 1.7.6 (closes #318)
2014-02-17 11:05:28 +00:00
Dave Syer 842e037b72 Add some tests for profile behaviour
Ordering: profiles are applied in order (from the active profiles
list in the Environment), with the last one winning as far as
property values goes. This *does* mean that a profile activated
inside application.yml is applied last and hence takes precedence.
It's debatable whether that is the right semantics, but that's
what it is for now.

Re gh-342: a profile added via SpringApplication also takes
precedence over one added on the command line. Also debatable
but at least it's predictable.

Naming: a profile adds "#<profile>" to the end of a property source
name (no more, no less)
2014-02-17 10:44:30 +00:00
Christian Dupuis 703d7d3fd9 Prevent EmptyStackException in case no stack of prompts is empty 2014-02-16 14:05:58 +01:00
Dave Syer fc4aabde75 Add some test cases and comments
In response to gh-352
2014-02-14 18:50:36 +00:00
Phillip Webb e4376bc4a6 Update READMEs to 1.0.0.RC3 2014-02-13 13:37:12 -08:00
Phillip Webb 169eeb95ad Fixup next iteration commit 2014-02-13 13:30:13 -08:00
Spring Buildmaster 1367d57e8c Next development version 2014-02-13 13:19:12 -08:00
Spring Buildmaster eaff1677a7 Release version 1.0.0.RC3 2014-02-13 13:18:56 -08:00
Phillip Webb dfe6de8c1f Fallback to JVM URL handler on exception
Update the executable JAR `Handler` to fallback to the JVM handler if
the jar cannot be opened. This prevents exceptions when trying to
open URLs in the form "jar:jndi:/localhost...".

Fixes gh-347
2014-02-13 11:12:46 -08:00
Phillip Webb 97c258a2b4 Fix properties binding to SpringApplication
Fix ConfigFileApplicationListener to correctly bind
`application.properties` to SpringApplication. Binding in RC2 failed
due to the fact that `ConfigurationPropertySources` did not extend
`EnumerablePropertySource`.

Fixes gh-346
2014-02-13 10:08:59 -08:00
Phillip Webb eaa05c6b6d Update READMEs to 1.0.0.RC2 2014-02-12 20:56:00 -08:00
Phillip Webb ef9048e86e Rename EnvironmentDelegate -> Delegating
Rename EnvironmentDelegateApplicationContextInitializer to
DelegatingApplicationListener and EnvironmentDelegateApplicationListener
to DelegatingApplicationListener.
2014-02-12 17:04:42 -08:00
Phillip Webb d5c0ef6ca3 Add ConfigFileApplicationContextInitializer
Reintroduce ConfigFileApplicationContextInitializer for tests that
wish to reuse 'application.properties' configuration.

Fixes gh-344
2014-02-12 17:01:00 -08:00
Phillip Webb 4a58171b5c A few more package tweaks
Improve package structure and include package-info javadoc.
2014-02-12 13:50:37 -08:00