727 Commits

Author SHA1 Message Date
Phillip Webb
522f68cb40 Merge branch '2.3.x' into 2.4.x
Closes gh-24994
2021-01-25 21:36:12 -08:00
Phillip Webb
464b302655 Set withTestKitDir per Gradle version
Attempt to fix cache locking issues by setting a unique `withTestKitDir`
directory for each tested Gradle version.

Closes gh-24993
2021-01-25 21:35:25 -08:00
Andy Wilkinson
f3fd55dac6 Merge branch '2.4.x'
Closes gh-24976
2021-01-22 14:59:35 +00:00
Andy Wilkinson
9c8645dec2 Merge branch '2.3.x' into 2.4.x
Closes gh-24975
2021-01-22 14:59:23 +00:00
Andy Wilkinson
46d908f632 Upgrade to Gradle 6.8.1
Closes gh-24737
2021-01-22 14:20:57 +00:00
Stephane Nicoll
2c2c160579 Remove deprecated code
See gh-24806
2021-01-15 14:14:33 +01:00
Phillip Webb
6c2ff56fba Fix tests to also work in IDE 2021-01-12 17:31:53 -08:00
Phillip Webb
a6a7c06e55 Merge branch '2.3.x' into 2.4.x 2021-01-12 12:04:11 -08:00
Phillip Webb
9da0bd8523 Update copyright year of changed files 2021-01-12 12:02:57 -08:00
Andy Wilkinson
c3dfb9bd29 Merge branch '2.3.x' into 2.4.x
Closes gh-24768
2021-01-12 13:12:10 +00:00
Andy Wilkinson
997505005b Handle files larger than Integer.MAX_VALUE bytes in bootJar and bootWar
Fixes gh-24618
2021-01-12 13:11:46 +00:00
Andy Wilkinson
5ae9fbedcd Merge branch '2.3.x' into 2.4.x
Closes gh-24738
2021-01-11 11:33:30 +00:00
Andy Wilkinson
7625a979db Configure bootRun to use project's Java toolchain by default
Previously, unlike the application plugin's run task, our bootRun task
ignored the project's Java toolchain. This meant that the application
was run on a JVM with the same Java version as the one being used by
Gradle itself. This could result in a failure if the application
required a more modern JVM.

This commit updates the plugin to configure the bootRun task's
JavaLauncher convention to be one derived from the project's Java
toolchain. Toolchain support was introduced in Gradle 6.7 so this is
only done when using Gradle 6.7 and later.

Fixes gh-24517
2021-01-11 11:21:53 +00:00
Andy Wilkinson
3c3aa9e486 Merge branch '2.3.x' into 2.4.x
Closes gh-24735
2021-01-11 11:03:35 +00:00
Andy Wilkinson
064de4e073 Check configured JavaLauncher when determining version of the JVM
Previously, bootRun assumed that the Java version of the JVM that would
run the application would be the same as the Java version of the JVM
that is running the build. This assumption does not hold true when
Gradle's toolchain support is used to configure tasks that fork a new
JVM to use a version other than that being used by Gradle itself.

This commit updates the BootRun task to query the JavaLauncher property
when determining the version of Java on which the application will be
run. Toolchain support and the JavaLauncher property are new in Gradle
6.7. To support earlier versions of Gradle, NoSuchMethodError is caught
we continue as if no JavaLauncher has been configured and use the local
JVM's Java version.

Fixes gh-24512
2021-01-11 10:36:16 +00:00
Andy Wilkinson
9e389c8376 Merge branch '2.3.x' into 2.4.x
Closes gh-24710
2021-01-08 17:07:45 +00:00
Andy Wilkinson
5ad4d627fd Fix classpath index so entries match those expected by the launcher
This reverts commit ad164269e9aa7d0f39362d78d946a146dac5fdee and adds
some additional tests.

Fixes gh-24192
2021-01-08 15:32:19 +00:00
Scott Frederick
dfcabe1665 Merge branch '2.3.x' into 2.4.x
Fixes gh-24521 in 2.4.2
2020-12-16 14:53:55 -06:00
Scott Frederick
0e5df2296e Fail with Gradle bootBuildImage and war packaging
Prior to this commit, running the bootBuildImage Gradle task on a
project configured for war packaging would result in a jar file being
built and used in the image instead of the war file. With this commit
an error will be thrown from the plugin in this case.

