Commit Graph

1460 Commits (644c03124a3a056e28df67764e6fd62e6b6cc165)

Author SHA1 Message Date
Phillip Webb f260c77fe3 Add @ImportConfigurationPropertiesBean support
Add repeatable `@ImportConfigurationPropertiesBean` annotation that can
be used to import types and treat them as `@ConfigurationProperties`
beans. This annotation is specifically designed to support third-party
classes that can't contain any Spring annotations.

Closes gh-23172
4 years ago
Andy Wilkinson b1a843279a Merge branch '2.3.x'
Closes gh-23224
4 years ago
Andy Wilkinson 3e0096e9b1 Use classpath normalizer on antlib's integration test classpath input
Closes gh-23223
4 years ago
Stephane Nicoll defa7c47cd Merge branch '2.3.x'
Closes gh-23201
4 years ago
Stephane Nicoll 648789ef84 Document that buildpacks use non-root users
Closes gh-21122
4 years ago
EruDev ffc577b499 Simplify code
See gh-23111
4 years ago
Stephane Nicoll cc5f2537b1 Merge branch '2.3.x'
Closes gh-23148
4 years ago
Stephane Nicoll ee914624e6 Document buildpacks are configured with target Java version
Closes gh-21796
4 years ago
Stephane Nicoll e0b41f8192 Merge branch '2.3.x'
Closes gh-23143
4 years ago
Stephane Nicoll b80314b44b Document how to customize the jmxPort for Maven integration tests
Closes gh-22401
4 years ago
Scott Frederick b70d0dd5ac Merge branch '2.3.x'
Closes gh-23134
4 years ago
Scott Frederick bc1834bfdf Ensure layer digest hashes contain 64 characters
This commit ensures that encoded digest hashes for Docker image
layers are zero-padded to the required 64 characters length.

Fixes gh-23132
4 years ago
Scott Frederick ccabc1a4c9 Merge branch '2.3.x'
Closes gh-23133
4 years ago
Scott Frederick 4f1b4c98ae Fail on Docker image load with empty response
In some cases, a call to the Docker image load API will fail but
return a 200 OK response status code and an empty response. This
commit detects that the response from this call is empty and
treats this condition as an error instead of a silent failure.

Fixes gh-23130
4 years ago
Andy Wilkinson 9dc5b88949 Polish "Mark bootArchives configuration as unresolvable"
See gh-22943
4 years ago
Martin Chalupa 796307a78c Mark bootArchives configuration as unresolvable
See gh-22943
4 years ago
Johnny Lim e48af31ced Polish
See gh-23081
4 years ago
Andy Wilkinson 56ded38f5d Generate default values from Duration and Period .ZERO
Closes gh-23082
4 years ago
Andy Wilkinson b57b2f0b44 Test the Gradle Plugin against 6.5 and 6.6
Closes gh-23075
4 years ago
dreis2211 33cd875cb8 Simplify InputStream assertions
See gh-23052
4 years ago
Scott Frederick ee41d71ea8 Merge branch '2.3.x'
Closes gh-23016
4 years ago
Scott Frederick 56bc0eb9e0 Use canonical path for CNB builder lifecycle binaries
This commit changes the path used to invoke lifecycle binaries in
CNB builders from `/lifecycle` to `/cnb/lifecycle` to conform to
the CNB spec. This will ensure the build plugin image-building
goals and tasks are compatible with future versions of builders
that may not support both paths.

See gh-23009
4 years ago
Phillip Webb c302b72083 Merge branch '2.3.x'
Closes gh-23015
4 years ago
Phillip Webb 8fd9c685a2 Reduce HTTP debug logging when building image
Update `BuildImageMojo` so that commons HTTP wire logging is configured
to ERROR. Without this update, running `mvn -X` will produce a great
deal of logging since by default HTTP Client logs all bytes transfered
at DEBUG and Maven will enable DEBUG for all logs.

Closes gh-22674
4 years ago
Phillip Webb ea8bd75ba1 Merge branch '2.3.x' 4 years ago
Phillip Webb 73038267a0 Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 17e2d72bcb Fix Windows path issue in JarFileWrapperTests
See gh-22991
4 years ago
Phillip Webb bb57c7eacf Merge branch '2.3.x' 4 years ago
Phillip Webb 8722c2c5de Close writer after use in ExtractCommandTests
Update `ExtractCommandTests` so that the writer is closed after the
contents have been written.

See gh-22993
4 years ago
Phillip Webb bd5266b9b1 Merge branch '2.3.x' 4 years ago
Phillip Webb 0dd38a7264 Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 3fe2005e06 Use @AfterEach to close the source jar file
Update `JarFileWrapperTests` so that the jar files are closed after each
test.

See gh-22991
4 years ago
Phillip Webb 899e8e189b Merge branch '2.3.x'
Closes gh-23001
4 years ago
Phillip Webb f7452b9383 Ensure LayoutFactory is not passed an empty file
Update `Repackager` to ensure that `getLayout` is called before we
backup the source file. This restores earlier behavior that some
custom `ModuleFactory` implementations were relying on.

