Commit Graph

1127 Commits (9fa4e92fbb0ff9a18be7cc454880dbe48acc7b3b)

Author SHA1 Message Date
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
Andy Wilkinson 617ebaf3c0 Isolate Gradle Plugin build from other Gradle configuration
Closes gh-19656
5 years ago
Brian Clozel e0171a5da8 Polish 5 years ago
Andy Wilkinson b5ae8b0af5 Disable tests that use Docker when Docker is unavailable
Closes gh-19616
5 years ago
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
5 years ago
Andy Wilkinson bdffa860d9 Increase startup timeout for Docker containers
Closes gh-19569
5 years ago
Andy Wilkinson 30c124f549 Merge branch '2.2.x'
Closes gh-19554
5 years ago
Andy Wilkinson c57359ea3b Merge branch '2.1.x' into 2.2.x
Closes gh-19553
5 years ago
Andy Wilkinson d46406fcb9 Remove loading of non-existent properties file from antlib
Fixes gh-19552
5 years ago
Johnny Lim e4057dd528 Polish
See gh-19484
5 years ago
Stephane Nicoll e7f45d8a34 Polish "Add toolchains support for Spring Boot Maven Plugin"
See gh-18732
5 years ago
Dmytro Nosan eede16ff0a Add toolchains support for Spring Boot Maven Plugin
See gh-18732
5 years ago
Stephane Nicoll a2b2b46b83 Merge branch '2.2.x'
Closes gh-19463
5 years ago
Stephane Nicoll 6c016663fd Polish contribution
See gh-18711
5 years ago
Dmytro Nosan 1fb904acee Support commas embedded in command line arguments from Maven plugin
See gh-18711
5 years ago
Stephane Nicoll 2c1e81adf0 Polish 5 years ago
Stephane Nicoll 065fe9996d Merge branch '2.2.x'
Closes gh-19454
5 years ago
Stephane Nicoll ee98855905 Merge branch '2.1.x' into 2.2.x
Closes gh-19453
5 years ago
Stephane Nicoll 5dc6491807 Clarify documentation of repackage mojo's attach property
Closes gh-19021
5 years ago
Stephane Nicoll 6d9c176e19 Merge branch '2.2.x'
Closes gh-19441
5 years ago
Stephane Nicoll b3643965f0 Polish "Detect config props using builder pattern and generics"
See gh-19099
5 years ago
如梦技术 743f4a4cb1 Detect config props using builder pattern and generics
See gh-19099
5 years ago
Phillip Webb 93d9147864 Add deprecation documentation to Archive.iterator
See gh-16655
5 years ago
Andy Wilkinson ef2eb2f652 Remove accidental usage of Plexus's CollectionUtils
See gh-16655 and 8f5777cf
5 years ago
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
5 years ago
Phillip Webb 2fc12bc36c Merge branch '2.2.x' 5 years ago
Phillip Webb 26ff18f37d Merge branch '2.1.x' into 2.2.x 5 years ago
Phillip Webb accd830dd5 Update copyright header of changed files 5 years ago
dreis2211 3be05f61e1 Fix unknown tag in javadoc
See gh-19364
5 years ago
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>
5 years ago
Andy Wilkinson ab4e1c465f Merge branch '2.2.x'
See gh-19288
5 years ago
Andy Wilkinson 47b47c28a0 Reduce visibility of the Gradle plugin's test methods
See gh-19287
5 years ago
Andy Wilkinson f731c92b66 Merge branch '2.2.x' 5 years ago
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
5 years ago
dreis2211 60640ea185 Fix link in new Maven Plugin docs
See gh-19108
5 years ago
Stephane Nicoll a76a864270 Polish "Replace the Maven Plugin's site with Asciidoctor documentation"
See gh-19080
5 years ago
Stephane Nicoll 30863eb041 Merge branch '2.2.x'
Closes gh-19088
5 years ago
dreis2211 347434ba81 Test the Gradle Plugin against Gradle 6.0.1
See gh-19065
5 years ago
Andy Wilkinson 3e2454f8c4 Replace the Maven Plugin's site with Asciidoctor documentation
Closes gh-19080

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
5 years ago
Johnny Lim 96a029e44f Polish a test name
See gh-18999
5 years ago
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
5 years ago
Andy Wilkinson fc3f6a930d Merge branch '2.1.x' into 2.2.x
Closes gh-18940
5 years ago
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
5 years ago
Johnny Lim ea51947741 Use try-with-resources blocks in JarFileArchiveTests
See gh-18883
5 years ago
Andy Wilkinson f1af8c5510 Merge branch '2.1.x'
Closes gh-18889
5 years ago
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
5 years ago
Stephane Nicoll b951e70d18 Merge branch '2.1.x'
Closes gh-18850
5 years ago
dreis2211 8955d5c1b5 Test the Gradle Plugin against Gradle 5.6.4
See gh-18845
5 years ago
Johnny Lim 45d85778b8 Polish
See gh-18838
5 years ago
Stephane Nicoll d6d32ec01d Polish 5 years ago
Alessandro Falappa 2c199b1296 Make optimizedLaunch property name more consistent
See gh-18702
5 years ago
Phillip Webb 83d4d94e8b Cache ModifiedClassPathClassLoaders
Closes gh-18694
5 years ago
Phillip Webb 8d08d654d1 Merge branch '2.1.x'
Closes gh-18693
5 years ago
Stephane Nicoll c05f88bf78 Polish "Add missing package-info files"
See gh-18632
5 years ago
Leo Li af114c93ee Add missing package-info files
See gh-18632
5 years ago
Andy Wilkinson 03f5791860 Merge branch '2.1.x'
Closes gh-18650
5 years ago
dreis2211 d17f11dbe1 Test the Gradle Plugin against Gradle 5.6.3
See gh-18648
5 years ago
Johnny Lim 137538f415 Remove accidental JavaVersion.current() call in BootRun
It was added accidentally in d2b28ceb.

