Commit Graph

1154 Commits (d72f5139f162829a3f05c4a225549e741c5945a8)

Author SHA1 Message Date
Phillip Webb 464c15e52c Ensure empty layers are written to the index file
Update the `LayersIndex` class to ensure that layers that do not contain
content are still written.

Closes gh-20858
5 years ago
Phillip Webb df58b9baa2 Use YAML compatible classpath.idx format
Update the `classpath.idx` format to align with `layers.idx` and allow
third-parties can parse it as YAML

Closes gh-20861
5 years ago
Phillip Webb 65672a1150 Use a more compact layers.idx format
Update the `layers.idx` format so that it is more compact and can be
parsed by third-parties as YAML.

Closes gh-20860
5 years ago
Scott Frederick 35ff711dfe Document builder configuration for HTTP proxy
This commit adds examples for configuring the default builder to use
an HTTP/HTTPS proxy when building OCI images using the Maven or Gradle
plugin.

Fixes gh-19984
5 years ago
Oleg Zhurakousky 9f75f30856 Change call to createClassLoader(URL) from 'super' to 'this'
ExecutableArchiveLauncher.createClassLoader(Iterator) calls
createClassLoader(URL) method with 'super'. This means overriding
createClassLoader(URL) is not possible without also overriding
createClassLoader(Iterator). The switch to 'this' enables that.

See gh-20851
5 years ago
Scott Frederick bb568c5bff Consolidate Maven plugin documentation in plugin reference
This commit moves Maven plugin content from several sections in the
main Spring Boot reference documentation to the plugin-specific
documentation.

Fixes gh-19165
5 years ago
Scott Frederick c119dd2450 Rename plugin PDF reference doc files
This commit renames the PDF documentation files generated for the
build plugins when the distribution archive is created.

See gh-20829
5 years ago
Madhura Bhave f40444e212 Fix typo 5 years ago
Andy Wilkinson 34e602652c Polish new layered jar support 5 years ago
Stephane Nicoll 3e936dd735 Polish 5 years ago
Stephane Nicoll c88ef6215f Polish 5 years ago
Phillip Webb 12bc890e75 Update Maven and Gradle layer customization docs
Update the Maven and Gradle documentation following the refined
layer customization changes.

See gh-20526
5 years ago
Madhura Bhave d61a79d90b Support flat jar layering with layertools
Update layertools to support the flat jar format. Layers are now
determined by reading the `layers.idx` file.

Closes gh-20813
5 years ago
Andy Wilkinson bfa04e6574 Support flat jar layering with Gradle
Update the Gralde plugin so that layered jars now use the regular "flat"
format. The layers.idx file now describes which layer each file should
be placed.

See gh-20813

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
5 years ago
Madhura Bhave 4e3cdf936f Support flat jar layering with Maven
Update the Maven plugin so that layered jars now use the regular "flat"
format. The layers.idx file now describes which layer each file should
be placed.

See gh-20813

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
5 years ago
Phillip Webb 3f806aa513 Create a new layer for loader classes
Create a dedicated layer that is used to hold the launcher support
classes. The layer sits between `dependencies` and
`snapshot-dependencies` so that the layer is sensible for both
SNAPSHOT and RELEASE versions of Spring Boot

Closes gh-20529
5 years ago
Phillip Webb 7bc7d86ad4 Refine layer customization for Maven and Gradle
Simplify layer customization logic for both Maven and Gradle and
refactor some internals of the Gradle plugin.

Both Maven and Gradle now use a simpler customization format that
consists of `application`, `dependencies` and `layer order` sections.
The `application`, `dependencies` configurations support one or more
`into` blocks that are used to select content for a specific layer.

Closes gh-20526
5 years ago
Andy Wilkinson 14718f3e8a Allow layertools to work without spring-boot jar
Update `spring-boot-jarmode-layertools` so that it no longer required
a `spring-boot` jar to run.

Closes gh-20815
5 years ago
Scott Frederick cc2852ce79 Polish 5 years ago
Scott Frederick a01c8452cb Support CNB builder platform API 0.3
This commit adds support for Cloud Native Buildpacks builder platform
API 0.3, which is the latest platform API available currently. Support
for platform API 0.1 has been removed, adopting the policy of the pack
CLI to support the current platform API version and one version prior.