Closes gh-22995
4 years ago
Phillip Webb cfc053d75e Merge branch '2.3.x' 4 years ago
Phillip Webb c5b12effbf Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 2a137a2d8a Remove Mockito from JarFileWrapperTests
Remove Mockto from JarFileWrapperTests since it seems to be failing on
later versions of Java.

See gh-22991
4 years ago
Phillip Webb aa2580bb51 Merge branch '2.3.x' 4 years ago
Phillip Webb ba2ab3363b Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 60b5de192c Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb 4e76138ebc Update copyright year of changed files 4 years ago
Phillip Webb 5997cbd21f Refine AbstractJarFile method visibility
Refine method visibility in an attempt to fix test issues on Java 11+.

See gh-22991
4 years ago
Scott Frederick 341615d7d0 Merge branch '2.3.x'
Closes gh-23000
4 years ago
Scott Frederick 3f80638a36 Fail on layertools extract with launch script
This commit adds a check to the `layertools extract` command to
ensure that the jar file being processed is readable and has a
valid directory.

Fixes gh-22993
4 years ago
Phillip Webb b60820564e Merge branch '2.3.x'
Closes gh-22999
4 years ago
Phillip Webb 2b1b096fac Merge branch '2.2.x' into 2.3.x
Closes gh-22998
4 years ago
Phillip Webb aac367e9c5 Attempt to fix memory leak in JarFile class
Create a new `JarFileWrapper` class so that we can wrap and existing
`JarFile` and offer a version that can be safely closed.

Prior to this commit, we provided wrapper functionality in the `JarFile`
class itself. Unfortunately, because we override `close` and also create
a lot of wrappers this caused memory issues when running on Java 11.

With Java 11 `java.util.zip.ZipFile` class uses `FinalizableResource`
for any implementation that overrides `close()`. This means that any
wrapper classes will not be garbage collected until the JVM finalizer
thread runs.

Closes gh-22991
4 years ago
Stephane Nicoll f8265e3e44 Merge branch '2.3.x'
Closes gh-22980
4 years ago
Jean-Baptiste Nizet 27528fdd07 Fix custom image name example and documentation
There is no `artifactId` property in a gradle Project, and the default
value uses the project name.

See gh-22918
4 years ago
Stephane Nicoll b1e631e8a6 Remove trailing whitespaces 4 years ago
Scott Frederick 7c7079f91a Merge branch '2.3.x' 4 years ago
Scott Frederick 4c6a722f18 Fix test for Java version in image building docs
See gh-22916
4 years ago
Scott Frederick 092bbd198e Merge branch '2.3.x'
Closes gh-22923
4 years ago
Scott Frederick 005ed8b8db Use Java version wildcard in image building docs
Fixes gh-22916
4 years ago
Scott Frederick 6b15822cb1 Polish "Add pullPolicy option for image building"
See gh-22736
4 years ago
anshlykov c7449b57ce Add pullPolicy option for image building
This commit adds a pullPolicy option to the configuration of the Maven
plugin spring-boot:build-image goal and the Gradle plugin bootBuildImage
task. The new option gives users control over pulling the builder image
and run image from a remote image registry to the local Docker daemon.

See gh-22736
4 years ago
dreis2211 c00d5c5643 Introduce @ForkedClassPath for testing unmodified class path
See gh-22710
4 years ago
Andy Wilkinson fff9193860 Merge branch '2.3.x'
Closes gh-22917
4 years ago
Andy Wilkinson f43a0b4891 Fix configuration of environment in Kotlin bootBuildImage examples
Fixes gh-22913
4 years ago
Andy Wilkinson 9a2d2effa5 Merge branch '2.3.x'
Closes gh-22907
4 years ago
Andy Wilkinson 1381929525 Upgrade to Gradle 6.6
Closes gh-22905
4 years ago
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
4 years ago
Andy Wilkinson e240c180f3 Merge branch '2.3.x'
Closes gh-22831
4 years ago
Andy Wilkinson 181e3b34ba Isolate Maven Plugin's integration tests from repo.spring.io
Previously, the Maven plugin integration tests used a settings.xml file
that defined https://repo.spring.io/snapshot as a repository. This
allowed them to resolve snapshots of the plugin's Spring Framework
dependencies but it had the unfortunate side-effect of also allowing
them to resolve snapshots of other Spring Boot modules from Artifactory
rather than using those currently being built.

This commit replaces the repositories in settings.xml with a Gradle
task that resolves the necessary dependencies and populates a local
repository with the dependencies' jars and pom files. This is achieved
using a ComponentMetadataRule that creates a custom variant of each
dependency that includes its pom file, inspired by the example in
gradle/gradle/#11449. A configuration that extends the
runtimeClasspath configuration and select the custom variant via its
attribute is then used to resolve the jars and pom files of the runtime
classpath such that they can then be used to populate the local
repository.

