Commit Graph

1048 Commits

Author SHA1 Message Date
Stephane Nicoll
c06ff7061f Revert Shade annotation processor dependencies
This commit reverts 45d5b60

See gh-7883
2017-01-05 17:04:34 +01:00
Phillip Webb
45d5b60f6d Shade annotation processor dependencies
Update the annotation processor to be completely self contained. The
single required dependency is now "shaded" into the jar.

Fixes gh-7883
2017-01-04 23:02:24 -08:00
Phillip Webb
cc7c2ebb87 Migrate to android-json
Migrate from `org.json:json` to the clean room Apache 2.0 licensed
version that was developed for Android.

Fixes gh-5929
2017-01-04 23:00:06 -08:00
Phillip Webb
4cb7d86aec Drop annotation processor spring-core dependency
Remove the spring-core dependency from the annotation processor.

Fixes gh-7882
2017-01-04 22:58:28 -08:00
Andy Wilkinson
803eddf6b2 Update test to reflect quoting of STOP_WAIT_TIME in launch.script 2017-01-04 21:39:16 +00:00
Andy Wilkinson
c5e7d83e2d Fix shellcheck warnings for literal { and } characters in launch.script
Closes gh-7870
2017-01-04 21:30:42 +00:00
Andy Wilkinson
75cb545361 Update launch.script to use a consistent location for pid file
Closes gh-6924
2017-01-04 20:39:51 +00:00
Johnny Lim
f915ae197a Polish 2017-01-04 09:53:45 +01:00
dreis
cee576b8b2 Reduce memory footprint of AsciiBytes.hashCode
Update `AsciiBytes.hashCode(int hash, String string)` so that it no
longer copies the backing array of the string.

Closes gh-7851
2017-01-03 15:36:11 -08:00
Andy Wilkinson
6ced8abb86 Update the copyright header to 2017 2017-01-03 13:14:55 +00:00
Andy Wilkinson
dac249fb0d Replace use of Gradle API that's bean deprecated in 3.x
Closes gh-7734
2017-01-03 13:05:48 +00:00
Phillip Webb
41b83085a6 Restore kill -9 to launch.script force-stop
Restore the `-9` flag to the send `kill` call which was inadvertently
lost in commit a35a1022c2.

Closes gh-6223
2017-01-02 19:47:54 -08:00
Phillip Webb
a35a1022c2 Update force-stop to respect STOP_WAIT_TIME
Closes gh-6223
2016-12-30 13:23:47 -08:00
Kazuki Shimizu
40691d07f8 Add force-stop to launch.script usage
See gh-6223
Closes gh-7787
2016-12-30 13:19:36 -08:00
Phillip Webb
aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Gaurav Rawat
509be7474d Add force-stop support to launch script
Update the embedded launch script to support `force-stop`.

Closes gh-6223
2016-12-29 22:20:05 -08:00
Phillip Webb
8b69856fc9 Polish 2016-12-28 15:23:26 -08:00
Phillip Webb
85504e74a6 Merge branch '1.4.x' into 1.5.x 2016-12-27 15:05:15 -08:00
Arlo O'Keeffe
3a709511c4 Notify BuildContext of changed build-info file
Update Maven plugin to inform the BuildContext when changes are made to
the `build-info` file. Prior to this commit Eclipse could continually
trigger refreshes whenever "Refresh using native hooks or polling" was
enabled and the file was written to `src/main/resources`.

Closes gh-7741
2016-12-27 13:20:22 -08:00
Stephane Nicoll
2fe98f8f85 Merge branch '1.4.x' into 1.5.x 2016-12-27 11:59:25 +01:00
Stephane Nicoll
022f7e86a0 Align library file naming mapping
This commit aligns the mapping from library to name to the default
behaviour of the `maven-war-plugin`. Previously, our plugin would use
the full version of the library (i.e. including build timestamp if there
is one), rather than using the `baseVersion` property.

Closes gh-7743
2016-12-27 11:59:01 +01:00
Spring Buildmaster
9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Johnny Lim
e12b4a944f Polish 2016-12-21 20:18:04 -08:00
Lucas Saldanha
534a9db6fd Make stop wait time in the launch script configurable
Create a parameter `STOP_WAIT_TIME` for the startup script
that configures the time in seconds to wait for a normal
shutdown. Because of #4941 we also send a shutdown half
way the countdown.

