259 Commits

Author SHA1 Message Date
Stephane Nicoll
ee914624e6 Document buildpacks are configured with target Java version
Closes gh-21796
2020-08-31 16:15:30 +02:00
Stephane Nicoll
b80314b44b Document how to customize the jmxPort for Maven integration tests
Closes gh-22401
2020-08-31 10:52:47 +02:00
Phillip Webb
8fd9c685a2 Reduce HTTP debug logging when building image
Update `BuildImageMojo` so that commons HTTP wire logging is configured
to ERROR. Without this update, running `mvn -X` will produce a great
deal of logging since by default HTTP Client logs all bytes transfered
at DEBUG and Maven will enable DEBUG for all logs.

Closes gh-22674
2020-08-19 13:20:06 -07:00
Scott Frederick
005ed8b8db Use Java version wildcard in image building docs
Fixes gh-22916
2020-08-12 17:04:17 -05:00
Andy Wilkinson
181e3b34ba Isolate Maven Plugin's integration tests from repo.spring.io
Previously, the Maven plugin integration tests used a settings.xml file
that defined https://repo.spring.io/snapshot as a repository. This
allowed them to resolve snapshots of the plugin's Spring Framework
dependencies but it had the unfortunate side-effect of also allowing
them to resolve snapshots of other Spring Boot modules from Artifactory
rather than using those currently being built.

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

Closes gh-22828
2020-08-07 17:18:47 +01:00
Scott Frederick
21b2dd2740 Allow empty env entries when building an image
Prior to this commit, an entry in the environment map provided to the
build plugin image building goal or task that had a null value would
result in a failure with a message that was difficult to diagnose.

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

Fixes gh-22703
2020-08-04 15:29:29 -05:00
Andy Wilkinson
accc1f1ca8 Merge branch '2.2.x' into 2.3.x
Closes gh-22410
2020-07-20 13:58:19 +01:00
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
2020-06-16 08:50:21 +01:00
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
2020-06-15 16:08:56 -05:00
Andy Wilkinson
24138c104c Use highlightjs for syntax highlighting in Asciidoctor's HTML output
Closes gh-21701
2020-06-04 20:25:29 +01:00
Scott Frederick
07d842b51d Polish maven build image command line example 2020-05-20 16:06:48 -05:00
Andy Wilkinson
ee758fa670 Use HTTPS for license links
This commit updates the MavenPublishingConventions to use HTTPS to
link to the Apache license. The configuration of NoHTTP has also
been reworked so that it will correctly find usch uses of http://
URLs.

Closes gh-21459
2020-05-15 16:33:11 +01:00
Andy Wilkinson
a03426af57 Configure the Asciidoctor revnumber in a central location
See gh-20934
2020-05-13 08:16:59 +01:00
Madhura Bhave
376098d080 Set asciidoctor revnumber to null
Closes gh-20934
2020-05-12 14:58:38 -07:00
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
2020-05-08 17:07:51 -05:00
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
2020-05-08 17:03:47 -05:00
Kyle Hoehns
fd46002666 Fix typo for includeLayerTools
See gh-21310
2020-05-04 17:29:28 -07:00
Scott Frederick
1c11e163c7 Fix Maven plugin command-line examples
Fixes gh-21078
2020-04-30 12:19:14 -05:00
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
2020-04-29 14:28:25 -05:00
Phillip Webb
ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
2020-04-28 19:20:24 -07:00
dreis2211
5eb5bf0a2d Polish
See gh-21009
2020-04-25 08:54:47 +02:00
Stephane Nicoll
1c70b6735a Remove plugin management for exec-maven-plugin
Closes gh-20883
2020-04-08 17:51:22 +02:00
Phillip Webb
3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Scott Frederick
a64e26fc44 Polish plugin documentation headings 2020-04-07 08:53:37 -05:00
Phillip Webb
6e7b473fef Polish asciidoc formatting and use sentence case 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
Scott Frederick
bb568c5bff Consolidate Maven plugin documentation in plugin reference
This commit moves Maven plugin content from several sections in the
main Spring Boot reference documentation to the plugin-specific
documentation.

Fixes gh-19165
2020-04-03 16:41:12 -05:00
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
2020-04-03 15:50:23 -05:00
Madhura Bhave
f40444e212 Fix typo 2020-04-03 12:30:46 -07:00
Stephane Nicoll
c88ef6215f Polish 2020-04-03 10:34:23 +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
Madhura Bhave
4e3cdf936f Support flat jar layering with Maven
Update the Maven 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
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
9795262dc1 Polish 2020-04-01 11:20:56 -07: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
Stephane Nicoll
6aa3461611 Version layers configuration xsd
This commit provides a versioned xsd for the layers configuration of the
Maven plugin. The version starts at `2.3` to match with the Spring Boot
feature release in which this was introduced.

Closes gh-20663
2020-03-24 15:55:30 +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
9a33a723fe Update copyright year of changed files 2020-03-23 14:15:08 -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
Stephane Nicoll
0b7f198b54 Publish Maven plugin API
This commit enables javadoc generator for the Spring Boot Maven plugin.

This also harmonizes the structure of the documentation, with an `/api`
and a `/reference` root directories for the javadoc and the reference
guide respectively.

Closes gh-20127
2020-03-19 14:00:58 +01:00
Scott Frederick
44f7508825 Fix BuildImageMojo javadoc. 2020-03-17 19:12:47 -05:00
Scott Frederick
08e96427de Add command-line properties for Maven build-image options
This commit adds support for setting the image name and builder
parameters of the Maven spring-boot:build-image goal using command-line
properties as an alternative to plugin configuration in pom.xml. Per
Maven conventions, a value in pom.xml configuration will override a
command-line property when both are provided.

Fixes gh-20520
2020-03-17 18:40:37 -05:00
Madhura Bhave
fb8b531bfd Polish 2020-03-16 17:45:56 -07:00
Madhura Bhave
84b2e8c308 Rename classes package to application
Closes gh-20526
2020-03-16 16:03:29 -07:00