Commit Graph

309 Commits (705551c485b5f8658528ccb96b53a19fee6fb03b)

Author SHA1 Message Date
Spring Buildmaster 17a5bb0be4 Next development version 7 years ago
Spring Buildmaster 41c5c0e7c9 Next development version 7 years ago
Phillip Webb aa57ca7e18 Polish 7 years ago
Spring Buildmaster 05d4d0281c Next Development Version 8 years ago
Spring Buildmaster 88e43c8421 Next Development Version 8 years ago
Andy Wilkinson d5184724b0 Downgrade Jersey to version that plays nicely with Docker's Java client 8 years ago
Andy Wilkinson ec8ae2f91e Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson e60a261952 Do not allow failure to remove container to mask earlier failure 8 years ago
Andy Wilkinson a215103bb5 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 31ff7f1846 Tolerate Successfully built being found in response other than last
Different versions of Docker produce different responses when building
and tagging an image. On CI, a response with a stream like
"Successfully built 185991ffe24a" followed by a response with a
stream like "Successfully tagged spring-boot-it/centos:6.9-a23bced6"
is received. By default, for the building of an image to be considered
successful, the Docker Java client requires the stream for the last
response item to contain "Successfully built". This means that, on the
CI server, it incorrectly believes that the building of the tagged
image has failed.

This commit uses a custom BuildImageResultCallback that doesn't
require the last response to be the one that has a stream containing
"Successfully built". Instead, it looks back through the error-free
responses (newest to oldest) looking for one with a stream containing
"Successfully built".
8 years ago
Andy Wilkinson 5722c149d0 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 0270ccafa5 Enable Docker command debug logging to improve diagnostics on CI server 8 years ago
Andy Wilkinson 3cf8e81a8b Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson a69a851ae9 Drop CentOS 5 from launch script tests and upgrade to 6.9
CentOS 5 was declared EOL in March 2017 and yum on longer works
out of the box. 6.9 is the latest release of CentOS 6. Tests for
CentOS 7 have not been added as it uses systemd rather than SysVinit.

Closes gh-9395
8 years ago
Spring Buildmaster 9768b0a8c2 Next Development Version 8 years ago
Spring Buildmaster d719d2cbbc Next Development Version 8 years ago
Andy Wilkinson 17062f9589 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 2ddcf0e831 Avoid using File.renameTo(File) as it doesn't work on Windows 8 years ago
Andy Wilkinson 50c0204f2d Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson d32c3a7f43 Correct the URL that's called to test servlet context resources
See gh-8299
Closes gh-8525
8 years ago
Andy Wilkinson 1395f38ee7 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson a2cf0455fd Fix static resource handling when run in IDE or using Maven or Gradle
The changes made for gh-8299 attempted to make static resource
handling consistent across Jetty, Tomcat, and Undertow. They did so
for application's launched using JarLauncher or WarLauncher but did
not consider application's launched in an IDE or using spring-boot:run
in Maven or bootRun in Gradle.

Running in an IDE or via Maven or Gradle introduces two new
resource locations:

 - Jars on the classpath with file protocol URLs (they are always
   jar protocol URLs when using either launcher)
 - Directories on the classpath from a project that is depended upon
   and contains resources in META-INF/resources

This commit updates the factories for all three containers to handle
these new resources locations. The integration tests have also been
updated.
8 years ago
Spring Buildmaster d23fa24340 Next Development Version 8 years ago
Spring Buildmaster 2a83e80a9b Next Development Version 8 years ago
Phillip Webb f1012c104a Polish 8 years ago
Phillip Webb 987b6c956e Polish 8 years ago
Andy Wilkinson 68af831059 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson b443b745fb Make static resource handling consistent across embedded containers
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
8 years ago
Phillip Webb 47fd5f4fac Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb 47b00c086c Polish 8 years ago
Andy Wilkinson f67dd957b1 Ignore excludeDevtools on extension when it has been set on bootRepackage
Previously, bootRepackage's excludeDevtools property would be
overridden by the springBoot extension's excludeDevtools property.
This prevented devtools from being included by configuring it on the
repackaging task.

This commit corrects the logic so that the setting on the repackaging
task takes priority. It also adds some tests to verify the behaviour.

Closes gh-8308
8 years ago
Spring Buildmaster 5c12500366 Next Development Version 8 years ago
Spring Buildmaster a2696bf873 Next Development Version 8 years ago
Spring Buildmaster ed1ce140c0 Next Development Version 8 years ago
Andy Wilkinson ba8f7214d8 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 0e72ef1a10 Improve diagnostics for in StarterDependenciesIntegrationTests
The root cause of the build failure something has a null message which
means there's no information available about why the build failed.
Instead of calling fail when a BuildException occurs, this commit
wraps it in a RuntimeException and rethrows it. This should make the
entire chain of exceptions available when a failure occurs.
8 years ago
Andy Wilkinson 69e7e31b1c Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 7c2664f959 Ensure that jar entry names use forward slashes, even on Windows
Previously, in the DevTools integration tests, portions of a File's
path were used to create the name of a jar entry. On Windows this
resulted in the entry containing \ characters. As a result the
directory structure was incorrect and the classes could not be loaded
from the jar.

