Previously, there were a number of inconsistencies in the embedded
containers' handling of static resources. The Servlet spec requires
that static resources can be served from the META-INF/resources/
directory of jars nested inside a war in WEB-INF/lib/. The intention
was also to extend this to cover jar packaging when jars are nested in
BOOT-INF/lib/. This worked when using Tomcat as long as Jasper was on
the classpath. If you didn't have Jasper on the classpath or you
were using Jetty or Undertow it did not work.
This commit updates the configuration of embedded Jetty, Tomcat, and
Undertow so that all three containers handle static resources in the
same way, serving them from jars in WEB-INF/lib/ or /BOOT-INF/lib/.
Numerous intergration tests have been added to verify the behaviour,
including tests for Tomcat 8.0 and 7.0 which is supported in addition
to the default 8.5.x. Note that static resource handling only works
with Jetty 9.3.x and 9.2 and earlier does not support nested jars (
see https://github.com/eclipse/jetty.project/issues/518 for details).
Closes gh-8299
Previously, remote DevTools only correctly supported modifying
existing classes. New classes that were added would be missed, and
deleted classes could cause a failure as they would be found by
component scanning but hidden by RestartClassLoader.
This commit introduces a DevTools-specific ResourcePatternResolver
that is installed as the application context's resource loader. This
custom resolver is aware of the files that have been added and
deleted and modifies the result returned from getResource and
getResources accordingly.
New intergration tests have been introduced to verify DevTools'
behaviour. The tests cover four scenarios:
- Adding a new controller
- Removing an existing controller
- Adding a request mapping to a controller
- Removing a request mapping from a controller
These four scenarios are tested with:
- DevTools updating a local application
- DevTools updating a remote application packaged in a jar file
- DevTools updating a remote application that's been exploded
Closes gh-7379
Previously, the launch script integration tests used Jackson 2.1 to
align with the requirements of docker-java 2.x. This stopped working
when we upgraded to Spring Framework 4.3 which requires Jackson 2.6+.
This commit updates the launch script integration tests to use
docker-java 3.0.0-RC1 which is compatible with Jackson 2.6.x. An added
benefit is that 3.0 also adds support for copying an archive to a
container, allowing the custom command that performs this function to
be removed.
Closes gh-5278
Update the samples and integration tests to use Java 8. There's no
specific reason to keep them on Java 6 and it helps keep Eclipse happy
if we upgrade.
SpringApplicationLifecycle provides lifecycle operations on the current
Spring Boot application. It can be registered as an MBean of the platform
MBean server if a specific property is set. Besides, the JMX name can
also be customized via a property in case more than one Spring Boot
application is started in the same process.
The Maven plugin uses that MBean to check that the application is ready
before ending the "start" phase. It uses it to trigger a proper shutdown
of the application during the "stop" phase.
If the process has to be forked, the platform MBean server is exposed on
a configurable port so that the maven plugin can connect to it.
Such change permits the maven plugin to integrate a classical integration
test scenario where the "start" goal is invoked during the
pre-integration phase and the "stop" goal during the post-integration
phase.
Closes gh-2525
Update invoker configuration so that only folders with a pom.xml file
are invoked. This helps when switching between the 1.1.x and master
branches since empty folders left by git no longer fail the build.
The Maven plugin allows spring-boot:run to be configured so that
resources are loaded from their output location rather than from
src/main/resources. This commit adds an equivalent configuration
option to the Gradle plugin. To disable source resources from being
added to the classpath in place of those in the output location
the configure the bootRun tasks like this:
bootRun {
addResources = false
}
Closes gh-2431
Updates to prevent the maven-invoker-plugin from downloading remote
snapshot jars. Possibly caused by the recent changes to the
spring-boot-dependencies POM.
See gh-1413
We've had problems with the starters when used with Gradle. They have
been pulling in commons-logging (#987) and the wrong version of Spring
(#1028) due to Gradle's different exclusion and dependency resolution
semantics.
This commit adds some integration tests that use Gradle's tooling API
to take each starter in turn and build a Gradle project that depends
upon it. The build looks at the transitive dependencies and checks
that neither commons-logging nor any Spring modules with the wrong
version are present.
Closes#1036