See gh-18619
5 years ago
Stephane Nicoll 8108b556ad Fix resource cleanup in test
Closes gh-18569
5 years ago
Andy Wilkinson 9a89039172 Provide a marker artifact for Boot's Gradle plugin
Closes gh-18514
5 years ago
Kant Leung 2f73e196af Polish
See gh-18534
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
Andy Wilkinson 9e514ab7f9 Provide plugin release repository for Asciidoctor Extensions
See b5069a4f8a
5 years ago
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
5 years ago
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
5 years ago
Andy Wilkinson ed29eea365 Align Spring Asciidoctor Extension dependency with new module names 5 years ago
Stephane Nicoll 852b369ce1 Revert to fixed version 5 years ago
Andy Wilkinson a6f1619971 Use Asciidoctor extension to verify documented configuration properties
Closes gh-18451
5 years ago
Stephane Nicoll e0d6d90683 Merge branch '2.1.x'
Closes gh-18447
5 years ago
dreis2211 417bfc4c87 Fix comment position in ZipHeaderPeekInputStreamTests
See gh-18445
5 years ago
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
5 years ago
dreis2211 8a6e254465 Avoid need to escape pipe character in reference tables 5 years ago
Phillip Webb a13666d696 Polish "Simplify code"
See gh-18342
5 years ago
Yuyan 4d0da4b700 Simplify code
See gh-18342
5 years ago
Brian Clozel eeaa9bc6c1 Fix ref docs code snippet theme
This commit also fixes a link in the reference documentation.

See gh-18293
5 years ago
Andy Wilkinson 79b5fd9d73 Polish "Allow the user that runs the app to be specified via an env var"
See gh-16973
5 years ago
Wagner Macedo b57f35893c Allow the user that runs the app to be specified via an env var
See gh-16973
5 years ago
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
5 years ago
Andy Wilkinson 02ac089767 Polish "Support zip64 jars"
See gh-16091
5 years ago
Camille Vienot 1917e1eac5 Support zip64 jars
See gh-16091
5 years ago
Andy Wilkinson d5fc324537 Upgrade to Asciidoctor Maven Plugin 1.6.0
Closes gh-17234
5 years ago
Andy Wilkinson 7d3e53c94c Fix test expectations for run-fork JVM args on Java 13+
Closes gh-17008
5 years ago
Andy Wilkinson d2b28ceba5 Don't add -Xverify:none to JVM args when running on Java 13
Closes gh-17008
5 years ago
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
5 years ago
Johnny Lim 5b41c3b608 Polish
See gh-18192
5 years ago
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
5 years ago
Andy Wilkinson 0c0e2dd54b Merge branch '2.1.x'
Closes gh-18186
5 years ago
Andy Wilkinson 7b1e10ed00 Use one sentence per line in Actuator and Gradle plugin doc source
Closes gh-18185
5 years ago
Andy Wilkinson ff1983c9ae Merge branch '2.1.x'
Closes gh-18168
5 years ago
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
5 years ago
Andy Wilkinson fc1889ee72 Merge branch '2.1.x'
Closes gh-18167
5 years ago
dreis2211 ae30515e5e Test the Gradle Plugin against Gradle 5.6.2
See gh-18164
5 years ago
Andy Wilkinson 4b5ebd8505 Process all non-private methods, not just public methods
Previously, the configuration processor would ignore any
@ConfigurationProperties-annotated methods that were not public. This
prevented metadata generation for package-private @Bean methods such
as those in DataSourceConfiguration's inner-classes for DBCP2, Hikari,
and Tomcat JDBC.

