Commit Graph
100 Commits
Author SHA1 Message Date
Phillip Webb b60da5f85d Allow early ServletRequest Autowiring
Update `EmbeddedWebApplicationContext` so that Servlet related
resolvable dependencies are registered in `postProcessBeanFactory`.

This allows a `ServletReqest` to be autowired into an early initialized
bean and brings parity with WAR based deployments.

Closes gh-14990
2018-11-14 18:15:21 -08:00
Phillip Webb fb85d0acc1 Merge pull request #15176 from rs017991
* pr/15176:
  Fixed typo in maven site documentation
2018-11-14 16:10:55 -08:00
Phillip Webb 79b5dd3ae7 Protect against NPE when collecting annotations
Update `AnnotationsPropertySource` to ensure that `null` results from
`findMergedAnnotation` are not added to the annotation list.

Prior to this commit, if `findMergedAnnotation` returned `null` then
`AnnotationsPropertySource.collectProperties` would throw an NPE.
Although `findMergedAnnotation` should never return `null`, we're
best off being defensive so that bugs such as SPR-17495 won't cause
problems.

Closes gh-15175
2018-11-14 15:50:53 -08:00
Phillip Webb a9e8116a99 Only check for Mockito once
Update `MockReset` so that checking for Mockito only happens once.

Closes gh-14260
2018-09-05 13:25:18 -07:00
Phillip Webb 02f2f62a4d Upgrade amqp-client to 4.8
Closes gh-14259
2018-09-05 13:22:07 -07:00
Phillip Webb a50686b404 Surface additional rabbit SSL factory properties
Add `validate-server-certificate` and `verify-hostname` properties to
`spring.rabbitmq.ssl` to allow additional SSL configuration.

Closes gh-14259
2018-09-04 15:07:53 -07:00
Phillip Webb 9543fcf44d Upgrade to spring-javaformat 0.0.6 2018-08-30 15:59:27 -07:00
Phillip Webb 17de1571f5 Update copyright year 2018-08-30 15:52:58 -07:00
Phillip Webb a085541d26 Polish 2018-08-30 15:52:58 -07:00
Phillip Webb 2bb7a430cf Clean up access logging threads when Undertow is stopped
Closes gh-12742
2018-06-20 14:15:21 +01:00
Phillip Webb 6c7289b822 Allow META-INF/resources in WAR classes folder
Update `TomcatResources` so that `META-INF/resources` folders in
`src/main/resources` no longer fail with a "URI is not hierarchical"
exception.

Closes gh-13265
2018-06-05 17:00:52 -07:00
Phillip Webb bb0550ab95 Polish 2018-05-30 20:28:50 -07:00
Phillip Webb 55d0611bc3 Guard against JarURLConnection with wrong JAR
Update `JarURLConnection.get()` to guard against the wrong nested JAR
being used as context.

Closes gh-11367
2018-05-30 19:59:56 -07:00
Phillip Webb 5243adce22 Restore Java 1.6 compatibility 2018-05-30 18:23:17 -07:00
Phillip Webb 00b76490dc Remove error logging on ClientAbortException
Update `ErrorPageFilter` so that a Tomcat `ClientAbortException` no
longer causes "Cannot forward to error page for request" logging for
committed responses. Since a `ClientAbortException` indicates that the
client is no longer available it's of no consequence that the request
has been committed and the forward will fail.

Closes gh-13221
2018-05-30 14:00:55 -07:00
Phillip Webb 43071b9375 Polish formatting 2018-05-30 13:34:15 -07:00
Phillip Webb 2bfcefa48e Reinstate support for disabling build checking
Closes gh-13291
2018-05-30 13:24:06 -07:00
Phillip Webb 4d84933ee4 Also call setHttpOnly property on Tomcat context
Update `ServerProperties` to also call `setHttpOnly` on the
`TomcatContext`. It appears that this is required in addition to
using the `ServletContextInitializer` to setup `SessionCookieConfig`.

Closes gh-12580
2018-05-30 12:02:46 -07:00
Phillip Webb b03f890567 Upgrade to spring-javaformat 0.0.2 2018-05-30 11:14:26 -07:00
Phillip Webb f45ed0e56c Don't validate HelpMojo formatting
The `HelpMojo` class is always generated and it should not be checked
for formatting.

See gh-13255
2018-05-26 08:41:21 -07:00
Phillip Webb e75d8eaf40 Switch to spring-javaformat plugin
Use `spring-javaformat` to format and check code. Code formatting can
now be applied using the `spring-javaformat-maven-plugin` from the
command line. Existing checkstyle rules have also been replaced and
the CONTRIBUTING.adoc file has been updated.

