Commit Graph

474 Commits

Author SHA1 Message Date
Stephane Nicoll b6fc0913cf Merge branch '2.3.x'
Closes gh-24104
2020-11-10 17:44:05 +01:00
Stephane Nicoll 515b18e142 Merge branch '2.3.x'
Closes gh-24108
2020-11-10 17:10:26 +01:00
Stephane Nicoll 33d83ebc94 Merge branch '2.3.x' 2020-11-09 14:41:03 +01:00
Stephane Nicoll 6aca0275ad Polish 2020-11-09 14:40:44 +01:00
Scott Frederick f080bb6c25 Fix test that depended on snapshot version
A test case would fail to accurately capture the contents
of the layers.idx file unless the test project contained
at least one non-project snapshot dependency, which was only
true when the Spring Boot version was a snapshot.

See gh-23463
2020-10-29 19:40:13 -05:00
Phillip Webb a41ff4dfab Merge branch '2.3.x' 2020-10-29 09:07:57 -07:00
Phillip Webb b0c2687aa9 Update copyright year of changed files 2020-10-29 09:07:42 -07:00
Phillip Webb b39d1910bc Fix test failure caused by MavenBuild upgrades
See gh-23937
2020-10-28 14:07:27 -07:00
Phillip Webb d43760ba5a Merge branch '2.3.x'
Closes gh-23938
2020-10-28 12:39:08 -07:00
Phillip Webb d79c23ef89 Upgrade MavenBuild versions
Align versions with those in the main build.

Closes gh-23937
2020-10-28 12:37:30 -07:00
Sebastian Nohn b3c4d5fe5c Upgrade to Log4j 2.13.3 in Maven tests
See gh-23935
2020-10-28 12:15:33 -07:00
Stephane Nicoll 472c563451 Merge branch '2.3.x'
Closes gh-23931
2020-10-28 16:20:22 +01:00
Stephane Nicoll 0424689aee Merge branch '2.2.x' into 2.3.x
Closes gh-23930
2020-10-28 16:18:00 +01:00
Stephane Nicoll 93e36a97ab Remove version elements from Maven plugin documentation
This commit removes `<version>` from the Maven Plugin documentation
where it makes sense so that versions aren't hardcoded unnecessarily.

Rather, a plugin or dependency management should be in place so those
are not needed.

Closes gh-23909
2020-10-28 13:39:03 +01:00
Stephane Nicoll a3818d690e Fix custom layout example so that tokens are replaced 2020-10-28 13:37:59 +01:00
Stephane Nicoll 59bcbd4885 Polish "Allow overriding image.cleanCache from the command-line"
See gh-32719
2020-10-26 10:44:57 +01:00
Kedar Joshi c2a483a78f Allow overriding image.cleanCache from the command-line
See gh-32719
2020-10-26 10:44:57 +01:00
Andy Wilkinson 3bfe1b00b5 Put module deps in app layer and make customization easier
Previously, when building a layered jar with Maven, dependencies
on modules in the same build were treated the same as any other
dependency, being included in the dependencies or snapshot dependencies
layer based on their version.

This commit updates the default layering when using Maven to include
dependencies on modules in the same build in the application layer by
default. The XML schema has also been updated to allow the layer to be
customized using new <includeModuleDependencies/> and
<excludeModuleDependencies/> elements rather than relying on including
and excluding them via a group:artifact:version pattern.

Closes gh-23463
2020-10-22 16:05:15 +01:00
Scott Frederick 38b1954ab1 Polish Maven plugin javadoc
This commit polishes the javadoc for Maven plugin classes now that
the plugin reference docs link to the javadoc. Visibility of some
MOJO parameter class getters and setters were also changed for
consistency.

See gh-21555
2020-10-19 15:38:02 -05:00
Scott Frederick d44ecf5086 Merge branch '2.3.x'
Closes gh-23731
2020-10-16 18:00:09 -05:00
Scott Frederick 9c672deb2d Add javadoc links in Maven plugin parameter docs
This commit modifies the documentation generated for the
Maven plugin to include links to javadoc when Spring
Boot types are mentioned. Some javadoc was also polished
to improve the generated docs.

Fixes gh-21555
2020-10-16 17:45:46 -05:00
Stephane Nicoll 2916bb4c10 Merge branch '2.3.x'
Closes gh-23718
2020-10-16 11:00:31 +02:00
Stephane Nicoll 6beb0c939f Document how to override plugin configuration on the command line
Closes gh-21536
2020-10-16 10:57:30 +02:00
Stephane Nicoll b210d0680a Polish 2020-10-16 10:34:58 +02:00
Johnny Lim 4a26e11268 Polish
See gh-23634

