Previously, the properties that applied to the BuildInfo task itself
and those that would be written into the build-info.properties file
were all configured on BuildInfo directly. This lack of separation
could be confusing.
This commit rework BuildInfo to separate the task's own properties
from those that are written into the build-info.properties file.
The task has also been updated so that changes to a project's
properties made after the task has been configured are reflected in
the build info properties.
bootRun's main and jvmArgs properties use mainClassName and
applicationDefaultJvmArgs respectively by convention.
bootJar and bootWar's mainClass property uses mainClassName by
convention.
The current implementation is undocumented so it's not clear exactly
what it's intended to do. It also appears to overreach as, for
example, it affects every JavaExec task in a project.
We may need to reinstate something that's somewhat equivalent, but I'd
like to do that armed with more information about the intent of the
functionality and some specific problems that need to be solved.
Previously, the Spring Boot plugin would automatically apply the
dependency management plugin and import the spring-boot-dependencies
bom. This made it very difficult to use Spring Boot's plugin without
also using its dependency management. It also made it difficult to
see where the dependency management was coming from.
This commit updates the Spring Boot plugin so that it no longer
automatically applies the dependency management plugin. Instead, the
plugin now reacts to the dependency management plugin being applied
by importing the spring-boot-dependencies bom. Users that do not
wish to use Spring Boot's dependency management capabilities can now
do so by not applying the dependency management plugin.
Closes gh-3164
Previously, the BootRepackage task would take the output of a Jar
or War task and repackage it in a similar manner to Spring Boot's
Maven plugin. This caused several problems in Gradle including
broken up-to-date checks and a lack of configurability. See the issues
referenced below for full details.
This commit replaces BootRepackage with BootJar and BootWar
for building executable jars and wars respectively. BootJar extends
Gradle's standard Jar task and BootWar extends Gradle's standard War
task. This means that terms of configuration, the creation of
executable jars and wars is now as flexible as the creation of
standards jars and wars.
Closes gh-8167
Closes gh-8099
Closes gh-6846
Closes gh-5861
Closes gh-5393
Closes gh-5259
Closes gh-3931
Previously, jars (either top-level or nested) in Zip64 format were
treated as normal jar files. This would lead to a failure later on
when an attempt was made to read an entry from the file.
This commit updates the loader to fail fast when it encounters a
Zip64 jar file. Such files are identified by the number of entries
in the central directory end record being 0xFFFF.
Closes gh-8735
Previously, only IOExceptions were caught and wrapped in a new
IOException that included the name of the nested entry that was
being read.
Following this commit, any Exception is caught and wrapped so that the
problematic entry can be identified in more failure scenarios.
Closes gh-8711
Previously, each entry in loader.path could only refer to a standard
jar file. Refering to such a jar would add all of the classes in
the root of the jar to the class path.
This commit adds support for referencing a directory within a jar file
that contains one or more nested jars. For example:
$ java -jar -Dloader.path='jar:file:./lib.jar/!BOOT-INF/lib' my.jar
This will add all of the classes in all of that jars in the
BOOT-INF/lib directory of lib.jar to the class path.
See gh-8334
The main changes are:
- Switch to `loader.properties` instead of `application.properties`
- Search for `loader.properties` in `loader.home` as well as in
the classpath
- Placeholder replacements in MANIFEST.MF (using `loader.properties`
or system/env vars)
See gh-7221
Closes gh-8346