Fixes gh-20757
5 years ago
Scott Frederick bb9e37e119 Use platform API builder image tags
CNB builder images are now being tagged in a manner that indicates
the version of the platform API implemented. This allows Spring Boot
to default to a builder tag that guarantees API compatibility while
allowing for updates to bundled buildpacks.

Fixes gh-20171
5 years ago
Phillip Webb 4dad56a491 Restructure and polish docker code
Restructure and polish docker code to fix a package tangle and
provide better separation of concerns.
5 years ago
Phillip Webb 9795262dc1 Polish 5 years ago
Andy Wilkinson 84e16d55ea Raise the minimum supported version of Gradle 6 to 6.3
Closes gh-20532
5 years ago
Scott Frederick ac949d7851 Document remote Docker configuration
This commit adds documentation for the configuration required to
use a remote Docker daemon with the `build-image` Maven goal or the
`bootBuildImage` Gradle task.

See gh-20538
5 years ago
Scott Frederick ed6e54218d Support remote Docker daemon for building images
Prior to this commit, the build plugin goal/task for building images
required a locally running Docker daemon that was accessed via a
non-networked socket or pipe.

This commit adds support for remote Docker daemons at a location
specified by the environment variable `DOCKER_HOST`. Additional
environment variables `DOCKER_TLS_VERIFY` and `DOCKER_CERT_PATH`
are recognized for configuring a secure TLS connection to the daemon.

Fixes gh-20538
5 years ago
dreis2211 674f1e77b5 Fix typos
See gh-20704
5 years ago
Madhura Bhave ad164269e9 Update classpath index to use jar name instead of full path
See gh-20564
5 years ago
Stephane Nicoll 089c0471fa Test the Gradle Plugin against Gradle 6.3
Closes gh-20669
5 years ago
Stephane Nicoll 6aa3461611 Version layers configuration xsd
This commit provides a versioned xsd for the layers configuration of the
Maven plugin. The version starts at `2.3` to match with the Spring Boot
feature release in which this was introduced.

Closes gh-20663
5 years ago
dreis2211 f95e9543dc Fix typos in packaging docs
See gh-20630
5 years ago
Phillip Webb 0717de723f Polish 5 years ago
Phillip Webb 9a33a723fe Update copyright year of changed files 5 years ago
Phillip Webb ce1ae11c26 Merge branch '2.2.x' 5 years ago
Phillip Webb 16b5ea3414 Update copyright year of changed files 5 years ago
Madhura Bhave 7444306d0b Polish docs 5 years ago
Madhura Bhave a06f4f21e3 Combine application and resources layers into a single layer
Closes gh-20562
5 years ago
Madhura Bhave 952e529787 Rename "classes" to "application" in custom layer configuration
Closes gh-20539
5 years ago
Scott Frederick 3f378e1276 Add command-line options for Gradle bootBuildImage parameters
This commit adds support for setting the image name and builder
parameters of the Gradle bootBuildImage task using command-line
options as an alternative to DSL configuration.

See gh-20520
5 years ago
Stephane Nicoll 579a6ac254 Adapt tests for support for Java 14
See gh-20576
5 years ago
Stephane Nicoll 0b7f198b54 Publish Maven plugin API
This commit enables javadoc generator for the Spring Boot Maven plugin.

This also harmonizes the structure of the documentation, with an `/api`
and a `/reference` root directories for the javadoc and the reference
guide respectively.

Closes gh-20127
5 years ago
Scott Frederick e607c6842f Polish Gradle layer configuration DSL
This commit modifies the DSL for custom layer configuration in the
Gradle plugin to avoid duplication of terms that could be confusing.

Fixes gh-20563
5 years ago
Stephane Nicoll 0f5ca030db Polish "Add Java 14 CI"
See gh-20413
5 years ago
Stephane Nicoll 2e2f839bc8 Upgrade to Gradle 6.3 RC2
Closes gh-20558
5 years ago
Andy Wilkinson 9b817caff3 Revert "Update extract to write files to their original, unlayered location"
This reverts commit 9f3bc78f36.
5 years ago
Andy Wilkinson 9f3bc78f36 Update extract to write files to their original, unlayered location 5 years ago
Scott Frederick 44f7508825 Fix BuildImageMojo javadoc. 5 years ago
Scott Frederick 08e96427de Add command-line properties for Maven build-image options
This commit adds support for setting the image name and builder
parameters of the Maven spring-boot:build-image goal using command-line
properties as an alternative to plugin configuration in pom.xml. Per
Maven conventions, a value in pom.xml configuration will override a
command-line property when both are provided.