Closes gh-23634
2020-10-13 12:44:00 -07:00
Scott Frederick 0e7ab88491 Polish "Update default builder image"
See gh-23628
2020-10-12 17:07:33 -05:00
Emily Casey 461dc23c0c Update default builder image
This commit updates the default builder image used by the Maven
and Gradle plugins image-building goal and task to use the latest
Paketo builder image. The builder image is pulled from Docker Hub
instead of Google Container Registry by default.

See gh-23628
2020-10-12 17:06:42 -05:00
dreis2211 36812bf199 Fix XML tag in image publishing example
See gh-23632
2020-10-11 15:52:46 +02:00
Scott Frederick f2721abf31 Merge branch '2.3.x'
Closes gh-23626
2020-10-09 13:22:00 -05:00
Scott Frederick de685bdca4 Document buildpack configuration of JVM options
Fixes gh-21582
2020-10-09 13:21:37 -05:00
Scott Frederick a099cd9420 Merge branch '2.3.x'
Closes gh-23623
2020-10-08 17:03:24 -05:00
Scott Frederick 49b0707f1a Clarify image builder configuration documentation
This commit qualifies examples of configuring the CNB builder to clarify
that the examples apply to use of the default Paketo builder, and adds links
to the official Paketo docs for more details.

Fixes gh-19967
2020-10-08 17:02:17 -05:00
Scott Frederick 91acd957b2 Disable docker registry integration tests
A docker registry running in testcontainers behaves
differently in CI vs running locally. Disabling the tests for
now while working on getting them running reliably in CI.

See gh-21001
2020-10-07 18:18:21 -05:00
Scott Frederick 09b627d232 Add support for publishing docker images to a registry
This commit adds options to the Maven and Gradle plugins to publish
to a Docker registry the image generated by the image-building goal
and task.

The Docker registry auth configuration added in an earlier commit
was modified to accept separate auth configs for the builder/run
image and the generated image, since it is likely these images will
be stored in separate registries or repositories with distinct
auth required for each.

Fixes gh-21001
2020-10-07 16:51:33 -05:00
Stephane Nicoll 9ff946bafa Remove unnecessary stubbing 2020-09-30 16:13:43 +02:00
Andy Wilkinson f4ce77fcae Merge branch '2.3.x'
Closes gh-23541
2020-09-30 14:58:26 +01:00
Andy Wilkinson bd4934b0fd Fix matching of SNAPSHOT artifacts when customizing layers
Previously the artifact's version was used. In an artifact's version,
SNAPSHOT is replaced with the timestamped version number of a specific
snapshot. As a result, it no longer matches the *:*:*SNAPSHOT pattern.

This commit replaces switches to using the artifact's base version.
This preserves the SNAPSHOT in the version number. For non-snapshot
artifacts, the version and base version are identical.

Fixes gh-23533
2020-09-30 14:48:04 +01:00
Scott Frederick 54288678d1 Configure Docker host in build plugins
This commit adds the ability to configure the Maven and Gradle
plugins to use a remote Docker daemon using build file
configuration, as an alternative to setting environment variables
to specify remote host connection details.

Fixes gh-23400
2020-09-18 13:51:20 -05:00
Andy Wilkinson d2fae6e19e Merge branch '2.3.x'
Closes gh-23407
2020-09-18 09:09:53 +01:00
Andy Wilkinson 3861ef13fb Merge branch '2.2.x' into 2.3.x
Closes gh-23406
2020-09-18 09:09:41 +01:00
Phillip Webb c284edde67 Update copyright year of changed files 2020-09-17 00:31:01 -07:00
Scott Frederick 86fa8144f5 Polish "Support authentication to private Docker registry"
See gh-22972
2020-09-16 16:04:21 -05:00
姜为 e8f555e13d Support authentication to private docker registry
This commit adds the ability to configure Docker image registry
authentication credentials in the Maven and Gradle plugins. The
authentication credentials are passed to the Docker daemon with
all daemon API calls, and the daemon forwards the credentials to the
image registry when necessary. This makes it possible to use
builder and run images stored in a private Docker registry.

See gh-22972
2020-09-16 16:03:40 -05:00
Stephane Nicoll f03ed3b2a7 Publish single page doc to /htmlsingle consistently
Closes gh-21585
2020-09-11 16:05:57 +02:00
Andy Wilkinson e743d5fe66 Exclude by jar type when running and packaging with Maven
This commit updates the Maven Plugin to filter dependencies based on
the Spring-Boot-Jar-Type entry in their manifest. Jars with a
Spring-Boot-Jar-Type of dependencies-starter or annotation-processor
are excluded.