Closes gh-13255
2018-05-25 20:59:04 -07:00
Phillip Webb e69296d7d3 Fix checkstyle violations in samples 2018-05-25 18:18:00 -07:00
Phillip Webb 4853477081 Reformat code 2018-05-25 18:17:37 -07:00
Phillip Webb 9f4f229b83 Polish title case in CONTRIBUTING.md 2018-05-21 17:10:52 -07:00
Phillip Webb 2fa057a06c Document how to raise security issues
Update contributing documentation and the issue template with
instructions on how to report security vulnerabilities.

Closes gh-12509
2018-05-21 17:07:44 -07:00
Phillip Webb 37646517cf Polish 2018-05-21 15:17:42 -07:00
Phillip Webb c104bae76c Fix checkstyle errors 2018-05-04 15:32:29 -07:00
Phillip Webb 99dad81e9a Update copyright header year for changed files 2018-05-04 12:15:13 -07:00
Phillip Webb 0a0247975c Formatting 2018-05-04 12:00:50 -07:00
Phillip Webb 4e96587dc8 Polish modifier declaration ordering
Follow that Java language specification.
2018-05-03 09:46:15 -07:00
Phillip Webb 64930d4e5b Polish caught exception names
Prefer `ex` over `e`.
2018-05-03 09:46:15 -07:00
Phillip Webb 3ee777e142 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 09:46:15 -07:00
Phillip Webb 690f946b6d Polish 2018-05-03 09:46:14 -07:00
Phillip Webb 370915f8f0 Fixup version numbers following release 2018-04-09 18:20:41 -07:00
Phillip Webb 6b59814cbc Switch error views to use SimpleEvaluationContext
Update `ErrorMvcAutoConfiguration` to use `SimpleEvaluationContext`
rather than `StandardEvaluationContext`.

Fixes gh-12507
2018-04-04 15:34:02 -07:00
Phillip Webb 624a5f8260 Apply URL decoding for nested jar entry names
Update `JarURLConnection` to apply URL decoding to nested jar entry
names.

Fixes gh-12765
2018-04-04 14:49:06 -07:00
Phillip Webb f08c496858 Upgrade to Spring Integration 4.3.15
Closes gh-12692
2018-04-04 12:33:45 -07:00
Phillip Webb 3563baf36b Update to Spring Data Ingalls SR11
Closes gh-12695
2018-04-04 12:33:04 -07:00
Phillip Webb dd0866000f Revert "Add text/plain error response support"
This reverts commit 23892e33d6.
2018-04-04 12:06:13 -07:00
Phillip Webb 7242ddae3c Polish 2018-04-04 12:05:08 -07:00
Phillip Webb a20df82067 Polish 2018-04-02 09:51:42 -07:00
Phillip Webb ecfc8d73f1 Be defensive when clearing caches for restart
Update `Restarter` to be much more defensive when attempting to clear
caches. We now use `clearCache()` methods whenever possible, and only
fall back to field access when absolutely necessary. In addition field
access now ignore any exceptions.

Fixes gh-12719
2018-04-02 09:43:03 -07:00
Phillip Webb a8f366a554 Fix copyright header for edited files 2018-03-16 15:07:23 -07:00
Phillip Webb 23892e33d6 Add text/plain error response support
Refine `BasicErrorController` mappings so that only JSON and XML get
structured responses. A simple string response is returned for all
other media types.

Fixes gh-12513
2018-03-16 14:30:42 -07:00
Phillip Webb e975dbe3f0 Only use jar shortcut for matching URLs
Update JAR `Handler` logic so that the existing `jarFile` is only used
if the requested URL starts with the same path. Prior to this commit it
was possible to construct a URL with another URL as context. This could
mean that the `handler` was shared and the already resolved `jarFile`
contained in the handler wasn't necessarily suitable.

Fixes gh-12483
2018-03-16 11:56:34 -07:00
Phillip Webb e40acf2447 Polish 2018-03-15 19:38:55 -07:00
Phillip Webb 98f58caeaf Reset default local after test completes 2018-02-26 22:22:21 -08:00
Phillip Webb 8f9c067a92 Polish 2018-02-26 22:16:08 -08:00
Phillip Webb 21eb8d89bb Fixup version numbers following release 2018-02-10 15:03:53 +01:00
Phillip Webb 6ae960d295 Protect against symlink attacks
Update embedded launch script to no longer change ownership of files
or folders that already exist.

