Commit Graph

1062 Commits

Author SHA1 Message Date
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.
2020-02-06 17:24:29 -06:00
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
2020-02-06 17:24:29 -06:00
Johnny Lim 6818279751 Fix typo
See gh-20049
2020-02-06 16:39:25 +01:00
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
2020-02-06 16:29:20 +01:00
Andy Wilkinson 5c2b28cb57 Merge branch '2.2.x'
Closes gh-20043
2020-02-05 14:10:04 +00:00
Andy Wilkinson b6a408ae77 Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
Closes gh-20041
2020-02-05 14:04:14 +00:00
Stephane Nicoll b5e23e7405 Update copyright year of changed files
See gh-20020
2020-02-03 17:39:40 +01:00
Johnny Lim b67ece48e4 Polish
See gh-20020
2020-02-03 17:37:01 +01:00
dreis2211 e4a95a8047 Upgrade to Ivy 2.5.0
See gh-20022
2020-02-03 17:35:33 +01:00
dreis2211 326092b69e Upgrade to Ant 1.10.7
See gh-20002
2020-02-03 10:29:24 +01:00
Andy Wilkinson bca98c5126 Use a RegularFileProperty to configure BootBuildImage's input jar
Closes gh-20010
2020-02-02 14:39:50 +00:00
Johnny Lim e6d5f5a271 Polish
See gh-19995
2020-02-01 09:24:20 +01:00
Phillip Webb cbacab5e26 Polish 2020-01-30 17:14:36 -08:00
Phillip Webb 1eee83a07e Update copyright year of changed files 2020-01-30 17:09:49 -08:00
Phillip Webb 234c5033d4 Polish whitespace 2020-01-30 17:09:49 -08:00
Scott Frederick 653cabe2ce Add documentation for gradle bootBuildImage task 2020-01-30 17:54:15 -06:00
Madhura Bhave bceed1305f Jar files added after build time should be added to classpath
Fixes gh-19973
2020-01-30 15:38:49 -08:00
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
2020-01-30 16:34:02 -06:00
Andy Wilkinson 7b0d1eaffc Test the Gradle Plugin against Gradle 6.1.1
Closes gh-19912
2020-01-30 15:12:30 +00:00
Andy Wilkinson 2725264be1 Polishing formatting of DockerApi 2020-01-30 14:08:45 +00:00
Andy Wilkinson 28442b5ca5 Lower the minimum required Docker API version to 1.24
Closes gh-19945
2020-01-30 13:57:18 +00:00
Andy Wilkinson 54b3f480b4 Use posix long names when creating tar archive for image building
Fixes gh-19964
2020-01-30 13:31:27 +00:00
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
2020-01-29 17:51:32 -06:00
dreis2211 d8e2349e47 Use Supplier variants of Assert
See gh-19864
2020-01-28 15:04:11 +01:00
Stephane Nicoll 9fbaf7611b Merge branch '2.2.x'
Closes gh-19966
2020-01-28 14:43:54 +01:00
Stephane Nicoll b420bdb3ac Merge branch '2.1.x' into 2.2.x
Closes gh-19965
2020-01-28 14:43:30 +01:00
dreis2211 db2bacc62a Fix Gradle plugin documentation links
See gh-19961
2020-01-28 14:41:05 +01:00
dreis2211 741a4f4b2b Fix links in Maven Plugin documentation
See gh-19952
2020-01-28 10:50:36 +01:00
Stephane Nicoll 5410148f79 Improve documentation of 'image' parameter of Maven Plugin
Closes gh-19950
2020-01-27 20:56:42 +01:00
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
2020-01-27 20:12:00 +01:00
Stephane Nicoll 07a1783572 Polish "Introduce appendix section with version properties"
See gh-19898
2020-01-27 14:53:52 +01:00
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
2020-01-27 14:53:32 +01:00
Andy Wilkinson 63b736d1f0 Fix NPE when waiting for named socket path to become available
Fixes gh-19941
2020-01-27 11:38:19 +00:00
Stephane Nicoll 3290313eb7 Fix Docker socket creation on Windows
Closes gh-19908
2020-01-27 07:29:16 +01:00
dreis2211 d75de39456 Upgrade to JUnit Jupiter 5.6.0
See gh-19907
2020-01-26 08:39:12 +01:00
Madhura Bhave 1d62debf11 Fix typo 2020-01-24 16:37:48 -08:00
Stephane Nicoll 0bd03fa278 Fix xml syntax in example
Closes gh-19906
2020-01-24 16:01:44 +01:00
dreis2211 d84ca1149c Test the Gradle Plugin against Gradle 6.1
See gh-19776
2020-01-24 13:46:00 +01:00
Andy Wilkinson cbee16318f Fix version references in Maven Plugin's reference documentation
Closes gh-19878
2020-01-23 16:37:18 +00:00
Stephane Nicoll 331ebe90e0 Restore @since on build-image parameters 2020-01-23 16:47:03 +01:00
Stephane Nicoll 63019ab3f1 Add documentation for Maven plugin's build-image support
Closes gh-19830
2020-01-23 16:35:45 +01:00
Stephane Nicoll 6df5e7af4f Add integration tests for Maven plugin's build-image support
See gh-19830
2020-01-23 16:06:11 +01:00
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
2020-01-23 14:37:06 +00:00
Andy Wilkinson a0b4cdee44 Make line ending expectations in TotalProgressBarTests OS-independent
See gh-19828
2020-01-23 14:14:14 +00:00
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
2020-01-23 13:50:22 +00:00
Stephane Nicoll 105db66553 Polish 2020-01-23 14:04:19 +01:00
Stephane Nicoll e044817fe7 Migrate remaining use of ClassLoader.loadClass to Class.forName
Closes gh-19824
2020-01-23 13:15:45 +01:00
Andy Wilkinson 01a0a54f78 Include layertools in layered jars build with Gradle
Closes gh-19867
2020-01-23 11:43:19 +00:00
Andy Wilkinson 288f5ceaee Fix zip compression of libs in layered jars
Closes gh-19792
2020-01-23 11:40:13 +00:00
Andy Wilkinson 0bd0b2a6c0 Add support for building OCI images using the Gradle plugin
Closes gh-19831
2020-01-23 10:52:57 +00:00
Andy Wilkinson bc452bc094 Polish BootJarTests
See gh-19847
See gh-19792
2020-01-23 10:05:33 +00:00
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
2020-01-23 10:47:53 +01:00
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
2020-01-22 23:14:47 -08:00
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
2020-01-22 23:07:18 -08:00
Phillip Webb 57db621b70 Polish 2020-01-22 23:06:58 -08:00
Phillip Webb 77bbe089b2 Update copyright year of changed files 2020-01-22 20:24:23 -08:00
Phillip Webb 71ce212f7f Rename spring-boot-layertools
Rename `spring-boot-layertools` to `spring-boot-jarmode-layertools`.

