1157 Commits

Author SHA1 Message Date
Phillip Webb
5b66ffbb4b Merge branch '1.4.x' into 1.5.x 2016-10-31 23:09:36 -07:00
Phillip Webb
97fee46682 Revert Layout changes
This reverts commits:
- 974ec92ad61e6d1d9b18c83bd49c074be5d36fbe.
- 537e0c12c28079c97e85fb5e7c68a81f47d2a8cb.
- 500a3df6e941e43a98850617bae23de29179216b.
2016-10-31 21:08:15 -07:00
Andy Wilkinson
cdcc3d2f28 Ensure getResources("") includes nested root URLs
Previously, if Boot's JarURLConnection pointed to the root of a nested
entry, e.g. /BOOT-INF/classes, a call to getInputStream() would throw
an IOException. This behavior is reasonable for a URL that points
to the root of a normal jar as the jar itself is on the class path
anyway. However, for a nested jar it meant that a call to
ClassLoader.getResources("") would not include URLs for any nested
jars and directories (/BOOT-INF/classes and jars in /BOOT-INF/lib).
This is due to some logic in URLClassPath.Loader.findResource that
verifies a URL by opening a connection and calling getInputStream().

The result of missing URLs for the root of nested jars and directories
is that classpath scanning that scans from the root (not a good idea
for performance reasons, but something that we should support) would
not find entries in /BOOT-INF/classes or in jars in /BOOT-INF/lib.

This commit updates our JarURLConnection so that it no longer throws
an IOException when asked for an InputStream for the root of a nested
entry (directory or jar).

Fixes gh-7003
2016-10-31 12:06:35 -07:00
Phillip Webb
57d5a2ebc6 Formatting 2016-10-31 11:41:45 -07:00
Stephane Nicoll
236f03c4bb Merge branch '1.5.x' 2016-10-31 11:38:54 +01:00
Johnny Lim
7bb63238ab Fix typo
Closes gh-7253
2016-10-31 11:37:52 +01:00
Stephane Nicoll
d27ffd289a Merge branch '1.5.x' 2016-10-31 10:38:06 +01:00
Stephane Nicoll
974ec92ad6 Fix broken build 2016-10-31 10:37:57 +01:00
Dave Syer
5f5e3bf6c3 Merge branch '1.5.x' 2016-10-30 11:24:52 +00:00
Dave Syer
537e0c12c2 Support for custom layout types to change loader classes
A layout can
also optionally change the loader jar that is unpacked in the root
of the repackaged archive by implementing a new method in Layout.
2016-10-30 11:24:29 +00:00
Dave Syer
500a3df6e9 Add LayoutFactory in spring.factories
Instead of a fixed enum of layout types, user can provide custom
layouts via implementations of LayoutFactory in spring.factories.
2016-10-30 11:24:29 +00:00
Stephane Nicoll
1448902c14 Merge branch '1.5.x' 2016-10-28 13:31:56 +02:00
Stephane Nicoll
f6959ccbcd Merge branch '1.4.x' into 1.5.x 2016-10-28 13:31:38 +02:00
Stephane Nicoll
7f8849c62b Merge branch '1.3.x' into 1.4.x 2016-10-28 13:31:19 +02:00
Stephane Nicoll
5863e6f78c Fix class name in generated meta-data
Previously, the algorithm that computes the String representation of a
class reference and a property type was shared. This lead to generic
information for group's `type` and `sourceType` property.

This commit separates that logic in two: `getQualifiedName` is now
responsible to generate a fully qualified class name while the existing
`getType` is solely responsible to generate a type representation for the
property. Only the latter has generic information.

Closes gh-7236
2016-10-28 13:23:47 +02:00
Andy Wilkinson
f2c7e22731 Merge branch '1.5.x' 2016-10-26 12:13:38 +01:00
Andy Wilkinson
6b3eede59f Merge branch '1.4.x' into 1.5.x 2016-10-26 12:13:26 +01:00
Andy Wilkinson
6a68c8f7e0 Restore Handler logic that was changed during its merge
This commit restores the logic in Handler that was changed when
d20ac56a was merged, while leaving the structural improvements intact.

In addition to a couple of changes where a typo meant the wrong
variable was being referenced, some logic branches now return false
rather than called super. This realigns our Handler's behaviour with
that of the JDK's.

Some more tests have also been added to try to catch the problems that
were introduced during the merge.

Closes gh-7021
2016-10-26 11:10:38 +01:00
Phillip Webb
57fb3888ac Merge branch '1.5.x' 2016-10-25 20:18:47 -07:00
Phillip Webb
3c5328924c Merge branch '1.4.x' into 1.5.x 2016-10-25 20:17:55 -07:00
Andy Wilkinson
d20ac56afd Align our jar URL stream handler with the JDK's
Previously our handler didn't override parseURL or sameFile which
resulted in behaviour that differed from that of the JDK's handler.
Crucially, this would result in our JarURLConnection being passed
a spec that didn't contain a "!/". A knock-on effect of this was
that the connection would point to the root of the jar rather than
the intended entry.