Fixes gh-20520
5 years ago
Madhura Bhave fb8b531bfd Polish 5 years ago
Madhura Bhave 3e8ee2a296 Add missing package-info.json
Closes gh-20516
5 years ago
Madhura Bhave 84b2e8c308 Rename classes package to application
Closes gh-20526
5 years ago
Scott Frederick 3dea2201c4 Use Gradle's configuration avoidance API
Register Boot Gradle tasks instead of creating them so they can be
loaded lazily.

Closes gh-18881
5 years ago
Scott Frederick f2dadf5a87 Add support for customizing layers in Gradle
This commit adds configuration to the Spring Boot Gradle plugin that
allows the names and contents of layers to be customized in the build
configuration.

Fixes gh-20296
5 years ago
Andy Wilkinson c4a55a5fb4 Fail fast when attempting to repackage a reproducible war
Maven's war plugin does not support reproducible builds, resulting in
the entries in the war file not being written in a consistent order
from build to build.

Closes gh-20176
5 years ago
Andy Wilkinson ca202ad59f Support Maven's outputTimestamp when repackaging jars and wars
Closes gh-20176
5 years ago
Madhura Bhave e49e62df5c Add support for customizing layers in Maven
This commit adds an additional 'layers/configuration' property that can
be used to refer to a separate layers configuration file. This separate
file defines:

* The layers and their order of precedence,
* How libraries are handled using filters that match against the
coordinates of each library, and
* How classes are handled using filters that match against the location
of the entry

An XSD to validate the XML configuration file is available.

Closes gh-20295

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
5 years ago
Johnny Lim 8526e66939 Polish
See gh-20498
5 years ago
dreis2211 53e8e49552 Fix JarFileTests for multi-release JARs on JDK14
See gh-20180
5 years ago
dreis2211 daa3855fc8 Test the Gradle Plugin against Gradle 6.2.2
See gh-20385
5 years ago
dreis2211 9588188800 Use isEmpty() where possible
See gh-20370
5 years ago
Scott Frederick 296a13a479 Fix unit test case formatting 5 years ago
Scott Frederick b00ed5b143 Remove unused imports 5 years ago
Scott Frederick ce03f501c4 Merge pull request #20297 from mikesmithson 5 years ago
Scott Frederick ada0741e10 Polish Docker client exception handling 5 years ago
Mike Smithson 6f095d6fec Improve error message from image building
Translate IOException to DockerException for a more meaningful error
message when the Docker daemon is not available.

Fixes gh-20151
5 years ago
Scott Frederick e60a7ea8d6 Fix Maven plugins tests on Windows
This commit fixes problems with file path separators and command
line argument quoting in Maven plug integration tests when run on
Windows.

Fixes gh-20244
5 years ago
Scott Frederick 509a1f1d41 Configure buildpack to use target Java version
With this commit, the Maven `spring-boot:build-image` goal and the
Gradle `bootBuildImage` task will configure the OpenJDK buildpack
to use the same JRE version as the project's target version,
provided the buildpack Java version is not explicitly set in the
build configuration.

Fixes gh-20172
5 years ago
dreis2211 442733600e Test the Gradle plugin against Gradle 6.2.1
See gh-20310
5 years ago
Stephane Nicoll c0c097117a Polish
See gh-20244
5 years ago
Scott Frederick 23e781033c Merge branch '2.2.x'
Closes gh-20244
5 years ago
Scott Frederick 625b40aa90 Prefer arguments in POM over spring-boot.run.arguments
This commit changes the order of precedence for the `arguments` property
of the AbstractRunMojo so that values specified in the POM override
values provided on the command line using `spring-boot.run.arguments`.
This brings the `arguments` property in line with all other Mojo
parameters.