Closes gh-22828
4 years ago
Andy Wilkinson 915c3ec712 Merge branch '2.3.x'
Closes gh-22781
4 years ago
Andy Wilkinson 95b504ccad Make processResources out-of-date on version change
Closes gh-22780
4 years ago
Phillip Webb 8d06b0f368 Merge branch '2.3.x' 4 years ago
Phillip Webb 4924573074 Merge branch '2.2.x' into 2.3.x 4 years ago
Phillip Webb fdd6a89a61 Polish 4 years ago
Stephane Nicoll dac63fc3e5 Polish 4 years ago
Andy Wilkinson 8b3f8a6138 Merge branch '2.3.x'
Closes gh-22768
4 years ago
Andy Wilkinson 11d1002f15 Merge branch '2.2.x' into 2.3.x
Closes gh-22767
4 years ago
Andy Wilkinson 07699ea6ff Retry when dependency resolution fails in ModifiedClassPathClassLoader
Closes gh-22763
4 years ago
Andy Wilkinson 079b5d3f50 Polish Gradle plugin after layering being enabled by default
Closes gh-20983
4 years ago
Scott Frederick f247fec310 Merge branch '2.3.x'
Closes gh-22735
4 years ago
Scott Frederick 21b2dd2740 Allow empty env entries when building an image
Prior to this commit, an entry in the environment map provided to the
build plugin image building goal or task that had a null value would
result in a failure with a message that was difficult to diagnose.

This commit treats env map entries with a null value as an empty
entry to prevent the failure and also make it easier to provide an
explicit empty entry in the Maven XML.

Fixes gh-22703
4 years ago
Madhura Bhave 41f5ba9077 Switch layering on by default
Closes gh-20983
4 years ago
dreis2211 e49e2dfff1 Use Supplier variants of Assert methods
See gh-22699
4 years ago
Andy Wilkinson 989fc36528 Polish 4 years ago
Andy Wilkinson 11a296b068 Polish "Fix NPE in BeanDefinitionLoader when XML support is disabled"
See gh-22696
4 years ago
Andy Wilkinson d2926e0222 Merge branch '2.3.x'
Closes gh-22678
4 years ago
Andy Wilkinson 00cd8945d5 Document how to use Gradle's native bom support
Closes gh-21570
4 years ago
Gerrit Meier 15cd343737 Upgrade to Spring Data Neo4j 6
See gh-22299
4 years ago
Andy Wilkinson 1a43cd1c8e Merge branch '2.1.x' into 2.2.x
Closes gh-22551
4 years ago
Nelson Osacky 0494007893 Disable extra scans for full profile.
The extra scans were not disabled for the full profile, only the
regular profile.

See gh-22550
4 years ago
Andy Wilkinson f4508b4059 Merge branch '2.1.x' into 2.2.x
Closes gh-22547
4 years ago
Nelson Osacky e41a53cf85 Add Gradle Enterprise Extension
This adds build caching and build scans.

The changes required disabling scans when using the maven invoker
plugin in order to not cause duplicate build scans when invoking other
maven builds. There is also an empty `.mvn` folder in the
spring-boot-starters project to prevent duplicate build scans as well
since there is no way to pass properties to the maven-javadoc-plugin.

The checkstyle plugin was causing a cache miss with the
`propertyExpansion` because it contains an absolute path. The absolute
path is now ignored and instead the files are added as inputs to the
checkstyle plugin. This only enables the local build cache. The remote
cache is not yet enabled.

On my local machine:

./mvnw clean install build times go from about 30 minutes to about 10 minutes.
./mvnw clean install -Pfull build times go from about 60 minutes to about 13 minutes.

See gh-22089
4 years ago
Phillip Webb 33b48c8bac Add @Name support to the annotation processor
Update the `ConfigurationMetadataAnnotationProcessor` so that `@Name`
annotated parameters generate the correct meta-data.

Closes gh-22492
4 years ago
Phillip Webb da69286838 Merge branch '2.3.x' 4 years ago
Phillip Webb d2a7808098 Polish 4 years ago
Andy Wilkinson 19ad163486 Merge branch '2.3.x'
Closes gh-22411
4 years ago
Andy Wilkinson accc1f1ca8 Merge branch '2.2.x' into 2.3.x
Closes gh-22410
4 years ago
Andy Wilkinson 21f733b89b Merge branch '2.1.x' into 2.2.x
Closes gh-22409
4 years ago
Andy Wilkinson 179d2c79d6 Avoid trivialising what the reader's learning about
Closes gh-22408
4 years ago
Scott Frederick e6318f83b2 Merge branch '2.3.x'
Closes gh-22349
4 years ago
Scott Frederick bc88af8e53 Restore accidentally deleted line 4 years ago
Scott Frederick 210282260e Fail on bootBuildImage with launch script
This commit adds a check to the support code for the Gradle plugin
bootBuildImage task to ensure that the jar file that will be passed
to a builder is readable and has a valid directory. This prevents a
situation where the jar file cannot be read because it is prepended
with a launch script, and the builder does not receive any files to
process.

Notes have also been added to the Gradle plugin documentation to warn
against using a bootJar launchScript configuration and bootBuildImage
together, as well as caveats about launchScript that match the Maven
plugin documentation.

