Commit Graph

342 Commits

Author SHA1 Message Date
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
Stephane Nicoll 506f6497c0 Merge branch '1.5.x' 2017-01-04 09:56:19 +01:00
Johnny Lim f915ae197a Polish 2017-01-04 09:53:45 +01:00
Phillip Webb 4026fa563f Merge branch '1.5.x' 2017-01-02 19:54:26 -08: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 a90bad37bd Merge branch '1.5.x' 2016-12-30 13:29:18 -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 53f1df86a2 Merge branch '1.5.x' 2016-12-30 12:17:28 -08:00
Phillip Webb aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Phillip Webb 4d73f3d2e9 Merge branch '1.5.x' 2016-12-29 22:22:04 -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
Spring Buildmaster 9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Phillip Webb 6e02fe59f7 Merge branch '1.5.x' 2016-12-21 22:32:43 -08:00
Johnny Lim e12b4a944f Polish 2016-12-21 20:18:04 -08:00
Phillip Webb 8b47561f7e Merge branch '1.5.x' 2016-12-20 21:56: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 1f417997f3 Merge branch '1.5.x' 2016-12-19 13:21:18 -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
Stephane Nicoll 1302d1b0e4 Merge branch '1.5.x' 2016-12-15 14:16:28 +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
Stephane Nicoll a86678cc31 Merge branch '1.5.x' 2016-12-14 19:33:34 +01:00
Johnny Lim 6d1b752ffe Polish
Closes gh-7552
2016-12-14 19:14:24 +01:00
Andy Wilkinson 39c0f229c2 Merge branch '1.5.x' 2016-12-02 11:34:00 +00: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
Stephane Nicoll 0568afc6cb Merge branch '1.5.x' 2016-11-30 08:31:41 +01:00
Johnny Lim 423f8037ce Polish
Closes gh-7530
2016-11-30 08:31:13 +01:00
Andy Wilkinson 633280d1d0 Merge branch '1.5.x' 2016-11-29 15:44:31 +00:00
Andy Wilkinson 1595286e04 Prefer @SpringBootApplication-annotated class when finding main class
Closes gh-6496
2016-11-29 15:44:10 +00:00
Phillip Webb 450ab28163 Merge branch '1.5.x' 2016-11-28 17:27:05 -08: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
Andy Wilkinson bc6b2a9c75 Merge branch '1.5.x' 2016-11-22 13:54:49 +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
Phillip Webb cb7c0b5031 Merge branch '1.5.x' 2016-11-16 16:06:53 -08:00
Johnny Lim 8038882d46 Polish
Closes gh-7403
2016-11-16 13:36:51 -08:00
Spring Buildmaster e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Phillip Webb 98a3ae9ac4 Merge branch '1.5.x' 2016-10-31 23:13:37 -07:00
Phillip Webb 97fee46682 Revert Layout changes
This reverts commits:
- 974ec92ad6.
- 537e0c12c2.
- 500a3df6e9.
2016-10-31 21:08:15 -07: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 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 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
Andy Wilkinson 264007113f Merge branch '1.5.x' 2016-09-23 13:57:04 +01: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
Andy Wilkinson 312292b93e Update Animal Sniffer and related annotations for Java 8 baseline
Closes gh-6981
2016-09-21 17:20:49 +01:00
Stephane Nicoll 6643ec3713 Next development version 2016-09-21 17:05:50 +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
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
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
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 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
Spring Buildmaster 2216369348 Next Development Version 2016-07-04 14:15:02 +00: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
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
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
Phillip Webb 5bc274ca09 Polish 2016-04-12 13:23:43 -07:00
Andy Wilkinson 1d4e52cc2b Merge branch '1.3.x' 2016-04-06 11:47:42 +01:00
Christian Brunotte 677080b8e2 Update launch.script so popd does not print directory name to stdout
Closes gh-5394
2016-04-06 11:46:36 +01:00
Andy Wilkinson 58ca9a1c5d Add a BuildInfo task for generating build.properties with Gradle
The commit adds a new BuildInfo task that can be used to generate
a build.properties file, intended for inclusion in the Actuator's
info endpoint.

A default instance of the task can be configure using the plugin's
DSL:

springBoot {
	buildInfo()
}

Additional properties can also be configured using the DSL:

springBoot {
	buildInfo {
		additionalProperties = [
			'foo': 'bar'
		]
	}
}

When configured via the DSL, the Java plugin's classes task is
configured to depend on the build info task. Alternatively, if more
control is required, the task can be declared and configured manually:

task buildInfo(type: org.springframework.boot.gradle.buildinfo.BuildInfo) {
	additionalProperties = [
		'foo': 'bar'
	]
}

classes {
	dependsOn buildInfo
}

See gh-2559
2016-03-24 08:59:55 +00:00
Phillip Webb 73cbb2f40a Polish 2016-03-03 09:14:24 -08:00
Stephane Nicoll 7f3ee2e405 Disable attach of repackaged artifact
This commit allows to generate the packaged artifact only locally by
adding a new `attach` property. If `attach` is set to `false` explicitly,
only the main artifact is installed/deployed.

Closes gh-5258
2016-03-01 11:12:59 +01:00
Andy Wilkinson ad7cf48497 Update Repackager to use Java 8 APIs safely
Previously, Repackager used Java 8 APIs without protecting against the
possibility of a NoSuchMethodError on earlier versions of Java.
This commit wraps the Java 8 APIs in try-catch blocks to ensure
that they do not cause a failure on Java versions before 8, while
still making full use of Java 8's capabilities when available.

Closes gh-5280
2016-02-29 15:11:28 +00:00
Andy Wilkinson 779649bfdb Merge branch '1.3.x' 2016-02-29 14:53:52 +00:00
Andy Wilkinson bb473c32e2 Enable Animal Sniffer checking of spring-boot-loader-tools
Previously, Animal Sniffer checking of spring-boot-loader-tools
was disabled as it failed with an NPE. This has been fixed in
Animal Sniffer 1.15.

This commit upgrades Animal Sniffer to 1.15 and adds the necessary
annotations to suppress failures for safe usage of sun.* and Java 7
APIs.

Note that UsesUnsafeJava has been copied from spring-boot and made
package-private. This retains the clearer intent of the custom
annotation (versus @IgnoreJRERequirement) while avoiding the change
in the build order that would be necessary for
spring-boot-loader-tools to use the annotation from spring-boot.

Closes gh-5284
2016-02-29 14:44:27 +00:00
Uwe Schaefer 9c3003071b Add CONF_FOLDER property
Closes gh-5203
2016-02-29 11:36:59 +01:00
Spring Buildmaster 225d877ab9 Next Development Version 2016-02-26 01:06:16 -08:00
Andy Wilkinson af32d6e8ee Allow LOG_FOLDER and PID_FOLDER defaults to be set at build time
This commit enhances the default launch script to allow the default
values for LOG_FOLDER and PID_FOLDER to be set at build time. They
can now be set using the logFolder and pidFolder properties
respectively.

Closes gh-4787
2016-02-25 12:25:41 +00:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00