Fixes gh-24521
2020-12-16 13:23:43 -06:00
Andy Wilkinson
5fdb2ae2fd Protect PluginApplicationActions against absent plugin classes
Closes gh-24526
2020-12-16 09:51:25 +00:00
Phillip Webb
72d36e0c07 Update copyright year of changed files 2020-12-10 10:46:04 -08:00
Phillip Webb
30c27274e2 Merge branch '2.3.x'
Closes gh-24339
2020-12-04 18:31:55 -08:00
Phillip Webb
5f351a6983 Merge branch '2.2.x' into 2.3.x
Closes gh-24338
2020-12-04 18:21:57 -08:00
Phillip Webb
837fc83527 Fix checkstyle header violations
See gh-24337
2020-12-04 18:05:53 -08:00
Scott Frederick
da2276e7d4 Use stable builder and run images in integration tests
Fixes gh-24183
2020-11-17 13:54:10 -06:00
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
2020-11-10 16:19:05 -06:00
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
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
2020-11-09 10:21:41 +00:00
Andy Wilkinson
c85cc33ca9 Fix main class resolution failure when loaded from config cache
See gh-22922
2020-10-25 08:05:59 +00:00
Andy Wilkinson
7cbcd42eba Adapt test to cope with increased Instant precision on Java 11
See gh-22922
2020-10-23 14:38:36 +01:00
Andy Wilkinson
4a4fec6310 Avoid calling getProject() during BootBuildImage's execution
See gh-22922
2020-10-23 13:23:52 +01:00
Andy Wilkinson
c409d50c14 Document support for Gradle's configuration cache
See gh-22922
2020-10-23 12:34:27 +01:00
Andy Wilkinson
806464edd1 Update BootBuildImage to support Gradle's configuration cache
See gh-22922
2020-10-23 12:34:24 +01:00
Andy Wilkinson
b1c4af4081 Update bootJar and bootWar to use new main class resolution mechanism
See gh-22922
2020-10-23 12:34:21 +01:00
Andy Wilkinson
c078a48064 Update BootRun to support Gradle's configuration cache
See gh-22922
2020-10-23 12:34:15 +01:00
Andy Wilkinson
d1f543fc1d Update BuildInfo to support Gradle's configuration cache
See gh-22922
2020-10-23 12:34:12 +01:00
Andy Wilkinson
83cfd3b2e6 Update BootWar to support Gradle's configuration cache
See gh-22922
2020-10-23 12:34:07 +01:00
Andy Wilkinson
081ef2d905 Update BootJar to support Gradle's configuration cache
See gh-22922
2020-10-23 12:34:04 +01:00
Andy Wilkinson
c828521912 Allow tests to provide properties that modify the build.gradle script
See gh-22922
2020-10-23 12:34:01 +01:00
Andy Wilkinson
d136324b99 Add support for testing the Gradle plugin with --configuration-cache
See gh-22922
2020-10-23 12:33:51 +01:00
Andy Wilkinson
0aa0cba3f7 Fix content filters when excludeProjectDependencies() is used
Fixes gh-23763
2020-10-20 13:09:59 +01:00
olivier.antoine
ded2a8006a Expose BootBuildImage's cleanCache property as a command-line option
See gh-23753
2020-10-20 10:28:00 +02:00
Andy Wilkinson
0f069ee9c6 Merge branch '2.3.x'
Closes gh-23756
2020-10-19 19:28:32 +01:00
Andy Wilkinson
633027b1cd Upgrade to Gradle 6.7
Closes gh-23754
2020-10-19 17:52:01 +01:00
Andy Wilkinson
6898a97102 Merge branch '2.3.x'
Closes gh-23732
2020-10-17 07:55:43 +01:00
Andy Wilkinson
11b5e86ffd Deprecate BootJar#getConfigurations
Fixes gh-23527
2020-10-17 07:54:38 +01:00
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
2020-10-15 16:04:02 +01: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