Commit Graph

1460 Commits (7b39cfb06133c287994483c3ab90fc521a8217a4)

Author SHA1 Message Date
Scott Frederick da2276e7d4 Use stable builder and run images in integration tests
Fixes gh-24183
4 years ago
Scott Frederick 59e0f7317e Avoid image pulls in integration tests
This commit sets the pull policy to `IF_NOT_PRESENT` where possible
in integration tests for the Maven and Gradle plugins to reduce
the number of times the default Paketo builder and run images are
pulled from Docker Hub.

Fixes gh-24113
4 years ago
Andy Wilkinson 21d97524d8 Merge branch '2.3.x'
Closes gh-24112
4 years ago
Andy Wilkinson e6ab20b029 Merge branch '2.2.x' into 2.3.x
Closes gh-24111
4 years ago
Andy Wilkinson 31042bfc49 Test inclusion of system scope dependencies in repackaged war
Closes gh-22503
4 years ago
Stephane Nicoll b6fc0913cf Merge branch '2.3.x'
Closes gh-24104
4 years ago
Stephane Nicoll 515b18e142 Merge branch '2.3.x'
Closes gh-24108
4 years ago
Stephane Nicoll 9e901b6e07 Upgrade to Testcontainers 1.15.0
Closes gh-24103
4 years ago
Stephane Nicoll 23ad2b4156 Rationalize Testcontainers image versions
This commit rationalizes the Docker image names used in integration
tests.

Closes gh-24107
4 years ago
Stephane Nicoll 45f1133e1e Merge branch '2.3.x' 4 years ago
Stephane Nicoll 339c8d0a26 Revert "Upgrade to Testcontainers 1.15.0" 4 years ago
Stephane Nicoll 5123eb0c74 Fix deprecation in Testcontainers 1.15.0
See gh-24103
4 years ago
Stephane Nicoll 7fb21fbff3 Merge branch '2.3.x'
Closes gh-24104
4 years ago
Stephane Nicoll c1a1b5fe71 Upgrade to Testcontainers 1.15.0
Closes gh-24103
4 years ago
Stephane Nicoll 33d83ebc94 Merge branch '2.3.x' 4 years ago
Stephane Nicoll 6aca0275ad Polish 4 years ago
Andy Wilkinson 409e3ccecf Ignore resolution of copied configuration
When a Configuration is copied, any before and after resolve actions
that are registered with its ResolvableDependencies are also copied
over. This means that, when a copied configuration is resolved the
resolution actions may be called on a ResolvableDependencies instances
that isn't the one to which they were added.

Previously, the above-described Gradle behaviour would result in
BootJar accessed the ResolvedConfiguration of a Configuration that may
not have yet been resolved. At best this would trigger Configuration
resolution and at worst it would fail. A failure could occur if the
configuration had been copied so that it could be made resolvable.
The afterResolve action would then try to access the
ResolvedConfiguration of the original Configuration. This would trigger
a resolution attempt that fails due to the original configuration being
marked as unresolvable.

This commit updates the afterResolve action in BootJar to check that
the ResolvableDependencies with which it is called matches the
ResolvableDependencies with which it was original registered. Only
when the two match, and therefore the configuration has actually been
resolved, does processing proceed.

Fixes gh-24072
4 years ago
Stephane Nicoll 946be4eab6 Merge branch '2.3.x'
Closes gh-24059
4 years ago
Stephane Nicoll 4a8646bd09 Merge branch '2.2.x' into 2.3.x
Closes gh-24058
4 years ago
Stephane Nicoll 59ea7c11f6 Use most specific getter when generating metadata
This commit makes sure to use the most specific getter if more than
one candidate exists.

Closes gh-24002
4 years ago
Andy Wilkinson bbad377ecc Merge branch '2.3.x'
Closes gh-24017
4 years ago
Andy Wilkinson f3d4b3e5ac Allow entries to be streamed from JarURLConnections' jar file
Fixes gh-23821
4 years ago
izeye 9c35cd41ad Polish
See gh-23986
4 years ago
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
4 years ago
Phillip Webb a41ff4dfab Merge branch '2.3.x' 4 years ago
Phillip Webb b0c2687aa9 Update copyright year of changed files 4 years ago
Andy Wilkinson 5642dc6d13 Merge branch '2.3.x'
Closes gh-23970
4 years ago
Andy Wilkinson 70d9602b3f Merge branch '2.2.x' into 2.3.x
Closes gh-23969
4 years ago
Andy Wilkinson e7eb7739dc Use overriding rather than overridden getter methods in config prop AP
Fixes gh-23966
4 years ago
Phillip Webb 74e06e8e6a Refine MetadataCollector logic
Update `MetadataCollector` merge logic so that previous items are no
longer added if the current round contains a property of the same name.