See gh-22036
2020-09-10 14:38:19 +01:00
Stephane Nicoll defa7c47cd Merge branch '2.3.x'
Closes gh-23201
2020-09-07 12:42:48 +02:00
Stephane Nicoll 648789ef84 Document that buildpacks use non-root users
Closes gh-21122
2020-09-07 12:41:51 +02:00
Stephane Nicoll cc5f2537b1 Merge branch '2.3.x'
Closes gh-23148
2020-08-31 16:16:16 +02:00
Stephane Nicoll ee914624e6 Document buildpacks are configured with target Java version
Closes gh-21796
2020-08-31 16:15:30 +02:00
Stephane Nicoll e0b41f8192 Merge branch '2.3.x'
Closes gh-23143
2020-08-31 10:53:10 +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 c302b72083 Merge branch '2.3.x'
Closes gh-23015
2020-08-19 13:24:10 -07: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 092bbd198e Merge branch '2.3.x'
Closes gh-22923
2020-08-12 17:04:54 -05:00
Scott Frederick 005ed8b8db Use Java version wildcard in image building docs
Fixes gh-22916
2020-08-12 17:04:17 -05:00
Scott Frederick 6b15822cb1 Polish "Add pullPolicy option for image building"
See gh-22736
2020-08-12 15:16:38 -05:00
anshlykov c7449b57ce Add pullPolicy option for image building
This commit adds a pullPolicy option to the configuration of the Maven
plugin spring-boot:build-image goal and the Gradle plugin bootBuildImage
task. The new option gives users control over pulling the builder image
and run image from a remote image registry to the local Docker daemon.

See gh-22736
2020-08-12 15:16:38 -05:00
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
2020-08-10 15:22:03 +01:00
Andy Wilkinson e240c180f3 Merge branch '2.3.x'
Closes gh-22831
2020-08-07 17:19:03 +01: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 f247fec310 Merge branch '2.3.x'
Closes gh-22735
2020-08-04 15:30:17 -05: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
Madhura Bhave 41f5ba9077 Switch layering on by default
Closes gh-20983
2020-08-03 17:04:20 -07:00
Andy Wilkinson 1a43cd1c8e Merge branch '2.1.x' into 2.2.x
Closes gh-22551
2020-07-24 14:28:11 +01:00
Nelson Osacky 0494007893 Disable extra scans for full profile.
The extra scans were not disabled for the full profile, only the
regular profile.

See gh-22550
2020-07-24 14:27:32 +01:00
Andy Wilkinson f4508b4059 Merge branch '2.1.x' into 2.2.x
Closes gh-22547
2020-07-24 11:54:12 +01:00
Nelson Osacky e41a53cf85 Add Gradle Enterprise Extension
This adds build caching and build scans.

The changes required disabling scans when using the maven invoker
plugin in order to not cause duplicate build scans when invoking other
maven builds. There is also an empty `.mvn` folder in the
spring-boot-starters project to prevent duplicate build scans as well
since there is no way to pass properties to the maven-javadoc-plugin.

The checkstyle plugin was causing a cache miss with the
`propertyExpansion` because it contains an absolute path. The absolute
path is now ignored and instead the files are added as inputs to the
checkstyle plugin. This only enables the local build cache. The remote
cache is not yet enabled.

On my local machine:

./mvnw clean install build times go from about 30 minutes to about 10 minutes.
./mvnw clean install -Pfull build times go from about 60 minutes to about 13 minutes.

See gh-22089
2020-07-24 11:47:24 +01:00
Andy Wilkinson 19ad163486 Merge branch '2.3.x'
Closes gh-22411
2020-07-20 13:58:40 +01: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 5e7917e33a Upgrade to Maven Shade Plugin 3.2.4
Closes gh-22074
2020-06-23 12:20:53 +01:00
Andy Wilkinson 9e08490522 Merge branch 'gh-21271'
Closes gh-21271
2020-06-16 12:52:17 +01:00
Andy Wilkinson c64649a6d9 Enable unchecked compilation warnings
See gh-21271
2020-06-16 12:50:44 +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
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
Andy Wilkinson c4a55a5fb4 Fail fast when attempting to repackage a reproducible war
Maven's war plugin does not support reproducible builds, resulting in
the entries in the war file not being written in a consistent order
from build to build.

Closes gh-20176
2020-03-16 20:29:37 +00:00
Andy Wilkinson ca202ad59f Support Maven's outputTimestamp when repackaging jars and wars
Closes gh-20176
2020-03-16 17:19:52 +00:00
Madhura Bhave e49e62df5c Add support for customizing layers in Maven
This commit adds an additional 'layers/configuration' property that can
be used to refer to a separate layers configuration file. This separate
file defines:

