This commit makes sure to create a HazelcastClient if an instance name
is provided in configuration and if no such client already exists. This
harmonizes the behaviour with of the server counter-part.
See gh-20109
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.
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
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
This partially re-applies the deprecation removal from commit
df1837a16b,
without removing CompositeHealthIndicator, HealthAggregator, and related
configuration that is required by Spring Cloud.
This commit changes the classpath check condition to verify that the
core module of the MongoDB driver is present. Previously, we were only
checking for the presence of the sync driver, making embedded support
unavailable with the reactive variant.
Closes gh-19960
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
Previously, only the top-level handlers were examined to find the
ContextHandlers and log the context path. If those handlers had
been wrapped, this prevented the ContextHandlers from being found
and an empty string was always logged.
When finding the context path, this commit unwraps the handler held
by a HandlerWrapper until the ContextHandler is found.
Fixes gh-19969
For consistency with SpringApplication, this commit disables bean
overriding by default in ApplicationContextRunner. Bean overriding can
be enabled again using withAllowBeanDefinitionOverriding.
Closes gh-18019
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
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
This commit hard codes the default value so that the annotation
processor picks it up. The default value is tested for consistency so
this is acceptable as providing the default value in the metadata
requires to hard code it anyway.
refresh can only ever be called with a ConfigurableApplicationContext
and we want to evolve the refresh API to reflect that. This commit
takes the first step by overloading refresh(ApplicationContext) with
a new refresh(ConfigurationApplicationContext) method and deprecating
refresh(ApplicationContext). Where the call to refresh is made, the
argument is cast to ApplicationContext to ensure that
refresh(ApplicationContext) is called. This ensures that any existing
override of the method is still effective.
Closes gh-18519
The Cassandra v4 driver does not longer have automatic local DC inference
from contact points. As a result, the "local-datacenter" property must be
set with the default load balancing policy and the contact points must
be of that data center.
This commit adds a new property for the local datacenter so that it can
be specified without the use of a customizer.
Closes gh-19779
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
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
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
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
This class was mistakenly marked as deprecated in 2.2.0 instead of deprecated
in 2.3.0. This resulted in the class being deleted as part of the 2.3.0
cleanup.
Putting it back in place now with the correct deprecation noted.
Closes gh-19861
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`.
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.
The Spring Cloud Connectors project has been deprecated in favor of the
Java CFEnv project. The Boot auto-configuration and starter that support
Connectors were deprecated in Boot 2.2.
This commit removes the Connectors auto-configuration, starter,
and dependency management.
Closes gh-19798
This change ensures that each test in a test suite that shares an
application context gets a unique embedded database, to prevent
inconsistent embedded database state between tests.
Closes gh-16747
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
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
Change the default `BootstrapMode` for auto-configured `JpaRepositories`
to `BootstrapMode.DEFERRED` to allow the initialization of
`EntityManagerFactory` to be parallelized for increased startup efficiency.
Prior to this change, the default BootstrapMode for all auto-configured
Spring Data repositories was `BootstrapMode.DEFAULT`.
Closes gh-16230
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
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
This commit removes references of cache infra following the move to
Micrometer. We no longer ships an infinispan specific binder so the
dependency has been removed as well.
Closes gh-19838
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
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
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
This commit deprecates the only public accessor to
`CacheOperationInvoker` so that we can make the entire class package
private in the next feature release.
Closes gh-19089
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>
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>
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