Fixes gh-22223
4 years ago
Andy Wilkinson 972aab18f9 Merge branch '2.3.x'
Closes gh-22328
4 years ago
dreis2211 021d9b59cb Cleanup temporary files after Maven plugin execution
See gh-22112
4 years ago
Andy Wilkinson 3d2f67f0be Merge branch '2.3.x'
Closes gh-22304
4 years ago
Andy Wilkinson f18b657ff9 Fix handling of DOCKER_HOST that begins with unix://
Fixes gh-22300
4 years ago
Andy Wilkinson 2d91a096db Merge branch '2.3.x'
Closes gh-22293
4 years ago
Andy Wilkinson 794ded5286 Test the Gradle plugin against Gradle 6.5.1
Closes gh-22292
4 years ago
dreis2211 507eb9498b Use Class.getDeclaredConstructor().newInstance()
See gh-21913
4 years ago
Andy Wilkinson 2a9193f6d9 Merge branch '2.3.x'
Closes gh-22244
4 years ago
Andy Wilkinson 96e6b74894 Merge branch '2.2.x' into 2.3.x
Closes gh-22243
4 years ago
Andy Wilkinson a0f1424393 Polish "Fix unwrapping of captured PrintStream in test support's OutputCapture"
See gh-22214
4 years ago
XenoAmess 75a64bd901 Fix unwrapping of captured PrintStream in test support's OutputCapture
See gh-22214
4 years ago
Andy Wilkinson ecbc8ea2df Merge branch '2.3.x'
Closes gh-22202
4 years ago
Andy Wilkinson 79770b9615 Use source sets to determine configurations deprecated for resolution
Fixes gh-22200
4 years ago
Andy Wilkinson 160d8e49e3 Merge branch '2.3.x'
Closes gh-22180
4 years ago
Andy Wilkinson 9317135690 Improve error handling when builder image isn't a builder
Fixes gh-22179
4 years ago
Andy Wilkinson 62aa8ce107 Support incremental annotation processing with Gradle
Closes gh-22150
4 years ago
Scott Frederick a73af52496 Merge branch '2.3.x'
Closes gh-22121
4 years ago
Scott Frederick 9a083584b8 Improve validation of layertools input
This commit improves the validation performed on the user
input provided to the layertools jarmode to provide more
clear error messages when the input is not correct and
reduce the chance of ambiguity.

Fixes gh-22042
4 years ago
Andy Wilkinson 5e7917e33a Upgrade to Maven Shade Plugin 3.2.4
Closes gh-22074
4 years ago
Phillip Webb 301ec12a0c Merge branch '2.3.x' 4 years ago
Phillip Webb f296f57401 Rename ImageReferenceParser to Regex
Rename `ImageReferenceParser` to `Regex` and remove state. The regular
expressions are now used directly by the `ImageName` and
`ImageReference` classes with the values accessed directly from the
`Matcher`.

See gh-21495
4 years ago
Phillip Webb 82ed255bb1 Merge branch '2.3.x'
Closes gh-22060
4 years ago
Phillip Webb 9843888714 Merge branch '2.2.x' into 2.3.x
Closes gh-22059
4 years ago
Phillip Webb 3b3a49db1f Polish 'Fix infinite loop in FieldValues'
See gh-22040
4 years ago
Konrado85 39a853c57b Fix infinite loop in FieldValues
Update `FieldValues` test object so that it doesn't cause an infinite
loop if it is actually created.

See gh-22040
4 years ago
Scott Frederick 39b2d01541 Merge branch '2.3.x'
Closes gh-22037
4 years ago
dreis2211 a6e8561391 Catch more generic FileSystemException in NamedPipeSocket
See gh-22035
4 years ago
Scott Frederick 73b737c7d8 Merge branch '2.3.x'
Closes gh-22017
4 years ago
Scott Frederick 28643e4d2d Validate image references before passing to CNB builder
Prior to this commit, an image name or run image name derived from
the project name or provided by the user would be passed to the CNB
builder without validation by the Maven plugin build-image goal or
Gradle plugin bootBuildImage task. This could lead to error messages
from the plugins that are difficult to understand and diagnose.

This commit makes parsing of the image names more strict, based on
the grammar implemented by the Docker go library. This provides
validation of the image names before passing them to the builder,
with a more descriptive error message when parsing and validation
fails.

Fixes gh-21495
4 years ago
Andy Wilkinson 9e08490522 Merge branch 'gh-21271'
Closes gh-21271
4 years ago
Andy Wilkinson 056d5f3120 Enable deprecation compilation warnings
See gh-21271
4 years ago
Andy Wilkinson c64649a6d9 Enable unchecked compilation warnings
See gh-21271
4 years ago
Andy Wilkinson 47874d8c6a Treat warnings as errors when compiling
See gh-21271
4 years ago
Andy Wilkinson 07fb4b065d Merge branch '2.3.x'
Closes gh-21940
4 years ago
Andy Wilkinson 0de466e06e Require dependency on s-b-dependencies to use its constraints
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.

This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.

Fixes gh-21911
4 years ago
Scott Frederick 838cfc529f Merge branch '2.3.x'
Closes gh-21933
4 years ago
Scott Frederick 6119d69679 Add runImage option for image building
This commit adds a runImage property to the Maven plugin build-image
goal and the Gradle bootBuildImage task. The property allows the user
to override the run image reference provided in the builder metadata
with an alternate run image. The runImage property can be specified
in the build file or on the command line.