Fixes gh-20024
5 years ago
Madhura Bhave c5bce2b99d Fix gradle plugin validation error 5 years ago
Madhura Bhave 15cd590f7f Allow users to opt out of including the layer tools in a layered jar
For Maven, the layer configuration is now an additional configuration
option instead of a layout type.

Closes gh-19866
5 years ago
Johnny Lim 8be8a8421d Polish
See gh-20226
5 years ago
dreis2211 d55bc5f850 Test the Gradle Plugin against Gradle 6.2
See gh-20222
5 years ago
Madhura Bhave aa09058d8c Remove implicit layers support from the layer tools
Closes gh-20187
5 years ago
dreis2211 866c441d70 Upgrade to Gradle 6.2
See gh-20213
5 years ago
dreis2211 4f824bf9ad Fix duplicate words
See gh-20210
5 years ago
dreis2211 76d2bc27eb Explicitly set java home in Maven Plugin integration tests
See gh-20193
5 years ago
Stephane Nicoll 03bee83991 Update copyright date
See gh-20192
5 years ago
zhangt2333 e2d87a89d0 Polish
See gh-20192
5 years ago
Andy Wilkinson e065ee7be2 Merge branch '2.1.x' into 2.2.x
Closes gh-20183
5 years ago
Andy Wilkinson b9c2d775a9 Merge branch '2.2.x'
Closes gh-20185
5 years ago
Andy Wilkinson d61b035640 Merge branch '2.1.x' into 2.2.x
Closes gh-20183
5 years ago
Andy Wilkinson c8907d46b4 Fix up-to-date checking of build info properties
Closes gh-20135
5 years ago
Andy Wilkinson 8577a39a96 Upgrade to Spring Asciidoctor Extensions 0.4.1.RELEASE
Closes gh-20158
5 years ago
Scott Frederick e294d26458 Set ephemeral builder container creation to a fixed date
This commit fixes the `Created` date and time of the ephemeral builder
container image at the Windows epoch plus one second
(1980-01-01T00:00:01Z). This date matches the created date of the builder
image and influences the created date of the resulting image. Using
a fixed date for images ensures that the digest is consistent for all
images with the same version.

Fixes gh-20126
5 years ago
Scott Frederick 191dce3f5e Set Spring Boot version in ephemeral builder
This commit adds a `createdBy` structure to the metadata of the ephemeral
builder container image that identifies Spring Boot as the creator of the
image, along with the Spring Boot version.

See gh-20126
5 years ago
dreis2211 cfc16c2589 Remove redundant jar task configuration
See gh-20113
5 years ago
Stephane Nicoll 3229142188 Merge branch '2.2.x'
Closes gh-20121
5 years ago
Stephane Nicoll 765b2178d1 Document spring-boot.run.arguments behaviour with multiple arguments
Closes gh-19998
5 years ago
Madhura Bhave ec42dcd173 Fix typo 5 years ago
Scott Frederick 12c640e133 Upgrade default image builder version
This commit upgrades the default CNB builder image from
cloudfoundry/cnb:0.0.43-bionic to cloudfoundry/cnb:0.0.53-bionic.
It also adds integration tests for the Maven and Gradle plugins
to verify both versions are supported.
5 years ago
Scott Frederick d07062652e Add support for CNB platform API v0.2
Cloud Native Buildpacks platform API version 0.2 introduced
two breaking changes: the order of invoking the restore and analyze
phases was reversed, and the cache phase was removed in favor of
distributing caching across other phases.

This commit adds support for Cloud Native Buildpacks builders that
implement platform API version 0.2, while maintaining compatibility
with builders that implement Lifecycle version platform API
version 0.1.

Closes gh-19829
5 years ago
Johnny Lim 6818279751 Fix typo
See gh-20049
5 years ago
dreis2211 268f696d19 Add missing deployed plugin to modules
This commit registers 'org.springframework.boot.deployed' to
spring-boot-configuration-metadata and spring-boot-properties-migrator
to make sure they are deployed as expected.