Fixes gh-7121
2016-12-20 15:15:12 -08:00
Phillip Webb
6121208cbb Polish formatting 2016-12-19 12:47:03 -08:00
Phillip Webb
4b9cba351b Merge branch '1.4.x' into 1.5.x 2016-12-19 12:36:57 -08:00
Phillip Webb
bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Andy Wilkinson
6fb1fb580d Upgrade to Dependency Management Plugin 1.0.0.RC1
Closes gh-7636
2016-12-15 20:07:35 +00:00
Stephane Nicoll
c2ca21bb63 Merge branch '1.4.x' into 1.5.x 2016-12-15 15:30:03 +01:00
Stephane Nicoll
26643ef428 Clarify how to exclude devtools with war packaging.
Closes gh-7556
2016-12-15 15:28:25 +01:00
Alessandro Falappa
dd7d81a580 INIT INFO Required Start/Stop as embedded launch script properties
Expose the Required-Start and Require-Stop lines in the launch script
INIT INFO section as customizable embedded launch script properties.

This way one can express dependencies fron other init services by simply
changing the configuration in the build script.

Closes gh-7555
2016-12-15 14:14:50 +01:00
Johnny Lim
6d1b752ffe Polish
Closes gh-7552
2016-12-14 19:14:24 +01:00
Andy Wilkinson
53287eadf6 Merge branch '1.4.x' into 1.5.x 2016-12-08 11:38:13 +00:00
Andy Wilkinson
2d8344d46d Ensure that JarLauncher doesn't cause root jar to be on class path twice
Closes gh-7595
2016-12-08 11:34:22 +00:00
Phillip Webb
f6b0652369 Merge branch '1.4.x' into 1.5.x 2016-12-05 11:17:13 -08:00
Phillip Webb
e430583eaf Polish 2016-12-05 11:08:38 -08:00
Andy Wilkinson
0df03a95f0 Merge branch '1.4.x' into 1.5.x 2016-12-02 11:33:52 +00:00
Pei-Tang Huang
5a5e2db134 Quote $jarfile when creating arguments in launch script
Previously, if the pathname of fully executable contained any space
characters, the launch script would fail to locate the jar file

This commit fixes this issue by quoting the jarfile.

Closes gh-7535
2016-12-02 11:31:51 +00:00
Oscar Utbult
3a7969b8bb Remove redundant StringBuilder
Closes gh-7538
2016-12-01 12:11:04 +01:00
Stephane Nicoll
e63174b93f Merge branch '1.4.x' into 1.5.x 2016-11-30 15:17:41 +01:00
Stephane Nicoll
c51d836a15 Use standard file name for Maven dependencies
This commit uses standard files for libraries managed by the repackage
goal of the Maven plugin. Previously, only the name of the file was used
which could lead to duplicate libraries if the name of the target file
deviates from the default. This typically happens when the
`build.finalName` property is specified on a dependent module.

Note that the `maven-war-plugin` has an additional mechanism to customize
the file name structure of dependencies. This feature isn't supported by
the repackage goal so an explicit mention has been added in the
documentation.

Closes gh-7389
2016-11-30 15:13:25 +01:00
Johnny Lim
423f8037ce Polish
Closes gh-7530
2016-11-30 08:31:13 +01:00
Oscar Utbult
fabe35fdc4 Remove redundant toString() invocation
Closes gh-7527
2016-11-30 08:23:03 +01:00
Andy Wilkinson
1595286e04 Prefer @SpringBootApplication-annotated class when finding main class
Closes gh-6496
2016-11-29 15:44:10 +00:00
Stephane Nicoll
f84fd19eaa Polish contribution
Closes gh-7491
2016-11-29 15:20:53 +01:00
Hrishikesh Joshi
b3220985bb Detect default values defined in the parent
Closes gh-5434
2016-11-29 15:20:10 +01:00
Stephane Nicoll
06e44c71ec Merge branch '1.4.x' into 1.5.x 2016-11-29 08:02:50 +01:00
Oscar Utbult
88b83a909c Remove redundant toString() invocation
Closes gh-7510
2016-11-29 08:01:27 +01:00
Dave Syer
c6c6524b40 Support custom fat jar layouts
Allow support for custom Lyout implementations with both the Maven
and Gradle plugin. Implementations of `LayoutFactory` can now be
specified to allow customization of the layout. In addition a
layout may now implement `CustomLoaderLayout` if it wishes to
write custom loader classes.

