Commit Graph

455 Commits (6ee72ff4891475c1505695d14d615a917a8e80ac)

Author SHA1 Message Date
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 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 794ded5286 Test the Gradle plugin against Gradle 6.5.1
Closes gh-22292
4 years ago
Andy Wilkinson 79770b9615 Use source sets to determine configurations deprecated for resolution
Fixes gh-22200
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 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 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
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
Andy Wilkinson 020a47ba3e Document support for Gradle 5
Closes gh-15358
5 years ago
Phillip Webb 0a05b4c9fd Update copyright year of changed files 5 years ago
Andy Wilkinson 24138c104c Use highlightjs for syntax highlighting in Asciidoctor's HTML output
Closes gh-21701
5 years ago
Andy Wilkinson f0bc8ee73c Fix version placeholder replacement in Gradle plugin docs
Closes gh-21640
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
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 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
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
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 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
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
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 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
Phillip Webb ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
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
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 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
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
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 baa728c85e Cleanup paths to fix tests running on Windows 5 years ago
Phillip Webb b50e8eb3aa Fix package tangle in Gradle plugin
Relocate `VersionExtractor` to fix a package tangle.
5 years ago
Phillip Webb 6e7b473fef Polish asciidoc formatting and use sentence case 5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
Scott Frederick c119dd2450 Rename plugin PDF reference doc files
This commit renames the PDF documentation files generated for the
build plugins when the distribution archive is created.

See gh-20829
5 years ago
Madhura Bhave f40444e212 Fix typo 5 years ago
Andy Wilkinson 34e602652c Polish new layered jar support 5 years ago
Stephane Nicoll 3e936dd735 Polish 5 years ago
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
5 years ago
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>
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
Phillip Webb 4dad56a491 Restructure and polish docker code
Restructure and polish docker code to fix a package tangle and
provide better separation of concerns.
5 years ago
Phillip Webb 9795262dc1 Polish 5 years ago
Andy Wilkinson 84e16d55ea Raise the minimum supported version of Gradle 6 to 6.3
Closes gh-20532
5 years ago
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
5 years ago
Madhura Bhave ad164269e9 Update classpath index to use jar name instead of full path
See gh-20564
5 years ago
Stephane Nicoll 089c0471fa Test the Gradle Plugin against Gradle 6.3
Closes gh-20669
5 years ago
dreis2211 f95e9543dc Fix typos in packaging docs
See gh-20630
5 years ago
Phillip Webb 0717de723f Polish 5 years ago
Phillip Webb ce1ae11c26 Merge branch '2.2.x' 5 years ago
Phillip Webb 16b5ea3414 Update copyright year of changed files 5 years ago
Madhura Bhave 7444306d0b Polish docs 5 years ago
Madhura Bhave a06f4f21e3 Combine application and resources layers into a single layer
Closes gh-20562
5 years ago
Madhura Bhave 952e529787 Rename "classes" to "application" in custom layer configuration
Closes gh-20539
5 years ago
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
5 years ago
Stephane Nicoll 579a6ac254 Adapt tests for support for Java 14
See gh-20576
5 years ago
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
5 years ago
Stephane Nicoll 0f5ca030db Polish "Add Java 14 CI"
See gh-20413
5 years ago
Stephane Nicoll 2e2f839bc8 Upgrade to Gradle 6.3 RC2
Closes gh-20558
5 years ago
Madhura Bhave 84b2e8c308 Rename classes package to application
Closes gh-20526
5 years ago
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
5 years ago
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
5 years ago
Johnny Lim 8526e66939 Polish
See gh-20498
5 years ago
dreis2211 daa3855fc8 Test the Gradle Plugin against Gradle 6.2.2
See gh-20385
5 years ago
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
5 years ago
dreis2211 442733600e Test the Gradle plugin against Gradle 6.2.1
See gh-20310
5 years ago
Madhura Bhave c5bce2b99d Fix gradle plugin validation error 5 years ago
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
5 years ago
dreis2211 d55bc5f850 Test the Gradle Plugin against Gradle 6.2
See gh-20222
5 years ago
dreis2211 866c441d70 Upgrade to Gradle 6.2
See gh-20213
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 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