See gh-20051
5 years ago
Andy Wilkinson 5c2b28cb57 Merge branch '2.2.x'
Closes gh-20043
5 years ago
Andy Wilkinson b6a408ae77 Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
Closes gh-20041
5 years ago
Stephane Nicoll b5e23e7405 Update copyright year of changed files
See gh-20020
5 years ago
Johnny Lim b67ece48e4 Polish
See gh-20020
5 years ago
dreis2211 e4a95a8047 Upgrade to Ivy 2.5.0
See gh-20022
5 years ago
dreis2211 326092b69e Upgrade to Ant 1.10.7
See gh-20002
5 years ago
Andy Wilkinson bca98c5126 Use a RegularFileProperty to configure BootBuildImage's input jar
Closes gh-20010
5 years ago
Johnny Lim e6d5f5a271 Polish
See gh-19995
5 years ago
Phillip Webb cbacab5e26 Polish 5 years ago
Phillip Webb 1eee83a07e Update copyright year of changed files 5 years ago
Phillip Webb 234c5033d4 Polish whitespace 5 years ago
Scott Frederick 653cabe2ce Add documentation for gradle bootBuildImage task 5 years ago
Madhura Bhave bceed1305f Jar files added after build time should be added to classpath
Fixes gh-19973
5 years ago
Scott Frederick b281af0b9b Remove adding of existing layers to EphemeralBuilder
Layers were being added to the EphemeralBuilder each time one was
created, but those layers already existed in the base builder image.

Closes gh-19832
5 years ago
Andy Wilkinson 7b0d1eaffc Test the Gradle Plugin against Gradle 6.1.1
Closes gh-19912
5 years ago
Andy Wilkinson 2725264be1 Polishing formatting of DockerApi 5 years ago
Andy Wilkinson 28442b5ca5 Lower the minimum required Docker API version to 1.24
Closes gh-19945
5 years ago
Andy Wilkinson 54b3f480b4 Use posix long names when creating tar archive for image building
Fixes gh-19964
5 years ago
Scott Frederick c6a6024062 Stop image building on error from builder
Previously, the image builder used by the build tool plugins ignored
errors from lifecycle phases and continued with subsequent phases.

This commit inspects the status of the builder container after each
lifecycle phase and aborts the image building process if the exit
status of the container after any phase is non-zero.

Fixes #19949
5 years ago
dreis2211 d8e2349e47 Use Supplier variants of Assert
See gh-19864
5 years ago
Stephane Nicoll 9fbaf7611b Merge branch '2.2.x'
Closes gh-19966
5 years ago
Stephane Nicoll b420bdb3ac Merge branch '2.1.x' into 2.2.x
Closes gh-19965
5 years ago
dreis2211 db2bacc62a Fix Gradle plugin documentation links
See gh-19961
5 years ago
dreis2211 741a4f4b2b Fix links in Maven Plugin documentation
See gh-19952
5 years ago
Stephane Nicoll 5410148f79 Improve documentation of 'image' parameter of Maven Plugin
Closes gh-19950
5 years ago
Stephane Nicoll 11c5fba355 Remove unnecessary execution-specific configuration in documentation
This documentation moves the specific `build-image` execution
configuration example of the Maven plugin documentation to the general
plugin configuration. This makes sure that it works in most cases and
an execution-specific configuration is not required here anyway.

Closes gh-19946
5 years ago
Stephane Nicoll 07a1783572 Polish "Introduce appendix section with version properties"
See gh-19898
5 years ago
dreis2211 65394582f6 Introduce appendix section with version properties
With the introduction of Gradle we lost the list of version properties
that were previously in the spring-boot-dependencies POM and were also
linked inside the documentation. This commit introduces an appendix
section in the docs and links the appropriate places to the new section
to restore discoverability.

See gh-19898
5 years ago
Andy Wilkinson 63b736d1f0 Fix NPE when waiting for named socket path to become available
Fixes gh-19941
5 years ago
Stephane Nicoll 3290313eb7 Fix Docker socket creation on Windows
Closes gh-19908
5 years ago
dreis2211 d75de39456 Upgrade to JUnit Jupiter 5.6.0
See gh-19907
5 years ago
Madhura Bhave 1d62debf11 Fix typo 5 years ago
Stephane Nicoll 0bd03fa278 Fix xml syntax in example
Closes gh-19906
5 years ago
dreis2211 d84ca1149c Test the Gradle Plugin against Gradle 6.1
See gh-19776
5 years ago
Andy Wilkinson cbee16318f Fix version references in Maven Plugin's reference documentation
Closes gh-19878
5 years ago
Stephane Nicoll 331ebe90e0 Restore @since on build-image parameters 5 years ago
Stephane Nicoll 63019ab3f1 Add documentation for Maven plugin's build-image support
Closes gh-19830
5 years ago
Stephane Nicoll 6df5e7af4f Add integration tests for Maven plugin's build-image support
See gh-19830
5 years ago
Andy Wilkinson 0a9fe65443 Use line endings on all OSs when writing image config JSON
Previously \r\n was used on Windows and \n was used on other
platforms. This resulted in different JSON content being written to
the archive. As the config's entry name is the SHA-256 hash of its
content, it also resulted in the entry name being different.