See gh-7263
2016-11-28 16:31:53 -08:00
Phillip Webb
f5b03c81f3 Rework Repacakger timeout code
Pull up common timeout code into Repackager and remove the need for
custom subclasses.

See gh-7263
2016-11-28 16:15:39 -08:00
Phillip Webb
5ed00b3501 Merge branch '1.4.x' into 1.5.x 2016-11-28 15:27:07 -08:00
Phillip Webb
357d072a60 Polish 2016-11-28 15:14:46 -08:00
Stephane Nicoll
6e79521fff Expose skip property consistently
This commit makes sure that the `skip` command-line property can be used
for all goals of the maven plugin.

A dedicated sample for integration tests has also been added as this
change may confuse users, especially those who wish to skip a certain
goal and not the plugin execution altogether.

Closes gh-7313
2016-11-25 11:17:58 +01:00
Andy Wilkinson
655ab9871b Merge branch '1.4.x' into 1.5.x 2016-11-23 14:04:59 +00:00
Andy Wilkinson
5e79657d4b Treat URLs for same file in nested archive and from jar root as equal
Consider the following two URLs:

jar:file:/test.jar!/BOOT-INF/classes!/foo.txt
jar:file:/test.jar!/BOOT-INF/classes/foo.txt

They both reference the same foo.txt file in the BOOT-INF/classes
directory of test.jar, however the first URL does so via the
nested BOOT-INF/classes archive. Previously, this difference in the
URLs would lead to PathMatchingResourcePatternResolver returning two
resources for foo.txt when asked to find all resources matching the
pattern classpath*:/**/*.txt.

This commit updates our Handler that is used for jar: URLs to consider
the two URLs above to be equivalent such that url1 is equal to url2
and the two urls will produce the same hash code.

Closes gh-7449
2016-11-23 14:04:45 +00:00
Christian Koops
5c11059e1d Make launch script's logFilename and pidFilename configurable via properties
Closes gh-7234
2016-11-22 13:54:16 +00:00
Johnny Lim
8038882d46 Polish
Closes gh-7403
2016-11-16 13:36:51 -08:00
Andy Wilkinson
22e456a177 Merge branch '1.4.x' into 1.5.x 2016-11-15 13:14:30 +00:00
Andy Wilkinson
c2730ac63f Polish formatting and address warnings 2016-11-15 11:48:35 +00:00
Spring Buildmaster
e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Andy Wilkinson
3a2d9e31ff Merge branch '1.4.x' into 1.5.x 2016-11-08 10:36:56 +00:00
Andy Wilkinson
808185ab4e Make LaunchedURLClassLoader Java 6 compatible again
Closes gh-7334
2016-11-08 10:35:18 +00:00
Andy Wilkinson
e576225959 Merge branch '1.4.x' into 1.5.x 2016-11-08 10:03:58 +00:00
dreis
7a797909ae Reinstate LaunchedURLClassLoader's registration as parallel capable
Closes gh-7334
2016-11-08 09:58:14 +00:00
Andy Wilkinson
ef3395beaa Raise the minimum supported version of Gradle to 2.9
Closes gh-6884
2016-11-01 16:25:02 +00:00
Andy Wilkinson
20e8c36590 Merge branch '1.4.x' into 1.5.x 2016-11-01 14:26:18 +00:00
Andy Wilkinson
6828997651 Correct minimum recommended version of Gradle to be 2.9 rather than 2.8
Closes gh-7189
See gh-6884
2016-11-01 14:25:07 +00:00
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:
- 974ec92ad6.
- 537e0c12c2.
- 500a3df6e9.
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
Johnny Lim
7bb63238ab Fix typo
Closes gh-7253
2016-10-31 11:37:52 +01:00
Stephane Nicoll
974ec92ad6 Fix broken build 2016-10-31 10:37:57 +01: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
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
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
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
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
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
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
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
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
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
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
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
d818a09ed8 Polish 2016-10-11 23:38:14 -07: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
c06dc33bf6 Generate deprecated meta-data for deprecated @Bean methods
This commit makes sure that a meta-data group exposed via a deprecated
`@Bean` method is deprecated as well. This also works if the class
in which the bean method is defined is itself deprecated.