This commit ensures that any \ characters are replaced with /
characters.

See gh-7782
8 years ago
Phillip Webb aacf5d660f Update copyright year for changed files 8 years ago
Gaurav Rawat 509be7474d Add `force-stop` support to launch script
Update the embedded launch script to support `force-stop`.

Closes gh-6223
8 years ago
Phillip Webb a23591e047 Support Jetty 9.4 and upgrade to 9.4.0.v20161208
Update `JettyEmbeddedServletContainerFactory` to support Jetty 9.4
directly and Jetty 9.3 via reflection. The primary difference between
Jetty 9.3 and 9.4 are the session management classes. Websocket suppport
has also been updates, but this is handled transparently by the
Spring Framework support.

Fixes gh-7599
8 years ago
Spring Buildmaster 9057f9ae1f Next development version 8 years ago
Phillip Webb 4b9cba351b Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb bd74c3d327 Polish formatting 8 years ago
Johnny Lim 6d1b752ffe Polish
Closes gh-7552
8 years ago
Andy Wilkinson b546fd1046 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 6061dd492e Increase timeout in DevTools integration tests and improve diagnostics 8 years ago
Vedran Pavic 8bd2e69915 Update Docker images used by launch script integration tests 8 years ago
Phillip Webb 9e18021e8c Merge branch '1.4.x' into 1.5.x 8 years ago
Phillip Webb fce17ca6d9 Polish 8 years ago
Andy Wilkinson cd3f951d35 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 5dea4c5a03 Wait for server port to be written in a more robust manner
Previously, we just waited for the file to exist before trying to read
the port from it. This left a window where the file existed but its
contents had not be written which could result in a
NumberFormatException.

This commit now waits for the file to have a length that is greater
than zero.

See gh-7379
8 years ago
Andy Wilkinson eff0fc0221 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 918e122ddc Fix remote DevTools' support for adding and removing classes
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
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Andy Wilkinson ef3395beaa Raise the minimum supported version of Gradle to 2.9
Closes gh-6884
8 years ago
Andy Wilkinson 899b8a04cb Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 24f8c737fb Make relative PID_FOLDER and LOG_FOLDER absolute using jar's directory
Closes gh-7092
Closes gh-7093
8 years ago
Andy Wilkinson 57b7357be7 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 03deff9a1c Handle relative pid folder correctly in the launch script
Previously, a relative PID folder was not handled correctly when
running stop, status, or force_reload. This meant that a service
could be started when configured to use a relative pid file, but
then could not be stopped.

The PID folder should be treated as relative to the service's jar
file. This commit updates stop, status, and force_reload to push the
jar file's directory so that this is now the case for those three
commands.

Closes gh-7092
8 years ago
Andy Wilkinson 31e6819a6c Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 97cf2e9677 Polish new tests for the Gradle plugin's deprecated ID
The output capture for the deprecation warning only appears to work
when the test is run in isolation. I can't figure out why that's the
case, particularly as we have another test class
(BootRunResourceTests) that uses OutputCapture and works reliably.

I'm cutting my loses and removing the use of OutputCapture and the
assertion that the warnings is logged.

See gh-6997
8 years ago
Andy Wilkinson fe10ea73b0 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson ad3e5c04bb Add a second, portal-compatible ID to the Gradle plugin
To be compatible with Gradle's plugin portal, plugins must have an
ID that uses a reverse domain name. This means that spring-boot is
not compatible.

This commit introduces a new ID, org.springframework.boot, and
deprecates the old ID.

Closes gh-6997
8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
Spring Buildmaster 5f959b074f Next Development Version 8 years ago
Andy Wilkinson f266e8c69d Merge branch '1.3.x' 8 years ago
Andy Wilkinson 5a539ce381 Update launch script integration tests to work with Docker 1.12
Closes gh-6914 (I hope)
8 years ago
Phillip Webb a3c63b9c34 Fix broken Gradle test
Update test broken by recent Jetty changes.

See gh-6692
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Phillip Webb a2d8a769ab Fix broken `tomcat-juli` gradle test
Fix Gradle test broken when `tomcat-juli` was removed.