This commit updates the JSON that's written into the archive to use
\n line endings, irrespective of the OS on which the image is being
built.

See gh-19828
5 years ago
Andy Wilkinson a0b4cdee44 Make line ending expectations in TotalProgressBarTests OS-independent
See gh-19828
5 years ago
Andy Wilkinson 1d396abec5 Fix bootBuildImage integration tests on Java 13
We build with Java 8, 11, and 13 without specifying target
compatibility for the bytecode of the app that's placed in the image.
The built image uses Java 11 and when the app is built with Java 13
it fails to start as the Java 11 VM can't read that Java 13 bytecode.

This commit configures the app that's placed in the image to be built
with target compatibility of 1.8. This allows it to be compiled with
all version of Java with which we build and to also be compatible
with the JVM that's in the image.

See gh-19831
5 years ago
Stephane Nicoll 105db66553 Polish 5 years ago
Stephane Nicoll e044817fe7 Migrate remaining use of ClassLoader.loadClass to Class.forName
Closes gh-19824
5 years ago
Andy Wilkinson 01a0a54f78 Include layertools in layered jars build with Gradle
Closes gh-19867
5 years ago
Andy Wilkinson 288f5ceaee Fix zip compression of libs in layered jars
Closes gh-19792
5 years ago
Andy Wilkinson 0bd0b2a6c0 Add support for building OCI images using the Gradle plugin
Closes gh-19831
5 years ago
Andy Wilkinson bc452bc094 Polish BootJarTests
See gh-19847
See gh-19792
5 years ago
Stephane Nicoll 95be419527 Use Class.forName rather than ClassLoader.loadClass
This commit changes uses of ClassLoader.loadClass to Class.forName for
consistency with what was initiated in #19342 and better compatibility
with GraalVM.

Closes gh-19824
5 years ago
Phillip Webb b5b4a02c61 Automatically add jarmode jars when packaging
Update the `Packager` to automatically add the layertools jarmode jar
when producing a layered jar.

Closes gh-19865
5 years ago
Phillip Webb 2b83edeb27 Fix jarmode support in unexploded jars
Update `LaunchedURLClassLoader` to ensure that the `JarModeLauncher`
is created in the correct classloader.

Prior to this commit the launcher was created by the application
classloader and did not have access to any of the required
`org.springframework` classes.

See gh-19848
5 years ago
Phillip Webb 57db621b70 Polish 5 years ago
Phillip Webb 77bbe089b2 Update copyright year of changed files 5 years ago
Phillip Webb 71ce212f7f Rename spring-boot-layertools
Rename `spring-boot-layertools` to `spring-boot-jarmode-layertools`.

Closes gh-19853
5 years ago
Madhura Bhave 13f7db2d8c Write classpath index file from Gradle plugin
Closes gh-19847
5 years ago
Phillip Webb e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
5 years ago
Phillip Webb 0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
5 years ago
Madhura Bhave df5b0f1163 Add support for layered jars in gradle plugin
Closes gh-19792

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
5 years ago
Phillip Webb 951d0b0fdf Fix exploded jar classloader issues
Fix a bug in `ExplodedURLClassLoader` and merge the code into the
existing `LaunchedURLClassLoader` class. Also polish a few method
names relating to layer support.

See gh-19848
See gh-19767
5 years ago
Phillip Webb e28338d6cd Rename spring-boot-cloudnativebuildpack
Rename the `spring-boot-cloudnativebuildpack` module to
`spring-boot-buildpack-platform` and update the the package
name to `org.springframework.boot.buildpack.platform`.

