Commit Graph

363 Commits

Author SHA1 Message Date
Stephane Nicoll 85e9f713b0 Update copyright year of changed files
See gh-21007
2020-04-25 08:50:51 +02:00
Johnny Lim 29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Andy Wilkinson 076a384c9c Merge branch '2.2.x'
Closes gh-21112
2020-04-24 18:10:00 +01:00
Andy Wilkinson 29dc236bb2 Broaden deprecation warning check in Gradle Plugin's tests
Closes gh-21111
2020-04-24 17:45:42 +01:00
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
2020-04-23 16:05:32 -05:00
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
2020-04-17 17:33:28 -05:00
Johnny Lim 5fad43ec40 Polish
See gh-20973
2020-04-16 13:46:53 +02:00
Phillip Webb d9fb4dd477 Don't use monospacing in documentation headings
Closes gh-20875
2020-04-07 11:08:57 -07:00
Scott Frederick e17d4be484 Polish plugin documentation headings 2020-04-07 09:17:51 -05:00
Scott Frederick a64e26fc44 Polish plugin documentation headings 2020-04-07 08:53:37 -05:00
Phillip Webb baa728c85e Cleanup paths to fix tests running on Windows 2020-04-06 20:17:16 -07:00
Phillip Webb b50e8eb3aa Fix package tangle in Gradle plugin
Relocate `VersionExtractor` to fix a package tangle.
2020-04-06 19:18:22 -07:00
Phillip Webb 6e7b473fef Polish asciidoc formatting and use sentence case 2020-04-06 19:18:22 -07:00
Phillip Webb df58b9baa2 Use YAML compatible classpath.idx format
Update the `classpath.idx` format to align with `layers.idx` and allow
third-parties can parse it as YAML

Closes gh-20861
2020-04-06 19:18:22 -07:00
Phillip Webb 65672a1150 Use a more compact layers.idx format
Update the `layers.idx` format so that it is more compact and can be
parsed by third-parties as YAML.

Closes gh-20860
2020-04-06 19:18:22 -07:00
Scott Frederick 35ff711dfe Document builder configuration for HTTP proxy
This commit adds examples for configuring the default builder to use
an HTTP/HTTPS proxy when building OCI images using the Maven or Gradle
plugin.

Fixes gh-19984
2020-04-06 18:20:34 -05:00
Madhura Bhave f40444e212 Fix typo 2020-04-03 12:30:46 -07:00
Andy Wilkinson 34e602652c Polish new layered jar support 2020-04-03 10:47:57 +01:00
Stephane Nicoll 3e936dd735 Polish 2020-04-03 10:36:06 +02:00
Phillip Webb 12bc890e75 Update Maven and Gradle layer customization docs
Update the Maven and Gradle documentation following the refined
layer customization changes.

See gh-20526
2020-04-03 00:34:27 -07:00
Andy Wilkinson bfa04e6574 Support flat jar layering with Gradle
Update the Gralde plugin so that layered jars now use the regular "flat"
format. The layers.idx file now describes which layer each file should
be placed.

See gh-20813

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

Closes gh-20529
2020-04-03 00:09:30 -07:00
Phillip Webb 7bc7d86ad4 Refine layer customization for Maven and Gradle
Simplify layer customization logic for both Maven and Gradle and
refactor some internals of the Gradle plugin.

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

Closes gh-20526
2020-04-03 00:03:21 -07:00
Scott Frederick a01c8452cb Support CNB builder platform API 0.3
This commit adds support for Cloud Native Buildpacks builder platform
API 0.3, which is the latest platform API available currently. Support
for platform API 0.1 has been removed, adopting the policy of the pack
CLI to support the current platform API version and one version prior.

Fixes gh-20757
2020-04-01 17:18:46 -05:00
Scott Frederick bb9e37e119 Use platform API builder image tags
CNB builder images are now being tagged in a manner that indicates
the version of the platform API implemented. This allows Spring Boot
to default to a builder tag that guarantees API compatibility while
allowing for updates to bundled buildpacks.

Fixes gh-20171
2020-04-01 16:18:05 -05:00
Phillip Webb 4dad56a491 Restructure and polish docker code
Restructure and polish docker code to fix a package tangle and
provide better separation of concerns.
2020-04-01 11:51:33 -07:00
Phillip Webb 9795262dc1 Polish 2020-04-01 11:20:56 -07:00
Andy Wilkinson 84e16d55ea Raise the minimum supported version of Gradle 6 to 6.3
Closes gh-20532
2020-03-31 19:48:17 +01:00
Scott Frederick ac949d7851 Document remote Docker configuration
This commit adds documentation for the configuration required to
use a remote Docker daemon with the `build-image` Maven goal or the
`bootBuildImage` Gradle task.