Closes gh-7100
2016-10-06 17:08:49 +02:00
Andy Wilkinson
fe10ea73b0 Merge branch '1.4.x' into 1.5.x 2016-10-05 14:58:42 +01:00
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
2016-10-05 14:58:26 +01:00
Phillip Webb
a2315378d4 Formatting 2016-10-03 22:44:36 -07:00
Stephane Nicoll
cdd59707fc Merge branch '1.4.x' into 1.5.x 2016-09-28 17:00:30 +02:00
Johnny Lim
30a677646f Polish
Closes gh-7030
2016-09-28 16:45:19 +02:00
Stephane Nicoll
9210bf0822 Merge branch '1.4.x' into 1.5.x 2016-09-27 10:14:37 +02:00
Johnny Lim
723b46ade4 Move Restarter in integration tests
Closes gh-7025
2016-09-27 10:04:38 +02:00
Andy Wilkinson
8971c8ba54 Merge branch '1.4.x' into 1.5.x 2016-09-23 13:56:53 +01:00
Andy Wilkinson
e1d53b65ba Remove redundant git-commit-id-plugin configuration from loader-tools
Closes gh-7007
2016-09-23 13:56:38 +01:00
Stephane Nicoll
474c2e4641 Fix checkstyle rule
See gh-6971
2016-09-21 14:39:00 +02:00
Stephane Nicoll
ce1e41dce3 Remove deprecated code
This code removes code deprecated in 1.4 with the exception of code that
requires an update to Spring Framework 5.

Closes gh-6971
2016-09-21 14:30:28 +02:00
Stephane Nicoll
6bd670edbc Initiate 1.4.x branch 2016-09-21 11:11:24 +02:00
Spring Buildmaster
7e9ed5e1a7 Next Development Version 2016-09-21 07:58:07 +00:00
Spring Buildmaster
5f959b074f Next Development Version 2016-09-20 20:20:06 +00:00
Andy Wilkinson
5afd610855 Merge branch '1.3.x 2016-09-19 09:28:23 +01:00
Andy Wilkinson
93ab01263c Change the ownership of the pid folder when using a sub-folder
This is an alternative to the fix made in 3b52909 which removed the
chown call entirely.

Prior to 3b52909, the ownership of $PID_FOLDER was always changed even
when its value was /var/run. This was problematic as it could prevent
other services from creating their pid folder or file.

When a sub-folder is used, changing its ownership so that it’s owned by
the user that will run the app is desirable as it limits access to the
folder. Rather than removing the chown call entirely, this commit
ensures that it only happens when a sub-folder is being used to hold the
pid file.

Closes gh-6532
2016-09-19 09:27:38 +01:00
Johnny Lim
a994b11a73 Polish 2016-09-18 23:38:21 -07:00
Phillip Webb
825dd0a26c Merge branch '1.3.x' 2016-09-16 15:07:18 -07:00
Phillip Webb
3b52909fc2 Don't change ownership of PID_FOLDER
Update the launch script so that it no longer changes ownership of the
PID_FOLDER.

Commit b24e736cfe had changed the chown
line from:
	chown "$run_user" "$PID_FOLDER/${identity}"
to:
	chown "$run_user" "$PID_FOLDER"

This meant that it was possible for the launch script to change
ownership of `/var/run` and prevent later processes from writing to
the folder.

Since PID_FOLDER is created before the chown statement, and that
the `checkPermissions` function runs to ensure that the PID file can
be written, it appears that the chown is not even required.