This commit updates the annotation processor so that it will process
any non-private method annotated with @ConfigurationProperties.

Fixes gh-18124
5 years ago
Andy Wilkinson 29080b87ec Protect autoconfigure module against slow starting test containers 5 years ago
dreis2211 07b857e57a Use disabledWithoutDocker option for @Testcontainers
See gh-18095
5 years ago
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
5 years ago
Andy Wilkinson a4b8d2401f Merge branch '2.1.x'
Closes gh-18094
5 years ago
Andy Wilkinson abba4fa9c9 Include exception's message in message printed by AP
Fixes gh-17974
5 years ago
Andy Wilkinson b463acb10f Merge branch '2.1.x'
Closes gh-18093
5 years ago
Andy Wilkinson edcaee375f Consider @Deprecated on field when determining property's deprecation
Fixes gh-17550
5 years ago
dreis2211 3e35a6616c Fix duplicated words
See gh-18004
5 years ago
Andy Wilkinson 7f8b3a7b86 Test the Gradle Plugin against Gradle 5.6.1
Closes gh-17995
5 years ago
dreis2211 26a22fa523 Test the Gradle Plugin against Gradle 5.6.1
See gh-17984

Closes gh-17984
5 years ago
Stephane Nicoll b57db504df Fix broken build due to Kotlin upgrade 5 years ago
Andy Wilkinson ab87b2a39b Polish 5 years ago
thelproad 9c1f503e46 Simplify if statements
See gh-17884
5 years ago
dreis2211 d4affd7f85 Use hasSize() assertion in favor of length checks
See gh-17874
5 years ago
Andy Wilkinson a785a5b58a Test the Gradle Plugin against Gradle 5.6
Closes gh-17883
5 years ago
dreis2211 56940fca97 Test the Gradle Plugin against Gradle 5.6
See gh-17876
5 years ago
dreis2211 b605cddb10 Polish some Collections API calls
See gh-17825
5 years ago
Madhura Bhave 8a9c60a29a Merge branch '2.1.x' 5 years ago
Madhura Bhave 541d3c4853 Fix typo 5 years ago
Stephane Nicoll 07cd67a3fe Tolerate null startTime
This commit prevents a potential NPE if the startTime of the
MavenSession is not available and fallbacks to the current time. This
can happen when invoking the plugin with Maven embedded in an IDE.

Closes gh-17810
5 years ago
Stephane Nicoll 1c8f727864 Polish "Simplify if statements"
See gh-17785
5 years ago
SaberXu c6c3a91f8d Simplify if statements
See gh-17785
5 years ago
Phillip Webb 2cdceb92bf Polish 5 years ago
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
5 years ago
Stephane Nicoll 5926547767 Merge branch '2.1.x'
Closes gh-17745
5 years ago
Stephane Nicoll 0c560795fd Harmonize settings.gradle documentation in Gradle getting started guide
See gh-17736
5 years ago
Dave Syer e7b0450a7f Add missing repositories to snapshot configuration
See gh-17736
5 years ago
Stephane Nicoll f68c7a751f Polish "Escape reserved asciidoc character in generated documentation"
See gh-17663
5 years ago
vivganes b0fa58e861 Escape reserved asciidoc character in generated documentation
See gh-17663
5 years ago
Phillip Webb 8bc780762a Merge branch '2.1.x' 5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Stephane Nicoll f3a138da16 Skip Gradle Plugin test when building with JDK 13
See gh-16970
5 years ago