Closes gh-19853
2020-01-22 20:24:23 -08:00
Madhura Bhave 13f7db2d8c Write classpath index file from Gradle plugin
Closes gh-19847
2020-01-22 19:32:08 -08:00
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`.
2020-01-22 16:02:38 -08:00
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.
2020-01-22 15:49:52 -08:00
Madhura Bhave df5b0f1163 Add support for layered jars in gradle plugin
Closes gh-19792

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2020-01-22 14:53:36 -08:00
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
2020-01-22 12:56:14 -08:00
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
2020-01-22 11:01:32 -08:00
dreis2211 23e87f8266 Treat Java 11+'s NoSuchFileException the same as FileNotFoundException
See gh-19850
2020-01-22 11:45:11 +00:00
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
2020-01-22 01:26:55 -08:00
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
2020-01-22 01:23:11 -08:00
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
2020-01-22 01:13:54 -08:00
Phillip Webb 7d8f8d47c8 Fix packager code to generate layer index file
Update `Packager` to create the layer index file when repackaging.

Closes gh-19767
2020-01-21 23:26:19 -08:00
Phillip Webb bfd2ca7fd9 Polish Gradle expression references
Expand all expression `$` references to the full `${...}` form.
2020-01-21 18:33:33 -08:00
Andy Wilkinson 89237634c7 Fix classpath used for Gradle Plugin integration tests in Eclipse
See gh-19841
2020-01-21 14:59:07 +00:00
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
2020-01-21 12:52:02 +00:00
Andy Wilkinson 62a848f1b1 Register JNA's native library integration in LinuxSocketDomain
See gh-19836
2020-01-21 11:09:31 +00:00
Stephane Nicoll d421c63747 Disable integration test on Linux
See gh-19836
2020-01-21 10:46:55 +01:00
Stephane Nicoll ffd7670843 Attempt to make DockerApiIntegrationTests work on Linux 2020-01-21 10:19:56 +01:00
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
2020-01-20 23:48:47 -08:00
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
2020-01-20 23:48:47 -08:00
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
2020-01-20 23:48:47 -08:00
Andy Wilkinson 408f17f821 Close FileInputStreams in RepackagerTests 2020-01-17 20:04:31 +00:00
Andy Wilkinson 724597d45f Use a centrally managed version for commons-compress 2020-01-17 10:34:55 +00:00
Phillip Webb fd792cedaf Polish DisabledIfDockerUnavailable
Convert `DisabledIfDockerUnavailable` to be an annotation and make
it slightly less noisy.
2020-01-16 16:54:43 -08:00
Madhura Bhave cf01f9fba0 Add tests for configuring layered jar layout
Closes gh-19768
2020-01-16 11:27:41 -08:00
Scott Frederick 8f102aee68 Remove deprecated 2.2 code
See gh-19699
2020-01-16 14:44:52 +01:00
Andy Wilkinson 9d5975bd09 Upgrade to Gradle 6.1
Closes gh-19772
2020-01-16 10:00:45 +00:00
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
2020-01-15 23:33:29 -08:00
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>
2020-01-15 23:32:58 -08:00
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>
2020-01-15 23:31:17 -08:00
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
2020-01-15 23:29:11 -08:00
Andy Wilkinson 56e30258fb Merge branch '2.2.x' 2020-01-15 20:45:42 +00:00
Andy Wilkinson b7e250eb04 Merge branch '2.1.x' into 2.2.x 2020-01-15 20:45:24 +00:00
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
2020-01-15 20:43:54 +00:00
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
2020-01-15 12:33:18 +00:00
Madhura Bhave aae1151f12 Merge branch '2.2.x'
Closes gh-19714
2020-01-14 18:52:35 -08:00
Madhura Bhave 3bf943d597 Merge branch '2.1.x' into 2.2.x
Closes gh-19713
2020-01-14 18:51:50 -08:00
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
2020-01-14 18:27:30 -08:00
Madhura Bhave 91e459a5d4 Polish "Limit ChronoField values to their range"
See gh-19595
2020-01-14 18:26:01 -08:00
Dmytro Nosan 9bc68b9877 Limit ChronoField values to their range
See gh-19595
2020-01-14 18:25:28 -08:00
Andy Wilkinson 244b5391bc Fix file handle leak in JarFileArchiveTests
Closes gh-19655
2020-01-14 17:20:29 +00:00
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
2020-01-14 12:15:53 +00:00
Phillip Webb 862462b791 Update copyright year of changed files 2020-01-13 17:04:19 -08:00
Phillip Webb f57281340c Merge branch '2.2.x' 2020-01-13 16:46:49 -08:00
Phillip Webb 3cfbfebbb1 Merge branch '2.1.x' into 2.2.x 2020-01-13 16:45:40 -08:00
Phillip Webb 9bd49562fe Update copyright year of changed files 2020-01-13 14:09:11 -08:00
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
2020-01-13 19:59:56 +00:00
dreis2211 d454c9653c Disable tests on Java 13 that require an incompatible Gradle version
See gh-19680
2020-01-13 16:51:55 +00:00
Stephane Nicoll ca1710ee56 Upgrade to Apache Cassandra 4.3.1
See gh-19588
2020-01-13 15:12:41 +01:00
Andy Wilkinson e415f759a2 Raise the minimum supported version of Gradle to 5.6
Closes gh-18777
2020-01-13 12:10:13 +00:00
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
2020-01-13 11:00:49 +00:00
Andy Wilkinson 7fda317f0d Merge branch '2.1.x' into 2.2.x
Closes gh-19657
2020-01-12 10:42:42 +00:00
Andy Wilkinson 617ebaf3c0 Isolate Gradle Plugin build from other Gradle configuration
Closes gh-19656
2020-01-12 10:41:38 +00:00
Brian Clozel e0171a5da8 Polish 2020-01-10 22:29:57 +01:00
Andy Wilkinson b5ae8b0af5 Disable tests that use Docker when Docker is unavailable
Closes gh-19616
2020-01-10 20:35:18 +00:00
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +00:00
Andy Wilkinson bdffa860d9 Increase startup timeout for Docker containers
Closes gh-19569
2020-01-08 11:39:36 +00:00
Andy Wilkinson 30c124f549 Merge branch '2.2.x'
Closes gh-19554
2020-01-07 12:06:07 +00:00
Andy Wilkinson c57359ea3b Merge branch '2.1.x' into 2.2.x
Closes gh-19553
2020-01-07 12:05:21 +00:00
Andy Wilkinson d46406fcb9 Remove loading of non-existent properties file from antlib
Fixes gh-19552
2020-01-07 12:04:59 +00:00
Johnny Lim e4057dd528 Polish
See gh-19484
2019-12-30 14:57:29 +01:00
Stephane Nicoll e7f45d8a34 Polish "Add toolchains support for Spring Boot Maven Plugin"
See gh-18732
2019-12-26 12:03:18 +01:00
Dmytro Nosan eede16ff0a Add toolchains support for Spring Boot Maven Plugin
See gh-18732
2019-12-26 12:03:18 +01:00
Stephane Nicoll a2b2b46b83 Merge branch '2.2.x'
Closes gh-19463
2019-12-26 11:18:55 +01:00
Stephane Nicoll 6c016663fd Polish contribution
See gh-18711
2019-12-26 11:17:51 +01:00
Dmytro Nosan 1fb904acee Support commas embedded in command line arguments from Maven plugin
See gh-18711
2019-12-26 11:05:09 +01:00
Stephane Nicoll 2c1e81adf0 Polish 2019-12-26 10:42:40 +01:00
Stephane Nicoll 065fe9996d Merge branch '2.2.x'
Closes gh-19454
2019-12-24 11:00:23 +01:00
Stephane Nicoll ee98855905 Merge branch '2.1.x' into 2.2.x
Closes gh-19453
2019-12-24 10:59:58 +01:00
Stephane Nicoll 5dc6491807 Clarify documentation of repackage mojo's attach property
Closes gh-19021
2019-12-24 10:59:36 +01:00
Stephane Nicoll 6d9c176e19 Merge branch '2.2.x'
Closes gh-19441
2019-12-23 15:09:21 +01:00
Stephane Nicoll b3643965f0 Polish "Detect config props using builder pattern and generics"
See gh-19099
2019-12-23 14:57:48 +01:00
如梦技术 743f4a4cb1 Detect config props using builder pattern and generics
See gh-19099
2019-12-23 14:54:00 +01:00
Phillip Webb 93d9147864 Add deprecation documentation to Archive.iterator
See gh-16655
2019-12-19 16:52:47 -08:00
Andy Wilkinson ef2eb2f652 Remove accidental usage of Plexus's CollectionUtils
See gh-16655 and 8f5777cf
2019-12-14 17:42:26 +00:00
Phillip Webb 1b1c61a2ed Make processor output fully reproducible
Update `AutoConfigureAnnotationProcessor` to ensure that the generated
properties file is fully repeatable. Properties are now sorted and
written out directly to ensure that the timestamp comment is not
present.

Closes gh-19370
2019-12-13 13:04:49 -08:00
Phillip Webb 2fc12bc36c Merge branch '2.2.x' 2019-12-13 11:30:13 -08:00
Phillip Webb 26ff18f37d Merge branch '2.1.x' into 2.2.x 2019-12-13 11:29:51 -08:00
Phillip Webb accd830dd5 Update copyright header of changed files 2019-12-13 11:23:24 -08:00
dreis2211 3be05f61e1 Fix unknown tag in javadoc
See gh-19364
2019-12-12 17:04:25 -08:00
Madhura Bhave 8f5777cf9e Optimize JarLauncher when used with exploded jar
- Previously, we would create a JarFileArchive for all nested jars.
This was an additional overhead. We only need to create a JarFileArchive
for jars that can have nested jars in them. For all other jars we only need
the URL to build the classpath.
- While iterating over nested entries in the exploded jar, we only need to
look at BOOT-INF and we can skip any entry that does not match that.

Closes gh-16655

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-12-12 14:33:48 -08:00
Andy Wilkinson ab4e1c465f Merge branch '2.2.x'
See gh-19288
2019-12-05 10:25:12 +00:00
Andy Wilkinson 47b47c28a0 Reduce visibility of the Gradle plugin's test methods
See gh-19287
2019-12-05 10:24:48 +00:00
Andy Wilkinson f731c92b66 Merge branch '2.2.x' 2019-11-27 12:52:14 +00:00
Andy Wilkinson 76f03a8cad Fix reflective access to archiveBaseName property
Previously, reflective access to the archiveBaseName property
incorrectly treated the property as a String. It should have been
treated as a Property<String>. This caused an exception to be thrown
and the deprecated baseName property to be used as a fallback.

This commit corrects the reflective access to the archiveBaseName
property. It also updates the tests to fail if a build outputs a
deprecation warning. Tests that use Gradle's Maven plugin have been
updated to expect deprecation warnings when run with Gradle 6.0 where
the plugin is deprecated. Tests that configure an archive's base name
have been updated to use archiveBaseName when running with Gradle 6.0
and later.

Closes gh-18663
2019-11-27 12:52:05 +00:00
dreis2211 60640ea185 Fix link in new Maven Plugin docs
See gh-19108
2019-11-25 09:49:30 +01:00
Stephane Nicoll a76a864270 Polish "Replace the Maven Plugin's site with Asciidoctor documentation"
See gh-19080
2019-11-21 17:43:50 +01:00
Stephane Nicoll 30863eb041 Merge branch '2.2.x'
Closes gh-19088
2019-11-21 13:45:42 +01:00
dreis2211 347434ba81 Test the Gradle Plugin against Gradle 6.0.1
See gh-19065
2019-11-21 13:44:55 +01:00
Andy Wilkinson 3e2454f8c4 Replace the Maven Plugin's site with Asciidoctor documentation
Closes gh-19080

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2019-11-21 10:50:05 +00:00
Johnny Lim 96a029e44f Polish a test name
See gh-18999
2019-11-13 08:52:32 +01:00
Andy Wilkinson 379ba0dc00 Support Gradle 6.0
Previously, our Gradle plugin was not tested against Gradle 6.0,
a number of deprecation warnings were output when using the plugin
with Gradle 6, and some functionality related to the application
plugin did not work as expected.

This commit tests the plugin against Gradle 6. It also avoids calling
deprecated APIs. The plugin is compatibile against Gradle 4.10 where
the deprecated APIs' replacements are not available so reflection is
used to call the replcaements. Lastly, the way in which the base name
of the boot distribution that is created when the application plugin
is applied has been modified to ensure that it is effective when using
Gradle 6.

Closes gh-18663
2019-11-11 16:36:40 +00:00
Andy Wilkinson fc3f6a930d Merge branch '2.1.x' into 2.2.x
Closes gh-18940
2019-11-08 13:32:49 +00:00
Andy Wilkinson 5765cfe010 Allow 5 seconds for child to handle SIGINT before destroying it
Previously, when RunProcess handled a SIGINT it would immediately
attempt to destroy the process that it had run. This created a race
condition between the SIGINT being handled by the child process
and RunProcess destroying the child. The exact behavior of destroy
is implementation dependent and it may result in forcible termination
of the process where shutdown hooks are not called. This is what
happens on Windows. The exit code in such a case is 1 which prevents
anything from waiting for the process to complete from detecting
that it ended as a result of a SIGINT, leaving it with no choice but
to report an error. This is what happens with mvn spring-boot:run
with a forked process on Windows and results in the build failing.

This commit updates RunProcess to allow the child process to handle
the SIGINT itself, waiting for up to five seconds for that to happen
before the process is then destroyed. Given this time, the child
process exits with 130 which RunMojo already handles correctly as
indicating that the process died due to SIGINT and the build completes
with success as a result.

Fixes gh-18936
2019-11-08 12:41:13 +00:00
Johnny Lim ea51947741 Use try-with-resources blocks in JarFileArchiveTests
See gh-18883
2019-11-06 08:01:50 +01:00
Andy Wilkinson f1af8c5510 Merge branch '2.1.x'
Closes gh-18889
2019-11-05 15:50:51 +00:00
Andy Wilkinson 59bc3c5602 Prevent recursive config props from causing a stack overflow
Previously, when the configuration properties annotation processor
encountered a property that was the same as an outer type that had
already been processed, it would fail with a stack overflow error.

This commit introduces the use of a stack to track the types that
have been processed. Types that have been seen before are skipped,
thereby preventing a failure from occurring. We do not fail upon
encountering a recursive type to allow metadata generation to
complete. At runtime, the recursive property will not cause a problem
if it is not bound.

Fixes gh-18365
2019-11-05 15:35:11 +00:00
Stephane Nicoll b951e70d18 Merge branch '2.1.x'
Closes gh-18850
2019-11-04 09:57:48 +01:00
dreis2211 8955d5c1b5 Test the Gradle Plugin against Gradle 5.6.4
See gh-18845
2019-11-04 09:56:12 +01:00
Johnny Lim 45d85778b8 Polish
See gh-18838
2019-11-01 09:01:24 +02:00
Stephane Nicoll d6d32ec01d Polish 2019-10-29 09:02:25 +01:00
Alessandro Falappa 2c199b1296 Make optimizedLaunch property name more consistent
See gh-18702
2019-10-23 18:24:33 +02:00
Phillip Webb 83d4d94e8b Cache ModifiedClassPathClassLoaders
Closes gh-18694
2019-10-22 15:25:31 -07:00
Phillip Webb 8d08d654d1 Merge branch '2.1.x'
Closes gh-18693
2019-10-22 15:18:32 -07:00
Stephane Nicoll c05f88bf78 Polish "Add missing package-info files"
See gh-18632
2019-10-22 09:35:10 +02:00
Leo Li af114c93ee Add missing package-info files
See gh-18632
2019-10-22 09:30:04 +02:00
Andy Wilkinson 03f5791860 Merge branch '2.1.x'
Closes gh-18650
2019-10-18 10:37:39 +01:00
dreis2211 d17f11dbe1 Test the Gradle Plugin against Gradle 5.6.3
See gh-18648
2019-10-18 10:35:54 +01:00
Johnny Lim 137538f415 Remove accidental JavaVersion.current() call in BootRun
It was added accidentally in d2b28ceb.

See gh-18619
2019-10-16 13:40:21 +01:00
Stephane Nicoll 8108b556ad Fix resource cleanup in test
Closes gh-18569
2019-10-13 13:41:50 +02:00
Andy Wilkinson 9a89039172 Provide a marker artifact for Boot's Gradle plugin
Closes gh-18514
2019-10-11 16:51:29 -05:00
Kant Leung 2f73e196af Polish
See gh-18534
2019-10-08 07:38:21 -05:00
Phillip Webb 61873fbf42 Don't generate @Configuration metadata
Update `AutoConfigureAnnotationProcessor` to no longer store
`@Configuration.value` in the meta-data JSON since we never actually
read it.

Closes gh-16608
2019-10-02 21:41:31 -07:00
Phillip Webb 386c0a60a7 Relax @ConstructorBinding member class requirement
Update `@ConfigurationProperties` so that `@ConstructorBinding` classes
no longer need to repeat the annotation for their members.

Closes gh-18481
2019-10-02 17:17:44 -07:00
Stephane Nicoll 45f6668d03 Use @ConstructorBinding when generating meta-data
Update the configuration processor to use the newly introduced
`@ConstructorBinding` annotation to determine when meta data
should be generated from constructor parameters.

Prior to this commit, the processor had no good way to tell when
constructor parameters should be used instead of getters/setters.

Closes gh-17035
2019-10-02 13:36:27 -07:00
Andy Wilkinson 9e514ab7f9 Provide plugin release repository for Asciidoctor Extensions
See b5069a4f8a
2019-10-02 13:43:34 +01:00
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
2019-10-02 10:48:57 +01:00
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Andy Wilkinson ed29eea365 Align Spring Asciidoctor Extension dependency with new module names 2019-10-01 14:54:03 +01:00
Stephane Nicoll 852b369ce1 Revert to fixed version 2019-10-01 15:20:23 +02:00
Andy Wilkinson a6f1619971 Use Asciidoctor extension to verify documented configuration properties
Closes gh-18451
2019-10-01 10:39:06 +01:00
Stephane Nicoll e0d6d90683 Merge branch '2.1.x'
Closes gh-18447
2019-10-01 08:06:23 +02:00
dreis2211 417bfc4c87 Fix comment position in ZipHeaderPeekInputStreamTests
See gh-18445
2019-10-01 08:05:08 +02:00
dreis2211 370998e91e Simplify pipe escaping for reference doc tables
Replace `{vbar}` with an escaped pipe character. Unfortunately
`{vbar}` does not render correctly with PDF generation.

See gh-18374
2019-09-28 22:02:27 -07:00
dreis2211 8a6e254465 Avoid need to escape pipe character in reference tables 2019-09-28 22:02:27 -07:00
Phillip Webb a13666d696 Polish "Simplify code"
See gh-18342
2019-09-26 19:12:18 -07:00
Yuyan 4d0da4b700 Simplify code
See gh-18342
2019-09-26 19:09:28 -07:00
Brian Clozel eeaa9bc6c1 Fix ref docs code snippet theme
This commit also fixes a link in the reference documentation.

See gh-18293
2019-09-24 11:25:57 +02:00
Andy Wilkinson 79b5fd9d73 Polish "Allow the user that runs the app to be specified via an env var"
See gh-16973
2019-09-21 20:14:49 +01:00
Wagner Macedo b57f35893c Allow the user that runs the app to be specified via an env var
See gh-16973
2019-09-21 17:57:20 +01:00
Phillip Webb 838e7eb605 Extract spring-doc-resources URL property
Update the build to use a shared spring-doc-resources URL
rather than repeating it multiple times.

See gh-18293
2019-09-20 21:38:56 -07:00
Andy Wilkinson 02ac089767 Polish "Support zip64 jars"
See gh-16091
2019-09-20 14:35:19 +01:00
Camille Vienot 1917e1eac5 Support zip64 jars
See gh-16091
2019-09-20 12:44:04 +01:00
Andy Wilkinson d5fc324537 Upgrade to Asciidoctor Maven Plugin 1.6.0
Closes gh-17234
2019-09-20 11:59:16 +01:00
Andy Wilkinson 7d3e53c94c Fix test expectations for run-fork JVM args on Java 13+
Closes gh-17008
2019-09-19 10:07:03 +01:00
Andy Wilkinson d2b28ceba5 Don't add -Xverify:none to JVM args when running on Java 13
Closes gh-17008
2019-09-18 21:51:41 +01:00
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
2019-09-13 20:50:14 +01:00
Johnny Lim 5b41c3b608 Polish
See gh-18192
2019-09-12 14:55:47 +02:00
Stephane Nicoll 39fed4a9d9 Fix binding detection of ConfigurationProperties contributed by @Bean
This commit makes sure that a ConfigurationProperties type contributed
by a `@Bean` factory method uses properties binding regardless of the
presence of a matching constructor.

`@Bean` method makes sure the user is in control and will be responsible
of creating the instance. As a result, binding of properties will not
happen there and therefore can only happen with regular JavaBean
accessors.

Closes gh-18184
2019-09-09 13:29:31 +02:00
Andy Wilkinson 0c0e2dd54b Merge branch '2.1.x'
Closes gh-18186
2019-09-09 11:16:30 +01:00
Andy Wilkinson 7b1e10ed00 Use one sentence per line in Actuator and Gradle plugin doc source
Closes gh-18185
2019-09-09 10:59:49 +01:00
Andy Wilkinson ff1983c9ae Merge branch '2.1.x'
Closes gh-18168
2019-09-06 14:38:45 +01:00
Andy Wilkinson 795c2f225f Support getComment() on a nested JarFile
Previously, calling getComment() on a nested jar file would result
in the outer jar file's comment being returned.

This commit updates the loader's JarFile to read the file's comment
from the central directory end record and return it from getComment().

Fixes gh-18128
2019-09-06 14:29:48 +01:00
Andy Wilkinson fc1889ee72 Merge branch '2.1.x'
Closes gh-18167
2019-09-06 14:04:54 +01:00