Fixes gh-23916
4 years ago
Phillip Webb 23e5fd798c Merge branch '2.3.x'
Closes gh-23960
4 years ago
Phillip Webb b86dcbec72 Merge branch '2.2.x' into 2.3.x
Closes gh-23959
4 years ago
Phillip Webb cf09451ffb Retain inner-class data on incremental compile
Ensure that metadata sourced from inner-types is not deleted when
performing an incremental compile. Prior to this commit, the source
type was searched using the `Outer$Inner` format. This is not supported
`Elements.getTypeElement` so we now convert the names to `Outer.Inner`.

Closes gh-10886
4 years ago
Scott Frederick 04a40a4c68 Provide content-length header to Docker API calls
Docker daemon authorization plugins reject POST or PUT requests that have a
content type `application/json` header but no content length header. This
commit ensures that a content length header is provided in these cases.

This is a cherry-pick of the changes in d5b2836ec9
which were lost in a forward-merge.

Fixes gh-23957
4 years ago
Phillip Webb b39d1910bc Fix test failure caused by MavenBuild upgrades
See gh-23937
4 years ago
Scott Frederick d5b2836ec9 Provide content-length header to Docker API calls
Docker daemon authorization plugins reject POST or PUT requests that have a
content type `application/json` header but no content length header. This
commit ensures that a content length header is provided in these cases.

Fixes gh-22840
4 years ago
Phillip Webb d43760ba5a Merge branch '2.3.x'
Closes gh-23938
4 years ago
Phillip Webb d79c23ef89 Upgrade MavenBuild versions
Align versions with those in the main build.

Closes gh-23937
4 years ago
Sebastian Nohn b3c4d5fe5c Upgrade to Log4j 2.13.3 in Maven tests
See gh-23935
4 years ago
Stephane Nicoll 472c563451 Merge branch '2.3.x'
Closes gh-23931
4 years ago
Stephane Nicoll 0424689aee Merge branch '2.2.x' into 2.3.x
Closes gh-23930
4 years ago
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
4 years ago
Stephane Nicoll a3818d690e Fix custom layout example so that tokens are replaced 4 years ago
Stephane Nicoll 59bcbd4885 Polish "Allow overriding image.cleanCache from the command-line"
See gh-32719
4 years ago
Kedar Joshi c2a483a78f Allow overriding image.cleanCache from the command-line
See gh-32719
4 years ago
Andy Wilkinson c85cc33ca9 Fix main class resolution failure when loaded from config cache
See gh-22922
4 years ago
Andy Wilkinson 7cbcd42eba Adapt test to cope with increased Instant precision on Java 11
See gh-22922
4 years ago
Andy Wilkinson 4a4fec6310 Avoid calling getProject() during BootBuildImage's execution
See gh-22922
4 years ago
Andy Wilkinson c409d50c14 Document support for Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson 806464edd1 Update BootBuildImage to support Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson b1c4af4081 Update bootJar and bootWar to use new main class resolution mechanism
See gh-22922
4 years ago
Andy Wilkinson c078a48064 Update BootRun to support Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson d1f543fc1d Update BuildInfo to support Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson 83cfd3b2e6 Update BootWar to support Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson 081ef2d905 Update BootJar to support Gradle's configuration cache
See gh-22922
4 years ago
Andy Wilkinson c828521912 Allow tests to provide properties that modify the build.gradle script
See gh-22922
4 years ago
Andy Wilkinson d136324b99 Add support for testing the Gradle plugin with --configuration-cache
See gh-22922
4 years ago
Phillip Webb da753300a1 Merge branch '2.3.x'
Closes gh-23819
4 years ago
Phillip Webb f84323fe3e Prevent duplicate jar entries from being written
Update the `AbstractJarWriter` so that it can directly build the layer
index as entries are written. Prior to this commit, a layer tracking
was handled by a decorator class which was broken because it didn't
override enough methods. Since `AbstractJarWriter` has quite a complex
API, it seems sensible to have it handle the layer index directly,
removing the need for a decorator entirely.

Fixes gh-23801
4 years ago
Andy Wilkinson 2d8528d5bd Adapt to deprecation of StringUtils.isEmpty(Object)
See gh-23774
4 years ago
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
4 years ago
Andy Wilkinson 0aa0cba3f7 Fix content filters when excludeProjectDependencies() is used
Fixes gh-23763
4 years ago
olivier.antoine ded2a8006a Expose BootBuildImage's cleanCache property as a command-line option
See gh-23753
4 years ago
Scott Frederick 38984985d4 Add support for CNB platform API 0.4
This commit adds support for platform API 0.4 when invoking a CNB
builder in the Maven and Gradle plugins. If the builder advertises
that it supports platform API 0.4 then that version will be
requested when invoking lifecycle phases. Otherwise the plugins
will fall back to requesting platform API 0.3.

Requesting platform API 0.4 when invoking builder lifecycle phases
has the primary benefit of making it easier to pass command-line
arguments to the default process in the generated image.