* The layers and their order of precedence,
* How libraries are handled using filters that match against the
coordinates of each library, and
* How classes are handled using filters that match against the location
of the entry

An XSD to validate the XML configuration file is available.

Closes gh-20295

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
2020-03-12 14:50:08 +01:00
Scott Frederick e60a7ea8d6 Fix Maven plugins tests on Windows
This commit fixes problems with file path separators and command
line argument quoting in Maven plug integration tests when run on
Windows.

Fixes gh-20244
2020-02-26 16:50:15 -06: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
Stephane Nicoll c0c097117a Polish
See gh-20244
2020-02-21 09:27:00 +01:00
Scott Frederick 23e781033c Merge branch '2.2.x'
Closes gh-20244
2020-02-20 14:43:55 -06:00
Scott Frederick 625b40aa90 Prefer arguments in POM over spring-boot.run.arguments
This commit changes the order of precedence for the `arguments` property
of the AbstractRunMojo so that values specified in the POM override
values provided on the command line using `spring-boot.run.arguments`.
This brings the `arguments` property in line with all other Mojo
parameters.

Fixes gh-20024
2020-02-20 13:09:20 -06: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
Johnny Lim 8be8a8421d Polish
See gh-20226
2020-02-19 09:34:46 +01:00
dreis2211 76d2bc27eb Explicitly set java home in Maven Plugin integration tests
See gh-20193
2020-02-18 12:05:43 +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
Stephane Nicoll 3229142188 Merge branch '2.2.x'
Closes gh-20121
2020-02-11 13:50:54 +01:00
Stephane Nicoll 765b2178d1 Document spring-boot.run.arguments behaviour with multiple arguments
Closes gh-19998
2020-02-11 13:39:10 +01: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 e6d5f5a271 Polish
See gh-19995
2020-02-01 09:24:20 +01: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 54b3f480b4 Use posix long names when creating tar archive for image building
Fixes gh-19964
2020-01-30 13:31:27 +00: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 0bd03fa278 Fix xml syntax in example
Closes gh-19906
2020-01-24 16:01:44 +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
Stephane Nicoll 105db66553 Polish 2020-01-23 14:04:19 +01: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 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
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
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
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
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
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
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
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
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +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 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
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
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
Alessandro Falappa 2c199b1296 Make optimizedLaunch property name more consistent
See gh-18702
2019-10-23 18:24:33 +02:00
Kant Leung 2f73e196af Polish
See gh-18534
2019-10-08 07:38:21 -05: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 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
dreis2211 d4affd7f85 Use hasSize() assertion in favor of length checks
See gh-17874
2019-08-17 06:39:41 +02:00
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
2019-08-08 17:32:04 +02:00
SaberXu c6c3a91f8d Simplify if statements
See gh-17785
2019-08-08 14:32:37 +02:00
Phillip Webb 8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Johnny Lim 8f8b0b493e Remove println invocations in tests
See gh-17592
2019-07-21 18:26:26 +02:00
Stephane Nicoll 4ce9c6edb3 Polish "Make layout parameter available as a user property"
See gh-17277
2019-07-18 18:20:06 +02:00
Marc Rohlfs d2e34e6b07 Make layout parameter available as a user property
This commit allows the layout parameter of the Maven repackage goal to
be set from the command line.

See gh-17277
2019-07-18 18:20:06 +02:00
Phillip Webb 74d00354f5 Refine BuildInfoMojo time property
Update `BuildInfoMojo` so that the time property now defaults to
`${session.request.startTime}` rather than the time the Mojo was
created. Also update javadoc to make it clear that any supplied
value will be passed to `Instant.parse`.

See gh-17390
2019-07-16 13:51:03 +01:00
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Dmytro Nosan 8dd9c6baa1 Allow build.time to be disabled so BuildInfoMojo's output is repeatable
See gh-17390
2019-07-10 13:40:17 +01:00
Andy Wilkinson 4b2a116fa7 Use String indexOf(char) and lastIndexOf(char) where possible
Closes gh-11416
2019-07-04 17:44:40 +01:00
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Phillip Webb 605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Andy Wilkinson 361a9404fd Merge branch '2.1.x'
Closes gh-17321
2019-06-26 17:40:44 +01:00
Andy Wilkinson 3fb06ee29e Merge branch '2.0.x' into 2.1.x
Closes gh-17320
2019-06-26 17:39:13 +01:00
Andy Wilkinson 4973a2b217 Merge branch '1.5.x' into 2.0.x 2019-06-26 17:37:39 +01:00
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
gaurav bhatnagar 1ec5fb9972 Drop deprecated 'spring.version' POM property
See gh-17043
2019-06-13 08:59:00 -07:00
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00