Fixes gh-6532
2016-09-16 14:35:21 -07:00
Johnny Lim
caa4c0800f Polish
Closes gh-6872
2016-09-13 09:25:06 +02:00
Phillip Webb
56544c8dd5 Polish 2016-09-09 10:27:44 -07:00
Phillip Webb
65b4f61a35 Polish 2016-09-01 18:02:00 +01:00
Phillip Webb
951f051df9 Polish 2016-09-01 14:39:29 +01:00
Andy Wilkinson
7841af50ef Merge branch '1.3.x' 2016-08-31 13:56:04 +01:00
Andy Wilkinson
eb1c349f97 Polish “Avoid null handler package in JarFile protocol handler registration”
See gh-6759
2016-08-31 13:50:26 +01:00
hengyunabc
33a81e87d1 Avoid null handler package in JarFile protocol handler registration
Closes gh-6759
2016-08-31 13:44:41 +01:00
Stephane Nicoll
ff48a88b91 Enable fork more when devtools is present
This commit improves the run goal to automatically fork the process when
devtools is present and log a warning when fork has been disabled via
configuration since devtools will not work on a non-forked process.

We don't want devtools to kick in for integration tests so the logic has
been placed in `RunMojo` requiring a couple of protected methods to
override.

Closes gh-5137
2016-08-31 12:10:35 +02:00
Stephane Nicoll
cf07d19ed4 Polish
See gh-6792
2016-08-31 09:27:50 +02:00
Phillip Webb
850141c405 Merge branch '1.3.x' 2016-08-29 15:30:30 +01:00
Phillip Webb
69e96c6211 Polish 2016-08-29 15:29:54 +01:00
Stephane Nicoll
afadac27bd Merge branch '1.3.x' 2016-08-27 12:34:05 +02:00
Stephane Nicoll
97f15d606d Auto-detect fork value in stop goal
So far, one has to set the "fork" value to both the start and stop
goals. Since they have the same name, sharing them in a global
configuration element does the trick. However, the plugin also supports
auto-detection of the fork value according to other parameters:
typically if an agent or jvm arguments are set, forking will be
automatically enabled. This is a problem since the stop goal is not aware
of that.

This commit transmits the value in a property attached to the
`MavenProject`. That way, the stop goal can retrieve that value and
apply the same defaults. This has the side effect that specifying the
fork value isn't necessary anymore.

Closes gh-6747
2016-08-27 12:33:44 +02:00
Andy Wilkinson
742657983b Improve the error message when additional build-info prop has null value
Closes gh-6724
2016-08-23 11:30:23 +01:00
Andy Wilkinson
f41e629760 Provide M2E lifecycle mapping metadata for Maven plugin’s build-info goal
Previously, configuring the build-info goal in a pom would result in 
Eclipse reporting an error for the pom as it didn’t know if/when to
execute the build-info goal.

This commit adds lifecycle mapping metadata so that the goal is executed
on incremental builds. This ensures that the contents of the generated
file are kept up-to-date, reflecting the latest build time, etc.

Closes gh-6723
2016-08-23 11:30:23 +01:00
Andy Wilkinson
984a6da262 Polising
Fix botched merge
2016-08-18 13:44:36 +01:00
Andy Wilkinson
e2ceece525 Merge branch '1.3.x' 2016-08-18 13:30:56 +01:00
Andy Wilkinson
85c0b44dcb Test that LaunchedURLClassLoader works when thread is interrupted
Previously, RandomAccessDataFile used a semaphore and acquired it
interruptibly. This meant that an interrupted thread was unable to
access the file. Notably, this would prevent LaunchedURLClassLoader from
loading classes or resources on an interrupted thread.

The previous commit (937f857) updates RandomAccessDataFile to acquire
the semaphore uninterruptibly. This commit adds a test to
LaunchedURLClassLoader to verify that it can now load a resource from
an interrupted thread.

Closes gh-6683
2016-08-18 12:03:05 +01:00
hengyunabc
937f85765c Ensure that LaunchedURLClassLoader works when thread is interrupted
See gh-6683
2016-08-18 11:59:45 +01:00
Andy Wilkinson
b3e0b3a542 Consider mvn spring-boot:run that exits with 130 (SIGINT) to be successful
Previously, if mvn spring-boot:run with a forked JVM was killed with 
CTRL+C, the run would be considered unsuccessful. This commits updates
the run mojo to consider a forked JVM that exists with 130 (the exit
code produced when exiting due to SIGINT which is what CTRL+C sends) to
be successful.