See gh-6192
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Andy Wilkinson fc78a8de90 Merge branch '1.3.x' 9 years ago
Andy Wilkinson c808de0021 Allow custom repackage task to be used without a global main class
Closes gh-5956
9 years ago
Stephane Nicoll f9288a3af1 Revert "Polish maven repositories definition"
This commit reverts 62fa602fea

See gh-6031
9 years ago
Stephane Nicoll 62fa602fea Polish maven repositories definition
Previously, Maven repositories definition was specified in a profile that
is active by default. It means that as soon as any profile is enabled by
the user, said profile is no longer enabled. This has the nasty
consequences of having copy/paste in several places to make sure our own
profiles still have the proper repositories definition.

This commit creates a single "repositories" profile that is always active
unless a given property is explicitely specified. This allows to remove
the duplication and make things more consistent.

Some Gradle-specific repositories were also hard-coded in two modules
without any profile at all, meaning they were polluting the build of
anybody using it. While the impacted modules are gradle specific, that
repository has been shared in the new "repositories" profile as well.

Closes gh-6031
9 years ago
Johnny Lim 38dc9ec441 Polish 9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Andy Wilkinson 5d2177038f Merge branch '1.3.x' 9 years ago
Vedran Pavic 3891b242a3 Update launch script integration tests
- Use the latest Docker image for Ubuntu 14.04 LTS based tests
- Add Ubuntu 16.04 LTS based tests

Closes gh-5868
9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Andy Wilkinson 3bfc6b1a4b Avoid packaging two versions of same dependency in Gradle repackaging
Previously, the Gradle plugin would include all of the dependencies
from both the compile and runtime configurations in the repackaged
jar. In the unlikely event that the compile and runtime configurations
contained different versions of the same dependency, this would lead
to both versions of the dependency being packaged in the jar file.

The runtime configuration extends the compile configuration so, in
normal circumstances, it will contain a superset of the compile
configuration's dependencies. In the situation described above where
the two configurations contain different versions of the same
dependency the runtime configuration will only contain whichever
version of the two dependencies has "won". By default, this will
be the dependency with the higher version.

This commit updates the Gradle plugin to only include the runtime
configuration's resolved dependencies during repackaging. As explained
above, the runtime configuration extends the compile configuration so
any compile dependencies will still be included, with the added
benefit that duplicate versions of the same dependency will have been
resolved to a single, preferred version.

Closes gh-5749
9 years ago
Andy Wilkinson f1f5066786 Merge branch '1.3.x' 9 years ago
Vedran Pavic 9e287ef611 Improve repeatability of launch script tests
Previously, tags were used for CentOS and Ubuntu images that may
change over time. This commit updates the Dockerfiles to use fixed
base images. For Ubuntu, a fixed tag is available. For CentOS we
have to resort to using the digest.

Closes gh-5397
9 years ago
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
9 years ago
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
9 years ago
Andy Wilkinson fc463afb89 Merge branch '1.3.x' 9 years ago
Andy Wilkinson 1043239de0 Ignore non-JavaExec run task when finding application's main class
Previously, FindMainClassTask would look for a property named main
on any class named run. This was based on the assumption that the
run task would be a JavaExec task (typically provided by the
application plugin). If the run task was not a JavaExec task (more
accurately, if it did not have a main property) this would result in
a build failure due to trying to read a non-existent property.

This commit updates FindMainClassTask to only use the main property
of the run task if the task is a JavaExec task. This guarantees that
the property will exist on the task, and unlike using any property
named main on a task named run, also guarantee that its value will
refer to a Java class with a main method.

Closes gh-5501
9 years ago
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
9 years ago
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
9 years ago
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
9 years ago
Andy Wilkinson d46c9a28d5 Roll back to docker-java 2.x
This reverts 2ecb33f7 and largely reverts 2c619f8d.

docker-java 3.0 was causing a variety of problems and it appears that
we can get things working with Docker Java 2.2.x and Jackson 2.6.
9 years ago
Andy Wilkinson 2ecb33f7b4 Try to fix problems caused by stricter config checking in docker-java 3.0
Previously, the launch script integration tests ran happily on OS X and
on Bamboo’s Linux instances. With the upgrade to docker-java 3.0 that
is no longer the case with the default DockerClientConfig failing on
Bamboo as the default DOCKER_CERT_PATH location does not exist.

This commit updates the client configuration so that it attempts to
build the configuration once in it default configuration and, if this
fails, it tries again without TLS verification. This skips the check
of DOCKER_CERT_PATH’s validity.
9 years ago
Andy Wilkinson 2c619f8d93 Make launch script integration tests compatible with Spring Framework 4.3
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
9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 9 years ago
Andy Wilkinson e04a8ff57d Merge branch '1.3.x' 9 years ago
Vedran Pavic 2641fe8f26 Tag Docker images created by launch script integration tests
Closes gh-5168
9 years ago