Closes gh-7021
2016-10-25 20:16:32 -07:00
Andy Wilkinson
f0798253a3 Merge branch '1.5.x' 2016-10-24 22:16:34 +01:00
Andy Wilkinson
5b9eaab6c0 Merge branch '1.4.x' into 1.5.x 2016-10-24 22:16:23 +01:00
Andy Wilkinson
ee7141cf63 Allow PropertyLauncher loader.path to be configured using manifest
Closes gh-7178
2016-10-24 22:14:56 +01:00
Stephane Nicoll
73b5afa56e Merge branch '1.5.x' 2016-10-24 18:08:39 +02:00
Stephane Nicoll
ae4dd0d17e Merge branch '1.4.x' into 1.5.x 2016-10-24 18:08:23 +02:00
Stephane Nicoll
a638dcd51b Remove unnecessary use of System.out.println 2016-10-24 18:07:40 +02:00
Andy Wilkinson
3f655d998d Merge branch '1.5.x' 2016-10-24 12:20:41 +01:00
Andy Wilkinson
9abafb839b Merge branch '1.4.x' into 1.5.x 2016-10-24 12:20:23 +01:00
Andy Wilkinson
be597d7ce9 Fix handling of cyrillic characters in AsciiBytes hashCode method
Closes gh-7202
2016-10-24 12:19:57 +01:00
Andy Wilkinson
702d904d53 Merge branch '1.5.x' 2016-10-19 16:51:23 +01:00
Andy Wilkinson
d7e2708687 Merge branch '1.4.x' into 1.5.x 2016-10-19 16:51:14 +01:00
Andy Wilkinson
999fa123df Deprecate support for Gradle 2.7 and earlier 2016-10-19 16:50:35 +01:00
Andy Wilkinson
2a685a8c15 Merge branch '1.5.x' 2016-10-18 13:47:33 +01:00
Andy Wilkinson
b7c55fb192 Merge branch '1.4.x' into 1.5.x 2016-10-18 13:47:20 +01:00
Andy Wilkinson
a31180dd68 Avoid calling URL.getContent() when defining a package
URL.getContent() is shorthand for URL.openConnection().getContent().
It creates an InputStream that isn't explicitly closed. This means
that a file handle remains open until the URLConnection is garbage
collected. This can lead to the process exceeding the limit for open
files.

Previously, LaunchedURLClassLoader was using getConent() when
proactively defining a package for a class that is about to be loaded.
getContent() was used to access nested jar files to check if they
contained the package and, if so, to retrieve the jar's manifest.

In place of using getContent(), this commit uses JarURLConnection's
getJarFile() method which provides access to the JarFile without the
unwanted side-effect of opening an input stream.

Closes gh-7180
2016-10-18 13:35:33 +01:00
Stephane Nicoll
d79546da74 Merge branch '1.5.x' 2016-10-17 17:52:29 +03:00
Stephane Nicoll
6186262ecc Switch excludeDevtools to true by default
Switch the default value of `excludeDevtools` from `false` to `true` as
it is more sensible to exclude such dependency by default.

Closes gh-7170
2016-10-17 17:52:12 +03:00
Andy Wilkinson
f48545bd57 Merge branch '1.5.x' 2016-10-14 09:20:12 +01:00
Andy Wilkinson
899b8a04cb Merge branch '1.4.x' into 1.5.x 2016-10-14 09:20:02 +01:00
Andy Wilkinson
24f8c737fb Make relative PID_FOLDER and LOG_FOLDER absolute using jar's directory
Closes gh-7092
Closes gh-7093
2016-10-14 09:19:11 +01:00
Andy Wilkinson
84c9c7bd92 Merge branch '1.5.x' 2016-10-13 16:55:33 +01:00
Andy Wilkinson
57b7357be7 Merge branch '1.4.x' into 1.5.x 2016-10-13 16:55:21 +01:00
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
2016-10-13 16:51:54 +01:00
Phillip Webb
01900c8342 Merge branch '1.5.x' 2016-10-11 23:42:14 -07:00
Phillip Webb
d818a09ed8 Polish 2016-10-11 23:38:14 -07:00
Stephane Nicoll
c50a352999 Merge branch '1.5.x' 2016-10-11 15:37:07 +02:00
Stephane Nicoll
28ed59ca6e Polish contribution
Closes gh-6645
2016-10-11 15:36:35 +02:00
Plamen Totev
3cccc732df Add workingDirectory option for Maven plugin run/start
Add configuration option that specifies the working directory to use to
run/start the application via the Maven plugin.

Closes gh-6243
2016-10-11 15:36:27 +02:00
Stephane Nicoll
daaa545d69 Merge branch '1.5.x' 2016-10-06 17:09:24 +02:00