Closes gh-6498
2016-08-15 11:23:49 +01:00
Andy Wilkinson
11ccc5785c Merge branch '1.3.x' 2016-08-12 12:08:25 +01:00
Andy Wilkinson
ae6182a964 Update requiresUnpack documentation of unpack location
The unpack location is (largely) an implementation detail and the
Repackage Mojo was the only place where it was explicity documented.
Rather than updating the outdated location, this commit removes it
entirely to avoid encouraging people to rely on the location.

Closes gh-6624
2016-08-12 12:07:47 +01:00
Andy Wilkinson
b47da0d265 Fix spellcheck warning introduced in 6bbd50e0
Closes gh-6628
2016-08-11 20:35:47 +01:00
Andy Wilkinson
8c106af384 Allow default value for CONF_FOLDER to be set at build time
Closes gh-6549
2016-08-11 20:25:59 +01:00
Andy Wilkinson
899b851c6f Remove META-INF/INDEX.LIST when repackaging a jar file
META-INF/INDEX.LIST files are pointless in an executable jar and
moving application classes from the root of the jar to
BOOT-INF/classes breaks the index, resulting in an
InvalidJarIndexException being thrown.

This commit updates the Repackager to automatically remove a
META-INF/INDEX.LIST file from a jar file that is being repackaged.

Closes gh-6601
2016-08-10 13:23:49 +01:00
Spring Buildmaster
334baaeffd Next development version 2016-07-28 19:54:01 +00:00
Spring Buildmaster
a89ef5df6e Next Development Version 2016-07-28 09:18:40 +00:00
Andy Wilkinson
8b987e29c1 Fix spring-boot-gradle-plugin package tangle
Relocate `SpringBootPlugin` to fix a package tangle.

Fixes gh-6355
2016-07-11 10:43:52 -07:00
Andy Wilkinson
8e669e2eef Merge branch '1.3.x 2016-07-11 17:03:16 +01:00
Andy Wilkinson
4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
2016-07-11 16:46:05 +01:00
Spring Buildmaster
2216369348 Next Development Version 2016-07-04 14:15:02 +00:00
Andy Wilkinson
92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
2016-07-01 10:44:23 +01:00
Phillip Webb
266445aaf0 Polish 2016-06-29 10:44:33 -07:00
Stephane Nicoll
e9fb51bdd7 Fix test 2016-06-27 12:08:48 +02:00
Stephane Nicoll
6631136f91 Merge branch '1.3.x' 2016-06-27 12:08:04 +02:00
Stephane Nicoll
17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Phillip Webb
a5cddf79a8 Reduce JarURLConnection allocations
Update JarURLConnection & Handler so that a shared static final
connection is returned for entries that cannot be found.

See gh-6215
2016-06-26 08:40:25 -07:00
Phillip Webb
c22a0e90a2 Polish 2016-06-24 11:52:43 -07:00
Andy Wilkinson
0d207d438a Improve the performance of JarURLConnection
This commit improves the performance of JarURLConnection. There are two
main changes:

Firstly, the way in which the spec is determined has been changed so
that it’s no longer necessary to create an absolute file. Instead,
the JarFile’s pathFromRoot is used to extract the spec from the URL
relative to the JarFile.

Secondly, the number of temporary Objects that are created has been
reduced, for example by tracking an index as we process a String
rather than creating a new substring for each iteration.

See gh-6215
2016-06-24 16:14:33 +01:00
Andy Wilkinson
9788a7bdda Merge branch '1.3.x' 2016-06-24 11:53:01 +01:00
Andy Wilkinson
8d491f278b Create FilePermission lazily in JarURLConnection
JarURLConnection is very performance sensitive. The change in 3772d9f
meant that every JarURLConnection would create a FilePermission,
irrespective of whether it was actually used.

This commit updates JarURLConnection to create its FilePermission
lazily. When there is no security manager a permission will no longer
be created at all.

Closes gh-5411
See gh-6215
2016-06-24 11:49:35 +01:00
Phillip Webb
bdb0eb29a3 Cache JarURLConnection absoluteFile lookups
Update JarURLConnection.getNormalizedFileUrl so that expensive absolute
file lookups are cached.