See gh-20538
2020-03-31 13:37:55 -05:00
Madhura Bhave ad164269e9 Update classpath index to use jar name instead of full path
See gh-20564
2020-03-25 10:46:59 -07:00
Stephane Nicoll 089c0471fa Test the Gradle Plugin against Gradle 6.3
Closes gh-20669
2020-03-25 09:57:04 +01:00
dreis2211 f95e9543dc Fix typos in packaging docs
See gh-20630
2020-03-24 07:44:26 +01:00
Phillip Webb 0717de723f Polish 2020-03-23 20:03:44 -07:00
Phillip Webb ce1ae11c26 Merge branch '2.2.x' 2020-03-23 14:14:47 -07:00
Phillip Webb 16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
Madhura Bhave 7444306d0b Polish docs 2020-03-23 13:01:16 -07:00
Madhura Bhave a06f4f21e3 Combine application and resources layers into a single layer
Closes gh-20562
2020-03-23 12:59:42 -07:00
Madhura Bhave 952e529787 Rename "classes" to "application" in custom layer configuration
Closes gh-20539
2020-03-23 10:44:03 -07:00
Scott Frederick 3f378e1276 Add command-line options for Gradle bootBuildImage parameters
This commit adds support for setting the image name and builder
parameters of the Gradle bootBuildImage task using command-line
options as an alternative to DSL configuration.

See gh-20520
2020-03-19 17:21:07 -05:00
Scott Frederick e607c6842f Polish Gradle layer configuration DSL
This commit modifies the DSL for custom layer configuration in the
Gradle plugin to avoid duplication of terms that could be confusing.

Fixes gh-20563
2020-03-18 16:21:40 -05:00
Stephane Nicoll 0f5ca030db Polish "Add Java 14 CI"
See gh-20413
2020-03-18 15:09:14 +01:00
Stephane Nicoll 2e2f839bc8 Upgrade to Gradle 6.3 RC2
Closes gh-20558
2020-03-18 14:29:15 +01:00
Madhura Bhave 84b2e8c308 Rename classes package to application
Closes gh-20526
2020-03-16 16:03:29 -07:00
Scott Frederick 3dea2201c4 Use Gradle's configuration avoidance API
Register Boot Gradle tasks instead of creating them so they can be
loaded lazily.

Closes gh-18881
2020-03-16 17:49:34 -05:00
Scott Frederick f2dadf5a87 Add support for customizing layers in Gradle
This commit adds configuration to the Spring Boot Gradle plugin that
allows the names and contents of layers to be customized in the build
configuration.

Fixes gh-20296
2020-03-16 17:27:32 -05:00
Johnny Lim 8526e66939 Polish
See gh-20498
2020-03-11 12:17:58 +01:00
dreis2211 daa3855fc8 Test the Gradle Plugin against Gradle 6.2.2
See gh-20385
2020-03-04 14:56:20 +01:00
Scott Frederick 509a1f1d41 Configure buildpack to use target Java version
With this commit, the Maven `spring-boot:build-image` goal and the
Gradle `bootBuildImage` task will configure the OpenJDK buildpack
to use the same JRE version as the project's target version,
provided the buildpack Java version is not explicitly set in the
build configuration.

Fixes gh-20172
2020-02-25 15:11:42 -06:00
dreis2211 442733600e Test the Gradle plugin against Gradle 6.2.1
See gh-20310
2020-02-25 05:52:00 -05:00
Madhura Bhave c5bce2b99d Fix gradle plugin validation error 2020-02-19 19:15:13 -08:00
Madhura Bhave 15cd590f7f Allow users to opt out of including the layer tools in a layered jar
For Maven, the layer configuration is now an additional configuration
option instead of a layout type.

Closes gh-19866
2020-02-19 17:28:27 -08:00
dreis2211 d55bc5f850 Test the Gradle Plugin against Gradle 6.2
See gh-20222
2020-02-19 09:26:54 +01:00
dreis2211 866c441d70 Upgrade to Gradle 6.2
See gh-20213
2020-02-18 14:39:10 +00:00
Andy Wilkinson e065ee7be2 Merge branch '2.1.x' into 2.2.x
Closes gh-20183
2020-02-14 14:47:03 +00:00
Andy Wilkinson b9c2d775a9 Merge branch '2.2.x'
Closes gh-20185
2020-02-14 14:43:46 +00:00
Andy Wilkinson d61b035640 Merge branch '2.1.x' into 2.2.x
Closes gh-20183
2020-02-14 13:54:23 +00:00
Andy Wilkinson c8907d46b4 Fix up-to-date checking of build info properties
Closes gh-20135
2020-02-14 11:56:19 +00:00
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
2020-02-12 13:31:21 -06:00
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
Johnny Lim 6818279751 Fix typo
See gh-20049
2020-02-06 16:39:25 +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 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
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 54b3f480b4 Use posix long names when creating tar archive for image building
Fixes gh-19964
2020-01-30 13:31:27 +00: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
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
dreis2211 d75de39456 Upgrade to JUnit Jupiter 5.6.0
See gh-19907
2020-01-26 08:39:12 +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 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
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
Phillip Webb 57db621b70 Polish 2020-01-22 23:06:58 -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
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 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 9d5975bd09 Upgrade to Gradle 6.1
Closes gh-19772
2020-01-16 10:00:45 +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
dreis2211 d454c9653c Disable tests on Java 13 that require an incompatible Gradle version
See gh-19680
2020-01-13 16:51:55 +00: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 ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +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 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 347434ba81 Test the Gradle Plugin against Gradle 6.0.1
See gh-19065
2019-11-21 13:44:55 +01: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
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