Closes gh-19851
5 years ago
dreis2211 23e87f8266 Treat Java 11+'s NoSuchFileException the same as FileNotFoundException
See gh-19850
5 years ago
Phillip Webb e513fe4666 Add layertools jarmode
Add a new `spring-boot-layertools` module which provides jarmode support
for working with layers. The module works with both classic fat jars,
as well as layered jars.

Closes gh-19849
5 years ago
Phillip Webb 73a42050d6 Add jarmode support to the loader code
Update the `Launcher` class to allow a packaged jar to be  launched in
a different mode. The launcher now checks for a `jarmode` property and
attempts to find a `JarMode` implementation using the standard
`spring.factories` mechanism.

Closes gh-19848
5 years ago
Phillip Webb d5a70688cb Reserve layer names for future use
Update layered jar support so that the name `ext` and any name
starting `springboot` are reserved.

See gh-19767
5 years ago
Phillip Webb 7d8f8d47c8 Fix packager code to generate layer index file
Update `Packager` to create the layer index file when repackaging.

Closes gh-19767
5 years ago
Phillip Webb bfd2ca7fd9 Polish Gradle expression references
Expand all expression `$` references to the full `${...}` form.
5 years ago
Andy Wilkinson 89237634c7 Fix classpath used for Gradle Plugin integration tests in Eclipse
See gh-19841
5 years ago
Andy Wilkinson 1e72fa202c Rework loader-tools resource generation to work with Buildship
Previously, the generated resources were added as an output to the
main source set. This worked on the command line, but resulted in
the META-INF folder that contains the loader jar not being on the
classpath of downstream projects in Eclipse.

This commit changes loader-tools to add the generated resources
as a srcDir to the main source set. This results in it appearing on
the classpath of other projects in Eclipse that depend on loader-tools
such as the Gradle plugin, thereby allowing its tests to be run in
the IDE as well as on the command line.

Fixes gh-19841
5 years ago
Andy Wilkinson 62a848f1b1 Register JNA's native library integration in LinuxSocketDomain
See gh-19836
5 years ago
Stephane Nicoll d421c63747 Disable integration test on Linux
See gh-19836
5 years ago
Stephane Nicoll ffd7670843 Attempt to make DockerApiIntegrationTests work on Linux 5 years ago
Phillip Webb cb4928ad51 Add build-image support to the maven plugin
Add a new `build-image` goal to the Maven plugin to allow Docker images
to be create via using the cloud native buildpack.

See gh-19830
5 years ago
Phillip Webb 16e6bc89ed Create a new ImagePackager tools class
Pull functionality from `Repackager` into a new `Packager` base class
and develop a variant for Docker image creation. The new `ImagePackager`
class provides a general purpose way to construct jar entries without
being tied to an actual file. This will allow us to link it to a
buildpack and provide application content directly.

Closes gh-19834
5 years ago
Phillip Webb aa1954717c Add cloud native buildpack module
Add a Java implementation of the buildpacks.io specification allowing
projects to be packaged into OCI containers. The `builder` class
provides a Java equivalent of `pack build` command and is based on
the `pack` CLI Go code published at https://github.com/buildpacks/pack.

Closes gh-19828
5 years ago
Andy Wilkinson 408f17f821 Close FileInputStreams in RepackagerTests 5 years ago
Andy Wilkinson 724597d45f Use a centrally managed version for commons-compress 5 years ago
Phillip Webb fd792cedaf Polish DisabledIfDockerUnavailable
Convert `DisabledIfDockerUnavailable` to be an annotation and make
it slightly less noisy.
5 years ago
Madhura Bhave cf01f9fba0 Add tests for configuring layered jar layout
Closes gh-19768
5 years ago
Scott Frederick 8f102aee68 Remove deprecated 2.2 code
See gh-19699
5 years ago
Andy Wilkinson 9d5975bd09 Upgrade to Gradle 6.1
Closes gh-19772
5 years ago
Phillip Webb 8fde088574 Add layered jar layout support to the maven plugin
Update the Maven plugin with a new `LAYERED_JAR` layout option.

See gh-19768
5 years ago
Madhura Bhave e9d61bac75 Support generation and loading of layered jars
Support an alternative fat jar format that is more amenable to Docker
image layers.