See gh-6177
See gh-6109
2016-06-23 14:30:10 -07:00
Phillip Webb
b03d8a5914 Skip antlib integration tests on -DskipTests 2016-06-23 14:29:11 -07:00
Stephane Nicoll
cfe1fe8736 Merge branch '1.3.x' 2016-06-23 10:44:55 +02:00
Stephane Nicoll
bffcb1aad2 Document available layouts
Closes gh-5524
2016-06-23 10:42:47 +02:00
Andy Wilkinson
a395679b95 Fix JarURLConnectionTests on Windows
Closes gh-6109
2016-06-22 10:02:42 +01:00
Andy Wilkinson
02dbd6e4a7 Allow JarURLConnection to be created with a relative URL
Previously, JarURLConnection assumed that that URL with which it was
created would contain the absolute path of the underlying jar file.
This meant that when it was created with a relative URL, it could fail
to find an entry or throw a StringIndexOutOfBoundsException.

This commit updates the logic for normalizing the input URL so that
both absolute and relative URLs are supported.

Closes gh-6109
2016-06-21 11:30:51 +01:00
Phillip Webb
7446235ff4 Polish 2016-06-20 20:13:13 -07:00
Stephane Nicoll
5407cf5f7a Prevent several registration of the same config pojo
This commit detects case where the same set of keys are exposed several
times and prevents the compilation to complete. Previously, duplicate
keys were silently added to the meta-data.

Closes gh-5939
2016-06-20 09:19:02 +02:00
Andy Wilkinson
7a5880c900 Merge branch '1.3.x' 2016-06-16 11:36:28 +01:00
Andy Wilkinson
ec7d6381aa Update RunMojo to fail when forked JVM returned non-zero exit code
Closes gh-6172
2016-06-16 11:34:15 +01:00
Andy Wilkinson
af20dc6cc4 Merge branch '1.3.x' 2016-06-15 20:52:18 +01:00
Andy Wilkinson
159ef8f189 Ensure that URL returned from ExplodedArchive.getURL() is encoded
Closes gh-5971
2016-06-15 20:47:29 +01:00
Andy Wilkinson
fc78a8de90 Merge branch '1.3.x' 2016-06-15 20:22:56 +01:00
Andy Wilkinson
c808de0021 Allow custom repackage task to be used without a global main class
Closes gh-5956
2016-06-15 20:17:51 +01:00
Dave Syer
9e8beb7323 Merge remote-tracking branch 'origin/1.3.x' 2016-06-14 09:56:18 +01:00
Dave Syer
e4b544bd39 Create PID_FOLDER if it doesn't exist
In fact the folder was already created if the app is running as
a different user, but not if running as the current user, so it
was just a question of moving one line out of an if block.

Fixes gh-5986
2016-06-14 09:54:58 +01:00
Phillip Webb
e27bc9ddea Merge branch '1.3.x' 2016-06-10 17:24:02 -07:00
Phillip Webb
f27bdcb737 Prevent APT crashes on older Java versions
Update TypeUtils to guard against the use of older Java versions.
Both `Collection` and `Map` type lookups now fallback to generic free
versions of the classes.

Prior to this commit using `xmlbeans-maven-plugin` in combination with
Spring Boot's annotation processor could result in
`IllegalArgumentException: Incorrect number of type arguments`.

Fixes gh-6122
2016-06-10 17:06:45 -07:00
Stephane Nicoll
f9288a3af1 Revert "Polish maven repositories definition"
This commit reverts 62fa602fea

See gh-6031
2016-06-10 17:25:31 +02:00
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
2016-06-10 11:55:46 +02:00
Phillip Webb
77f6b4c983 Formatting 2016-06-09 20:45:37 -07:00
Andy Wilkinson
436b58acbf Merge branch '1.3.x' 2016-06-01 15:41:36 +01:00
Andy Wilkinson
3772d9f937 Update JarURLConnection to only require file read permission
Previously, JarURLConnection didn't override getPermission(). This
meant that it required all permissions. This was at odds with the
Oracle JVM's concrete sun.net.www.protocol.jar.JarURLConnection which
overrides getPermission to return a FilePermission with the read
action for the path of the underlying jar.

