Commit Graph

237 Commits (ae4dd0d17e33ed7ceab360b08f3b726c72bc538b)

Author SHA1 Message Date
Stephane Nicoll ae4dd0d17e Merge branch '1.4.x' into 1.5.x 8 years ago
Stephane Nicoll a638dcd51b Remove unnecessary use of System.out.println 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
Phillip Webb d818a09ed8 Polish 8 years ago
Stephane Nicoll 28ed59ca6e Polish contribution
Closes gh-6645
8 years ago
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
8 years ago
Andy Wilkinson 8971c8ba54 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson e1d53b65ba Remove redundant git-commit-id-plugin configuration from loader-tools
Closes gh-7007
8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
Andy Wilkinson 5afd610855 Merge branch '1.3.x 8 years ago
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
8 years ago
Phillip Webb 825dd0a26c Merge branch '1.3.x' 8 years ago
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
8 years ago
Andy Wilkinson 742657983b Improve the error message when additional build-info prop has null value
Closes gh-6724
8 years ago
Andy Wilkinson b47da0d265 Fix spellcheck warning introduced in 6bbd50e0
Closes gh-6628
8 years ago
Andy Wilkinson 8c106af384 Allow default value for CONF_FOLDER to be set at build time
Closes gh-6549
8 years ago
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
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Dave Syer 9e8beb7323 Merge remote-tracking branch 'origin/1.3.x' 9 years ago
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
9 years ago
Andy Wilkinson 183613a5ca Merge branch '1.3.x' 9 years ago
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
9 years ago
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
9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
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
9 years ago
Phillip Webb 5bc274ca09 Polish 9 years ago
Andy Wilkinson 1d4e52cc2b Merge branch '1.3.x' 9 years ago
Christian Brunotte 677080b8e2 Update launch.script so popd does not print directory name to stdout
Closes gh-5394
9 years ago
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
9 years ago
Phillip Webb 73cbb2f40a Polish 9 years ago
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
9 years ago
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
9 years ago
Andy Wilkinson 779649bfdb Merge branch '1.3.x' 9 years ago
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
9 years ago
Uwe Schaefer 9c3003071b Add CONF_FOLDER property
Closes gh-5203
9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
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
9 years ago
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 9 years ago
Phillip Webb 4b55144d80 Polish 9 years ago
Andy Wilkinson 5ed4ef1272 Add manifest entries for location of lib and classes in executable archives
Closes gh-5183
9 years ago
Andy Wilkinson 87fe0b2ade Use a conventional delegation model in LaunchedURLClassLoader
When an application is run as an executable archive with nested jars,
the application's own classes need to be able to load classes from
within the nested jars. This means that the application's classes need
to be loaded by the same class loader as is used for the nested jars.
When an application is launched with java -jar the contents of the
jar are on the class path of the app class loader, which is the
parent of the LaunchedURLClassLoader that is used to load classes
from within the nested jars. If the root of the jar includes the
application's classes, they would be loaded by the app class loader
and, therefore, would not be able to load classes from within the
nested jars.

Previously, this problem was resolved by LaunchedURLClassLoader being
created with a copy of all of the app class laoder's URLs and by
using an unconventional delegation model that caused it to skip its
parent (the app class loader) and jump straight to its root class
loader. This ensured that the LaunchedURLClassLoader would load both
the application's own classes and those from within any nested jars.
Unfortunately, this unusual delegation model has proved to be
problematic. We have seen and worked around some problems with Java
Agents (see gh-4911 and gh-863), but there are others (see gh-4868)
that cannot be made to work with the current delegation model.

This commit reworks LaunchedURLClassLoader to use a conventional
delegate model with the app class loader as its parent. With this
change in place, the application's own classes need to be hidden
from the app class loader via some other means. This is now achieved
by packaging application classes in BOOT-INF/classes (and, for
symmetry, nested jars are now packaged in BOOT-INF/lib). Both the
JarLauncher and the PropertiesLauncher (which supports the executable
jar layout) have been updated to look for classes and nested jars in
these new locations.

Closes gh-4897
Fixes gh-4868
9 years ago
Phillip Webb 00cfe1d054 Use AssertJ in spring-boot-tools
See gh-5083
9 years ago
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 9 years ago