The new format arranges files in the following structure:

	BOOT-INF/
	  layers/
	    <layer-name #1>
	      /classes
	      /lib
	    <layer-name #2>
	      /classes
	      /lib

The `BOOT-INF/layers.idx` file provides the names of the layers and the
order in which they should be added (starting with the least changed).

The `JarLauncher` class can load layered jars in both fat and exploded
forms.

Closes gh-19767

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
5 years ago
Madhura Bhave 45b1ab46c3 Add classpath index support for exploded archives
Update the `Repackager` class so that an additional `classpath.idx` file
is written into the jar that provides the original order of the
classpath. The `JarLauncher` class now uses this file when running as
an exploded archive to ensure that the classpath order is the same as
when running from the far jar.

Closes gh-9128

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
5 years ago
Phillip Webb ad72f86bdb Polish loader and loader-tools
Polish and refactor `spring-boot-loader` and `spring-boot-loader-tools`
to make it easier to add indexing and layering support.

Closes gh-19766
5 years ago
Andy Wilkinson 56e30258fb Merge branch '2.2.x' 5 years ago
Andy Wilkinson b7e250eb04 Merge branch '2.1.x' into 2.2.x 5 years ago
Andy Wilkinson ebebe09a9d Fix file handle leak in JarFileTests
The JarFile was not being closed which linked a file handle and caused
a test failure on Windows.

The local variable has been renamed as, when declared in a
try-with-resources, Checkstyle was confused by the shadowing of the
jarFile field and required references to jarFile within the try-block
the be prefixed with this.

See gh-19595
5 years ago
Andy Wilkinson 714a187d8f Rework dep mgmt again to avoid consumers picking up strict constraints
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.

See gh-19609
5 years ago
Madhura Bhave aae1151f12 Merge branch '2.2.x'
Closes gh-19714
5 years ago
Madhura Bhave 3bf943d597 Merge branch '2.1.x' into 2.2.x
Closes gh-19713
5 years ago
Madhura Bhave f375277026 Merge pull request #19595 from nosan
* pr/19595:
  Polish "Limit ChronoField values to their range"
  Limit ChronoField values to their range

Closes gh-19595
5 years ago
Madhura Bhave 91e459a5d4 Polish "Limit ChronoField values to their range"
See gh-19595
5 years ago
Dmytro Nosan 9bc68b9877 Limit ChronoField values to their range
See gh-19595
5 years ago
Andy Wilkinson 244b5391bc Fix file handle leak in JarFileArchiveTests
Closes gh-19655
5 years ago
Andy Wilkinson aefe52e4d0 Revert "Rework dep management to avoid consumers picking up strict constraints"
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.

See gh-19609
5 years ago
Phillip Webb 862462b791 Update copyright year of changed files 5 years ago
Phillip Webb f57281340c Merge branch '2.2.x' 5 years ago
Phillip Webb 3cfbfebbb1 Merge branch '2.1.x' into 2.2.x 5 years ago
Phillip Webb 9bd49562fe Update copyright year of changed files 5 years ago
Andy Wilkinson b34a311d02 Rework dep management to avoid consumers picking up strict constraints
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.

This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.

See gh-19609
5 years ago
dreis2211 d454c9653c Disable tests on Java 13 that require an incompatible Gradle version
See gh-19680
5 years ago
Stephane Nicoll ca1710ee56 Upgrade to Apache Cassandra 4.3.1
See gh-19588
5 years ago
Andy Wilkinson e415f759a2 Raise the minimum supported version of Gradle to 5.6
Closes gh-18777
5 years ago
Andy Wilkinson c66d2e8039 Relax the Gradle plugin's Kotlin version constraint
Enforcing the spring-boot-dependencies platform makes for too strong
an opinion about the version of Kotlin that should be on the build
script's classpath. It clashes with the version of Kotlin that's
embedded in Gradle and used with Gradle's Kotlin DSL.

This commit switches to a normal platform (rather than an enforced
platform) which allows it to express an opinion about the version of
Kotlin without making it a strict requirement.

Closes gh-19609
5 years ago
Andy Wilkinson 7fda317f0d Merge branch '2.1.x' into 2.2.x
Closes gh-19657
5 years ago