This commit updates our JarURLConnection to align its behaviour with
sun.net.www.protocol.jar.JarURLConnection.

Closes gh-5411
2016-06-01 15:33:36 +01:00
Andy Wilkinson
ac5afb142c Merge branch '1.3.x' 2016-05-25 17:42:51 +01:00
Andy Wilkinson
a98d1a41a4 Run Maven Plugin's integration tests when full profile is active
Closes gh-6036
2016-05-25 17:42:08 +01:00
Andy Wilkinson
fc1814919c Add jars that should have been commited in 6ed63a6 2016-05-25 17:41:12 +01:00
Stephane Nicoll
6ed63a6eff Add support of system-scoped dependencies
In Maven land, provided and system-scope dependencies are very similar,
the latter being an special kind that allows you to specify the path to
the artifact rather than using the repository to locate it.

Prior to this commit, the repackage goal of the maven plugin was
inconsistent as it would repackage provided-scope dependencies but would
ignore the system-scoped ones.

This commit adds an extra boolean flag, `includeSystemScope` to control
this behaviour. For backward compatibility reasons, its default value is
`false`.

Closes gh-2224
2016-05-24 16:25:54 +02:00
Andy Wilkinson
183613a5ca Merge branch '1.3.x' 2016-05-13 11:41:58 +01:00
Andy Wilkinson
4c65e5e704 Always handle quoted arguments correctly in the launch script
Previously, arguments passed to the script were handled in one way
if a service was being started using start-stop-daemon and in another
way if start-stop-daemon wasn’t available or the application is being
launched in run mode. This meant that quoted arguments were only 
handled correctly when the application was being started using
start-stop-daemon.

This commit updates the launch script so that argument handling is
the same across all three different way that the application can be
launched.

Closes gh-5942
2016-05-13 11:13:54 +01:00
Tommy Ludwig
bae567992d Polish Maven plugin doc
Closes gh-5938
2016-05-13 09:49:57 +02:00
Andy Wilkinson
e561cc1997 Don't use a separate thread in the launcher to call app's main method
Using a separate thread to call the application's main method is
unnecessary – the context class loader of the current thread can be
updated instead – and makes exception and exit code handling more
complicated than it needs to be.

This commit updates the Launcher so that it calls the main method
runner using the current (main) thread. As a result, any exception
that's thrown will be caught by the JVM and result in a non-zero exit
code being returned from the process.

Closes gh-5922
2016-05-12 16:57:16 +01:00
Phillip Webb
6575ca6ff8 Merge branch 1.3.x 2016-05-10 09:35:49 -07:00
Phillip Webb
7fb545d26c Polish 2016-05-10 09:35:10 -07:00
Christian Flamm
6bbd50e084 Update launch script to canonicalize jarfolder
Previously, if the folder which contained the jar was a symlink the
launch script would use the symlinked folder's name when determining
the default identity.

This commit updates the launch script so that symlinks are resolved
and the canonical name of the folder which contains the jar is used
when determining the script's default identity. The behaviour when
APP_NAME has been set is unchanged.

Closes gh-5679
Closes gh-5733
2016-05-10 16:20:33 +01:00
Spring Buildmaster
819a9574a6 Next Development Version 2016-05-10 05:28:34 +00:00
Spring Buildmaster
376bbe68d8 Next Development Version 2016-05-06 11:23:57 +00:00
Stephane Nicoll
21536f64e1 Polish info contributor feature
This commit improves the `InfoContributor` infrastructure as follows:

* `InfoEndpoint` no longer breaks its public API and returns a Map as
before
* `Info` is now immutable
* All properties of the build are now displayed. Since we control the
generation of that file, there is no longer a mode to restrict what's
shown
* Build info is now generated in `META-INF/build-info.properties` by
default

Closes gh-5734
2016-05-06 10:52:26 +02:00
Stephane Nicoll
6fe9177f0d Merge branch '1.3.x' 2016-05-02 10:40:27 +02:00
Stephane Nicoll
4ccc7dc554 Ignore invalid accessors
Previously, if a void method with a single argument was named "set", the
annotation processor wrongly considered it was a setter candidate. This
commit updates the condition to ignore it.

Closes gh-5826
2016-05-02 10:38:19 +02:00