Fixes gh-23692
4 years ago
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
4 years ago
Andy Wilkinson 0f069ee9c6 Merge branch '2.3.x'
Closes gh-23756
4 years ago
Andy Wilkinson 633027b1cd Upgrade to Gradle 6.7
Closes gh-23754
4 years ago
Andy Wilkinson 6898a97102 Merge branch '2.3.x'
Closes gh-23732
4 years ago
Andy Wilkinson 11b5e86ffd Deprecate BootJar#getConfigurations
Fixes gh-23527
4 years ago
Scott Frederick d44ecf5086 Merge branch '2.3.x'
Closes gh-23731
4 years ago
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
4 years ago
Stephane Nicoll 2916bb4c10 Merge branch '2.3.x'
Closes gh-23718
4 years ago
Stephane Nicoll 6beb0c939f Document how to override plugin configuration on the command line
Closes gh-21536
4 years ago
Stephane Nicoll b210d0680a Polish 4 years ago
Andy Wilkinson 84f96033c5 Put project deps in app layer and make customization easier
Previously, when building a layered jar with Gradle, project
dependencies 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 Gradle to include
project dependencies in the application layer by default. The DSL has
also been updated to allow their layer to be customized using new
includeProjectDependencies() and excludeProjectDependencies() methods
rather than relying on including and excluding them via a
group:artifact:version pattern.

Closes gh-23431
4 years ago
Scott Frederick 5b1b03c56c Set platform API version when invoking image builder
The CNB specifications allow builders to support multiple platform
API versions. The supported versions are published in the builder
image metadata as an array of version numbers, while a single
supported version number was published in earlier builder metadata.

These changes read the supported versions from the builder metadata
and fall back to the single version if the array is not present.
A CNB_PLATFORM_API environment variable is set on each lifecycle
phase invocation to request a specific version as recommended in
the CNB platform spec.

Fixes gh-23682
4 years ago
Johnny Lim 4a26e11268 Polish
See gh-23634

Closes gh-23634
4 years ago
Scott Frederick 0e7ab88491 Polish "Update default builder image"
See gh-23628
4 years ago
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
4 years ago
dreis2211 36812bf199 Fix XML tag in image publishing example
See gh-23632
4 years ago
Scott Frederick f2721abf31 Merge branch '2.3.x'
Closes gh-23626
4 years ago
Scott Frederick de685bdca4 Document buildpack configuration of JVM options
Fixes gh-21582
4 years ago
Scott Frederick a099cd9420 Merge branch '2.3.x'
Closes gh-23623
4 years ago
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
4 years ago
Andy Wilkinson 70ed7784a6 Use Property<String>s for main class configuration in the Gradle plugin
Closes gh-23608
4 years ago
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
4 years ago
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
4 years ago
Stephane Nicoll 1296b4dfe6 Revert "Support constructor binding on 3rd party classes"
This commit reverts the support of constructor binding on 3rd party
classes using @ImportConfigurationPropertiesBean

See gh-23172

Closes gh-23593
4 years ago
Andy Wilkinson c82581171d Trigger configuration properties annotation processsor on `@Endpoint`
We generate metadata for `@Endpoint` annotated types so the annotation
processor need to indicate that it supports the endpoint annotation.

See gh-23580
4 years ago
Andy Wilkinson b7d020d3c2 Merge branch '2.3.x' 4 years ago
Andy Wilkinson 543763462c Update tests to look for snippets in correct location
See gh-23598
4 years ago
Andy Wilkinson 1924aad07c Limit supported annotations to `@ConfigurationProperties` and `@Configuration`
Previously, the configuration property annotation processor declared
that it supported all annotation types. This hurt performance and
prevented incremental builds with Gradle when compiling source code
containing source-retention annotations.

This commit updates its supported annotation types to be only
`@ConfigurationProperties` and `@Configuration`. The latter is declared
to allow binding third-party classes returned from a `@Bean` method.

Fixes gh-23580
4 years ago
Andy Wilkinson f44889b992 Merge branch '2.3.x'
See gh-23599
4 years ago
Andy Wilkinson 7eb92cc71a More Gradle snippets to correct location
See gh-23598
4 years ago
Andy Wilkinson 94884f201c Merge branch '2.3.x'
Closes gh-23599
4 years ago
Andy Wilkinson 2d3291fb83 Merge branch '2.2.x' into 2.3.x
Closes gh-23598
4 years ago
Andy Wilkinson 7ac14203ab Expand Gradle plugin's docs on setting bootRun's system properties
Closes gh-23578
4 years ago
Stephane Nicoll 5feaf2bc1a Polish "Polish empty string checks"
See gh-23550
4 years ago
Santhoshkumar. P 5cb07e292d Polish empty string checks
See gh-23550
4 years ago
Stephane Nicoll 9ff946bafa Remove unnecessary stubbing 4 years ago