Fixes gh-11397
2018-02-10 15:03:53 +01:00
Phillip Webb af8e155c6d Polish 2018-02-10 15:03:53 +01:00
Phillip Webb 798522d890 Format with Eclipse Oxygen SR2 2018-02-08 15:46:49 -08:00
Phillip Webb 1f8bc391ce Upgrade formatter settings
Closes gh-8513
2018-02-08 15:23:42 -08:00
Phillip Webb 716726aa50 Update Eclipse Oomph setup for Oxygen
See gh-8513
2018-02-08 15:23:28 -08:00
Phillip Webb 09a64bc841 Fixup version numbers following release 2018-01-30 17:16:04 -08:00
Phillip Webb 9b8cb9a463 Protect against symlink attacks
Update embedded launch script to no longer change ownership of files
or folders that already exist.

Fixes gh-11397
2018-01-30 12:42:31 -08:00
Phillip Webb 604ec075eb Merge pull request #11848 from stadler
* pr/11848:
  All CLI support for Windows MINGW environments
2018-01-30 12:41:16 -08:00
Phillip Webb 61f7bd8576 Polish 2018-01-30 12:37:40 -08:00
Phillip Webb 8e783cdae9 Polish 2018-01-18 21:42:11 -08:00
Phillip Webb 84fa67d33e Backport use docker-java 3.0.x for launch tests
Backport commit d439b73758 to upgrade launch integration tests to
use docker-java 3.0.x.
2018-01-10 11:56:09 -08:00
Phillip Webb 700d3c3907 Relocate shaded JSON API in annotation-processor
Move the 'shade' copy of the JSON API to a separate src folder to make
it clearer that we don't own the code. Also polished some formatting
and suppressed a few warnings.

Closes gh-10307
2018-01-08 12:24:19 -08:00
Phillip Webb 2aa3295675 Deprecate inapplicable RegistrationBean methods
Inherit and deprecate RegistrationBean methods that are not applicable
to a ServletListenerRegistrationBean.

Fixes gh-11342
2017-12-13 12:21:57 -08:00
Phillip Webb 2c429ba77d Restore static final formatting
Restore static final constants to upper case formatting.

See gh-10457
2017-12-13 12:21:57 -08:00
Phillip Webb 6a55623910 Polish 2017-12-13 12:21:57 -08:00
Phillip Webb dca463c7d9 Polish 2017-07-24 12:54:24 -07:00
Phillip Webb 66619bbe2b Formatting 2017-07-24 12:54:24 -07:00
Phillip Webb 28dad44e2d Be defensive about JUL calls from JAR Handler
Update nested JAR support to only obtain JUL loggers when absolutely
necessary and to defensively deal with failures.

Prior to this commit it was not possible to override
`java.util.logging.manager` to use a nested JAR as the logger
implementation.

Fixes gh-9848
2017-07-24 12:54:24 -07:00
Phillip Webb b9cfe21193 Make @ImportAutoConfiguration not register package
Update `@ImportAutoConfiguration` so that it is no longer annotated with
`@AutoConfigurationPackage` and as such isn't a marker for
`AutoConfigurationPackages`.

Having `@ImportAutoConfiguration` marked as an auto-configuration
package is particularly problematic in tests since it frequently breaks
context caching.

Fixes gh-9282
2017-07-24 12:54:24 -07:00
Phillip Webb 68910f2b8f Polish 2017-07-19 10:21:06 -07:00
Phillip Webb cd23de6ed5 Add more HealthIndicatorAutoConfiguration ordering
Update HealthIndicatorAutoConfiguration to ensure that it is configured
after ActiveMQAutoConfiguration.

Fixes gh-9793
2017-07-19 10:19:42 -07:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Phillip Webb b9fd99e268 Polish 2017-06-02 13:47:28 -07:00
Phillip Webb 440d03bf9e Merge branch '1.4.x' into 1.5.x 2017-05-15 15:59:08 -07:00
Phillip Webb 74f411faed Formatting 2017-05-15 15:58:30 -07:00
Phillip Webb 9a4a20537c Polish 2017-05-15 11:19:19 -07:00
Phillip Webb 931ce15d7f Update copyright header dates 2017-05-09 21:43:52 -07:00
Phillip Webb 4a7dcc8786 Formatting 2017-05-09 21:43:24 -07:00
Phillip Webb 4d4d03ab2c Merge branch '1.4.x' into 1.5.x 2017-05-02 21:33:33 -07:00
Phillip Webb 4a95b2f174 Polish 2017-05-02 20:39:45 -07:00
Phillip Webb 76ee2f401c Polish 2017-04-28 09:48:13 -07:00
Phillip Webb 4db4c81b9b Polish 2017-04-28 09:38:56 -07:00
Phillip Webb 4d8584eba8 Merge branch '1.4.x' into 1.5.x 2017-04-27 10:15:54 -07:00
Phillip Webb df82060cad Formatting 2017-04-27 10:12:31 -07:00
Phillip Webb 5f3d5fbec1 Remove public "skip path extension" constant
Remove the public constant to make it clearer that skipping path
extensions is really an internal Spring Boot concern.