Fixes gh-21534
4 years ago
dreis2211 3d27391d47 Allow StringSequence.isEmpty() to be compatible with JDK 15
JDK 15 introduces isEmpty() on CharSequence which clashes with the one
declared in StringSequence because it is not public.

See gh-21713
4 years ago
Phillip Webb 82abcd3043 Merge branch '2.3.x' 5 years ago
Phillip Webb 2a37b2e258 Refine PropertiesLauncher close logic
Further attempt to fix Windows file issues.

See gh-21575
5 years ago
Phillip Webb 3892f4402a Merge branch '2.3.x'
Closes gh-21895
5 years ago
Phillip Webb 1e7da4d3ca Allow digest builder references
Update `BuildRequest` to also allow digest based references.

Closes gh-21879
5 years ago
Phillip Webb 866ebf7c13 Merge branch '2.3.x' 5 years ago
Phillip Webb 8a249daf1a Refactor PropertiesLauncher so jars can be closed
Refactor the internals of `PropertiesLauncher` so that opened jar files
are tracked and can be closed after a test completes.

See gh-21575
5 years ago
Scott Frederick 9d9a501b17 Merge branch '2.3.x'
Closes gh-21892
5 years ago
Scott Frederick 7a2939f129 Use non-blocking I/O for Docker API
This commit changes the NamedPipeSocket used for communication with
a local Docker daemon to use a non-blocking AsynchronousByteChannel
instead of a blocking RandomAccessFile, modeled after a similar
change to the docker-java project. This eliminates the potential for
a blocking call to hang indefinitely.

Fixes gh-21672
5 years ago
Madhura Bhave 4161f0b983 Merge branch '2.3.x'
Closes gh-21799
5 years ago
Madhura Bhave d30c0e8aec Merge branch '2.2.x' into 2.3.x
Closes gh-21798
5 years ago
Madhura Bhave 36faa1d42a Document using system properties in gradle plugin docs
Closes gh-21317
5 years ago
Phillip Webb ad6a0d473a Merge branch '2.3.x'
Closes gh-21768
5 years ago
Phillip Webb b71bab2817 Document deprecations of Archive.iterator()
Closes gh-21695
5 years ago
Andy Wilkinson 020a47ba3e Document support for Gradle 5
Closes gh-15358
5 years ago
Phillip Webb 5f79bd2a09 Merge branch '2.3.x'
Closes gh-21734
5 years ago
dreis2211 2b5569f054 Polish
See gh-21732
5 years ago
Phillip Webb d791d18231 Merge branch '2.3.x'
Closes gh-21727
5 years ago
Phillip Webb 2f973ebc33 Fix default Launcher.isExploded() result
Fix the default implementation of `Launcher.isExploded` which should
have returned `true`.

Fixes gh-21575
5 years ago
Phillip Webb 0a05b4c9fd Update copyright year of changed files 5 years ago
Phillip Webb 3107d2de51 Merge branch '2.3.x'
Fixes gh-21705 in master
5 years ago
Phillip Webb 9a235197dc Propagate manifest to exploded jars
Update `LaunchedURLClassLoader` so that packages defined from exploded
archive folders have manifest attributes applied to them. Prior to this
calling `package.getImplementationTitle()` would only return the a
manifiest attribute when running non-exploded.

The root cause of this issue is the way that `URLClassLoader` handles
the different URL types. For URLs that reference a jar the manifest is
available. For URLs that reference a folder it isn't. When running
exploded we use a URL that references to the `BOOT-INF/classes` folder
directly. To fix the issue we now attempt to detect when `definePackage`
is being called directly, and replace `null` entries with actual
manifest values.

Fixes gh-21705
5 years ago
dreis2211 54f93e9b0f Fix multi-release JAR test on JDK 15
See gh-21605
5 years ago
Andy Wilkinson c4faeac4d7 Merge branch '2.3.x'
Closes gh-21703
5 years ago
Andy Wilkinson 24138c104c Use highlightjs for syntax highlighting in Asciidoctor's HTML output
Closes gh-21701
5 years ago
Scott Frederick 87f5894a9a Merge branch '2.3.x'
Closes gh-21685
5 years ago
Scott Frederick 29253264b4 Improve Docker API 5xx error messages
This commit improves the error messages returned by the Spring Boot
build plugins when a 5xx status code is returned from the Docker
API while attempting to build an image. If the error response has
contents containing a JSON structure with a "message" key, the value
associated with that key will be included in the exception message
and in the build plugin output error.

Fixes gh-21515
5 years ago
Madhura Bhave e0f548fdd3 Merge branch '2.3.x'
Closes gh-21657
5 years ago
Madhura Bhave 2dc8048d08 Add missing since tags
Closes gh-21576
5 years ago
Andy Wilkinson 399d0f7b95 Merge branch '2.3.x'
Closes gh-21651
5 years ago
Andy Wilkinson f0bc8ee73c Fix version placeholder replacement in Gradle plugin docs
Closes gh-21640
5 years ago
Phillip Webb 502e2a4c64 Polish 5 years ago
Andy Wilkinson 3d143e59e7 Fix inclusion of version-specific content in Gradle plugin's docs
Fixes gh-21610
5 years ago
Andy Wilkinson b1777b9dee Use stable file repository for testing snapshot layers
Closes gh-21629
5 years ago
Scott Frederick 7722394e19 Provide better error message if Docker is not running
Previously, if the Spring Boot build plugins got a connection error
when attempting to communicate with a Docker daemon (for example,
when the daemon isn't running), the error message made it appear that
the daemon returned an HTTP error code. This commit makes a connection
error distinct from an HTTP error response code to make it easier for
the user to diagnose the root cause of the problem.

Fixes gh-21554
5 years ago
Andy Wilkinson ba23368440 Configure attributes on productionRuntimeClasspath
Previously, the productionRuntimeClasspath configuration was created
without any attributes. This caused problems with multi-project
dependency resolution as there was insufficient information for Gradle
to determine which variant of a dependency should be used by the
productionRuntimeClasspath configuration.

This commit updates the configuration to have three attributes, each
configured with the same values as those of Gradle's own
runtimeClasspathConfiguration.

Fixes gh-21549
5 years ago
Scott Frederick ed4a7d4ba0 Use default tag when pulling run image
Prior to this commit, a default tag of 'latest' was used when no tag
was included in the builder image name used when building an image in
the Maven and Gradle plugins, but the tag for the run image was left
empty if it was not provided. This resulted in errors when pulling
the run image from an image repository. This commit applies the
same tag defaulting logic to the run image name.

Fixes gh-21532
5 years ago
Scott Frederick 07d842b51d Polish maven build image command line example 5 years ago
Scott Frederick a5c42ce4c4 Polish `Add gradle build image command line example`
See gh-21490
5 years ago
Dave Syer 88a32d2fb9 Add gradle build image command line example
See gh-21490
5 years ago
Andy Wilkinson 14ba7442d9 Ensure that spring-boot-parent is imported into generated pom
Fixes gh-21518
5 years ago
Andy Wilkinson ee758fa670 Use HTTPS for license links
This commit updates the MavenPublishingConventions to use HTTPS to
link to the Apache license. The configuration of NoHTTP has also
been reworked so that it will correctly find usch uses of http://
URLs.

Closes gh-21459
5 years ago
Brian Clozel 42d07a7acd Fix published Maven POMs
Prior to this commit, the published Maven POMs would not pass the Maven
Central mandatory checks.

This commit adds the missing project name and description metadata for
most artifacts. The Spring Boot Gradle plugin artifact was also missing
this information and this is now added in the plugin metadata itself.
This is also updating the project page URL which is now hosted directly
on spring.io.

Fixes gh-21457
5 years ago
Phillip Webb 038ae93406 Update copyright year of changed files 5 years ago
Phillip Webb 12381467da Polish 5 years ago
Andy Wilkinson a03426af57 Configure the Asciidoctor revnumber in a central location
See gh-20934
5 years ago
Madhura Bhave 376098d080 Set asciidoctor revnumber to null
Closes gh-20934
5 years ago
Scott Frederick 90ce472252 Support local socket path in DOCKER_HOST
Prior to this commit, if a DOCKER_HOST environment variable was present
when attempting to communicate with a Docker daemon, it was assumed
that the value of that variable was an address that could be used to
create an HTTP connection to a remote daemon. In some cases, the value
of the variable is the path to a local socket file, which would cause
the HTTP connection to fail.

This commit adds additional validation of the value of the DOCKER_HOST
environment variable to determine whether it is a remote address or
a local socket file and create the appropriate connection type.

Fixes gh-21173
5 years ago
Scott Frederick 28749e7fbb Update CNB buildpack Java version env variable
Prior to this commit, the build tool plugins set the environment
variable BP_JAVA_VERSION when invoking the CNB builder to set the
version of the JDK/JRE that the builder should use in the created
image.

With CNB API 0.3, the convention changed the name of this environment
variable to BP_JVM_VERSION. This commit updates the build tool
plugins to match the newer convention.

See gh-21273
5 years ago
Scott Frederick 35bc82a693 Use CNB creator all-in-one lifecycle
This commit modifies the buildpack platform invocation logic used by
the build plugins to invoke the single creator lifecycle introduced in
the CNB API 0.3, instead of invoking discrete lifecycle phases
separately. It also removes support for CNB API 0.2.

Fixes gh-21273
5 years ago
Johnny Lim 665a127448 Fix JarFileTests.getInputStreamWhenClosed()
See gh-21365
5 years ago
Andy Wilkinson 70c4baeef6 Merge branch '2.2.x'
Closes gh-21341
5 years ago
Andy Wilkinson 386d678d99 Use Gradle's CreateStartScripts task with 6.4 and later
Fixes gh-20759
5 years ago
Andy Wilkinson 693fa918e2 Tolerate deprecation warnings generated by Gradle 6.4
The warnings will be addressed by gh-20759. CreateBootStartScripts
must be excluded from the classes that are validated by the
ValidatePlugins task. It is invalid, but only for Gradle 6.4. gh-20759
will cause it to only be used with Gradle 6.3 and earlier.

See gh-21329
5 years ago
Stephane Nicoll 02aacf4f04 Upgrade to Gradle 6.4
Closes gh-21329
5 years ago
Andy Wilkinson 1bc41ec336 Stop developmentOnly from removing too much from executable jars and wars
Fixes gh-21288
5 years ago
Phillip Webb 5ae623c43a Polish 'Add Period converter support'
Polish period converter support, primarily by changing
`PeriodStyle` to parse and print periods that include
more than one unit.

See gh-21136
5 years ago
Grubhart dc4d71f91e Add Period converter support
Add converter support for `javax.time.Period` including:

	String -> Period
	Number -> Period
	Period -> String

Period to Number conversion is not supported since `Period` has no
ability to deduce the number of calendar days in the period.

See gh-21136
5 years ago
Phillip Webb 4a8492d428 Further optimize StringSequence.startsWith
See gh-21259
5 years ago
dreis2211 70ffc70993 Optimize StringSequence.startsWith
See gh-21259
5 years ago
Kyle Hoehns fd46002666 Fix typo for includeLayerTools
See gh-21310
5 years ago
Andy Wilkinson de1e3c6069 Include empty layers when listing and extracting
Fixes gh-21301
5 years ago
Scott Frederick 1c11e163c7 Fix Maven plugin command-line examples
Fixes gh-21078
5 years ago
Scott Frederick 0cb090766f Fix typos in mock tests data 5 years ago
Scott Frederick f3d717e97a Use paketo-buildpacks/builder as default builder
This commit changes the default builder image from
`cloudfoundry/cnb:bionic-platform-api-0.2` to
`gcr.io/paketo-buildpacks/builder:base-platform-api-0.3`. It also
uses a `paketo-buildpacks/builder` image instead of a
`cloudfoundry/cnb` image to test compatibility with lifecycle v2
and uses paketo naming instead of cloudfoundry when mocking builder
interactions.

Some adjustments to lifecycle phases were also made to align more
closely with the pack CLI.

Fixes gh-21066
5 years ago
Andy Wilkinson c7a5b72565 Improve compatibility by replacing use of seq with a native for-loop
Closes gh-21068
5 years ago
Andy Wilkinson 2d769e7679 Polish "Stop limiting layer customization to external modules"
See gh-21207
5 years ago
Paddy Drury 98644df64d Stop limiting layer customization to external modules
See gh-21207
5 years ago
Stephane Nicoll 6921fdacac Expand configuration class eager filtering to imports
Previously, only root auto-configuration classes could be excluded
eagerly via an AutoConfigurationImportFilter. Any configuration class
loaded as a result of processing a particular auto-configuration were
parsed and checked as usual.

This commit makes use of the `getExclusionFilter` callback to expand
this filter to all candidates that are considered. The annotation
processor has also be expanded to generate metadata for non-root
configuration classes.

Closes gh-12157
5 years ago
Phillip Webb ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
5 years ago
dreis2211 4b0a31acf8 Delete Toml class
See gh-21129
5 years ago
Phillip Webb 50e9674631 Backport "Attempt to prevent JarFiles from being left open"
Update `JarFile` so that `super.close()` is called early so that the
file is not left open. Since we re-implement `JarFile` methods to work
directly on the underlying `RandomAccessDataFile`, it should be safe
to close immediately.

Closes gh-21177
5 years ago
Andy Wilkinson fb33610027 Automatically create developmentOnly configuration
Previously, the developmentOnly configuration, typically used for
Devtools, had to be declared manually. The BootJar and BootWar tasks
then had a property, excludeDevtools, that could be used to control
whether or not Devtools would be excluded from the executable archive.

This commit updates the reaction to the Java plugin being applied to
automatically create the developmentOnly configuration. The classpaths
of bootJar and bootWar are then configured not to include the contents
of the developmentOnly configuration. As a result of this, the
excludeDevtools property is no longer needed and has been deprecated.
Its default has also been changed from true to false to make it easy
to opt in to Devtools, when configured as a development-only
dependency, being included in executable jars and wars by adding
developmentOnly to the classpath of the archive task.

Closes gh-16599
5 years ago
Phillip Webb 77b9dd900c Merge branch '2.2.x'
See gh-21127
5 years ago
Phillip Webb 7d53f7d27f Attempt to prevent JarFiles from being left open
Update `JarFile` to also call `super.close()` early for nested jars.

See gh-21126
5 years ago
Phillip Webb 4f47b7b46a Merge branch '2.2.x'
See gh-21127
5 years ago
Phillip Webb 7c6e912463 Attempt to prevent JarFiles from being left open
Update `JarFile` so that `super.close()` is called early so that the
file is not left open. Since we re-implement `JarFile` methods to work
directly on the underlying `RandomAccessDataFile`, it should be safe
to close immediately.

See gh-21126
5 years ago
Stephane Nicoll 961be0fea3 Merge branch '2.2.x'
Closes gh-21118
5 years ago
dreis2211 e3a9bacf3b Fix typo
See gh-21002
5 years ago
dreis2211 848127ae49 Avoid recompiling pattern in Handler#canonicalize
See gh-21103
5 years ago
dreis2211 5eb5bf0a2d Polish
See gh-21009
5 years ago
Stephane Nicoll 85e9f713b0 Update copyright year of changed files
See gh-21007
5 years ago
Johnny Lim 29717423a3 Remove this keyword on member method invocations
See gh-21007
5 years ago
Andy Wilkinson 076a384c9c Merge branch '2.2.x'
Closes gh-21112
5 years ago
Andy Wilkinson 29dc236bb2 Broaden deprecation warning check in Gradle Plugin's tests
Closes gh-21111
5 years ago
Scott Frederick 8f5ef951de Use current timestamp for index files with Gradle
This commit removes changes the timestamp used when writing the
classpath and layers index files in the Gradle plugin to be the
current timestamp unless `preserveFileTimestamps=true`. It also
polishes some duplication in the handling of entry attributes
when creating the fat archive and adds a test to verify that
the Gradle plugin uses the same fixed timestamp constant as
Gradle uses internally.

See gh-21005
5 years ago
Phillip Webb b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
5 years ago
Phillip Webb bf41da5322 Update copyright year of changed files 5 years ago
Phillip Webb ed7a5db174 Fail operations when JarFile is closed
Update `JarFile` to track when the instance has been closed and throw
an exception in the same way that `ZipFile` does.

Closes gh-21072
5 years ago
Phillip Webb cc33e23d31 Merge branch '2.2.x'
Closes gh-21074
5 years ago
Phillip Webb 6bf933205c Merge branch '2.1.x' into 2.2.x
Fixes gh-21073
5 years ago
Scott Frederick fa186aa15b Preserve timestamps on loader directories
Prior to this commit, when the Maven plugin copied
spring-boot-loader.jar to a repackaged archive the timestamps of class
files were preserved but the timestamps of directories were not
preserved. This resulted in the directories having a current timestamp.

This commit copies the directory timestamps from spring-boot-loader.jar
to the repackaged archive and adds tests to verify the proper
behavior.

See gh-20927
5 years ago
Phillip Webb c85918b8b3 Create new JarFile instance for URL connections
Update `JarURLConnection` to ensure that when connections are opened
a new copy of the JarFile is provided.

Prior to this commit, a single `JarFile` instance was shared which meant
that it could be accidental closed if accessed via
`JarURLConnection.getJarFile()`. If the underlying jar file is closed
then it's possible for a `NoClassDefFoundError` to be thrown if running
on JDK 11 with an active `SecurityManager`.

Closes gh-17796
5 years ago
Stephane Nicoll 692885f71e Merge branch '2.2.x'
Closes gh-21049
5 years ago
Stephane Nicoll 8cbd7f5cd0 Polish "Add support for initializing nested object when nothing bound"
This commit harmonizes the change made to @DefaultValue to the
annotation processor. If such annotation is added to a scalar value with
no value at all, no default value is produced.

Closes gh-18917
5 years ago
Scott Frederick 555132e096 Fix archive attributes in Gradle plugin
This commit ensures that file permissions are set on entries that the
Gradle plugin adds to an archive. It also reverts the constant date
and time used for added entries to a previous value to ensure a time
zone offset is not applied.

See gh-20927
5 years ago
Johnny Lim 5fad43ec40 Polish
See gh-20973
5 years ago
Stephane Nicoll 4648ecef6e Merge branch '2.2.x'
Closes gh-20969
5 years ago
Stephane Nicoll 1dd8dcc6c9 Polish "Polish JarFile to extra anonymous inner class"
See gh-20882
5 years ago
Konrado85 e0d1cf0e38 Polish JarFile to extra anonymous inner class
See gh-20882
5 years ago
Konrado85 9f4c39c985 Change PropertiesLauncher equals method to use URI
See gh-20872
5 years ago
dreis2211 4b9986d790 Remove unused fields in tests
See gh-20926
5 years ago
Cicio Flaviu 7f1655e5cb Add package-info to buildpack.platform.docker.ssl
See gh-20913
5 years ago
dreis2211 d4575bc122 Fix unused parameters
See gh-20911
5 years ago
Stephane Nicoll 1c70b6735a Remove plugin management for exec-maven-plugin
Closes gh-20883
5 years ago
dreis2211 ae15a3d162 Polish LayersIndex
See gh-20874
5 years ago
Madhura Bhave 62c09d607a Polish 5 years ago
Phillip Webb 3ca896e63f Polish 5 years ago
Phillip Webb 1640add8be Don't use Assert class from loader
Remove the use of `Assert` since it's unavailable that early.
5 years ago
Phillip Webb d9fb4dd477 Don't use monospacing in documentation headings
Closes gh-20875
5 years ago
Scott Frederick e17d4be484 Polish plugin documentation headings 5 years ago
Scott Frederick a64e26fc44 Polish plugin documentation headings 5 years ago
Phillip Webb 729fc9dd6d Ensure streams are always closed
Update `AbstractJarWriter` to ensure that streams are always closed,
even if entries are not written.
5 years ago
Phillip Webb 1abbfbbfcd Attempt to fix failing Windows test 5 years ago
Phillip Webb ffd499fdc7 Attempt to fix failing Windows test 5 years ago
Phillip Webb d3c06ee0cf Remove windows line endings when parsing index 5 years ago