See gh-8765
2017-04-20 13:31:04 -07:00
Phillip Webb 69a8c0d871 Fix MVC validator configuration warning
Replace the MVC validator post processor with an `@Import` so
that a "cannot enhance @Configuration bean definition"
warning does not occur.

Fixes gh-8951
See gh-8495
2017-04-20 11:57:18 -07:00
Phillip Webb bddc190848 Suppress "resolving dependencies" when --quiet
Update Spring CLI so that the "resolving dependencies" message is
suppressed when `run --quiet` is used.

Fixes gh-8946
2017-04-19 22:18:12 -07:00
Phillip Webb cde5793240 Upgrade to Spring Data Ingalls-SR3
Closes gh-8939
2017-04-19 22:18:12 -07:00
Phillip Webb 5abc050a96 Support detection and with test initializers
Relax `SpringBootTestContextBootstrapper` rules so that a test can
specify an `ApplicationContextInitializer` and still have
`@SpringBootConfiguration` detected.

Prior to this commit detection would not occur because it's possible
that an initializer _could_ register configuration. This scenario is
actually quite unlikely to occur, certainly less likely than wanting to
use an initializer in combination with auto-detection.

Fixes gh-8483
2017-04-19 22:18:12 -07:00
Phillip Webb c9561f031c Refine validator and MVC validator configuration
Update `ValidationAutoConfiguration` and `WebMvcAutoConfiguration` to
ensure as much as possible that only a single Validator bean of each
type is registered.

Validation auto-configuration now does the following:
- If no validator is found: Registers a `LocalValidatorFactoryBean`
  (providing both Spring and JSR validation)
- If the user defines a Spring & JSR validator: Backs off
- If the user defines only a JSR validator: Adapts it to a Spring
  validator (without exposing another JSR implementation)

WebMvcAutoConfiguration auto-configuration has been updated to make
MVC validation follow common Spring Boot patterns:
- If not validator beans are found (due to the user excluding
  ValidationAutoConfiguration) a new `mvcValidator` bean will be
  registered.
- If a single validator bean is found it will be used for MVC
  validation.
- If multiple validator beans are defined it will either use the one
  named `mvcValidator` or it will register a new `mvcValidator` bean

Any automatically registered `mvcValidator` bean will not implement
the JSR validator interface.

Finally, it is no longer possible to provide an MVC validator via a
`WebMvcConfigurer`.

Fixes gh-8495
2017-04-19 22:18:12 -07:00
Phillip Webb 393c17b68b Support @SpringBootTest with @ContextHierarchy
Update SpringBootTestContextBootstrapper to detect `@ContextHierarchy`
annotations so that only the last child creates a
`WebApplicationContext`.

Prior to this commit a context hierarchy would start two embedded web
servers which is inconsistent with the `SpringApplicationBuilder`
behavior.

Fixes gh-8311
2017-04-18 14:56:12 -07:00
Phillip Webb f3c45077ac Merge pull request #8924 from walterjs/master
* pull8924:
  Fail fast on getKeyFromServer() failure
2017-04-18 14:56:10 -07:00
Phillip Webb 8eb79b3c0f Polish 2017-04-18 11:13:12 -07:00
Phillip Webb b2ae6b5f50 Merge branch '1.4.x' into 1.5.x 2017-04-17 22:14:45 -07:00
Phillip Webb cdf3eadc95 Rename AbstractTemplateAvailabilityProvider
Rename `AbstractTemplateAvailabilityProvider` to
`PathBasedTemplateAvailabilityProvider`.

Closes gh-8913
2017-04-17 22:12:44 -07:00
Phillip Webb f46d799f31 Polish 2017-04-17 22:08:51 -07:00
Phillip Webb c97268981a Polish 2017-04-11 20:59:03 -07:00
Phillip Webb d301d0f4c3 Merge branch '1.4.x' into 1.5.x 2017-04-11 20:42:48 -07:00
Phillip Webb 758ddcd420 Polish 2017-04-11 20:17:23 -07:00
Phillip Webb 3b93bb46e0 Revert accidental call to .close()
Remove call to `.close()` which was accidentally left in after some
performance testing.
2017-04-04 09:56:03 -07:00
Phillip Webb ad38776de3 Polish 2017-04-04 09:48:10 -07:00