544 Commits

Author SHA1 Message Date
dreis2211
89a44f3da4 Fix some assertions
See gh-25499
2021-03-05 09:56:55 +01:00
Andy Wilkinson
1ce6e796fe Polish "Allow the project to be built with Java 16"
See gh-25171
2021-03-04 18:54:58 +00:00
dreis2211
1ccd8dae8a Allow the project to be built with Java 16
See gh-25171
2021-03-04 18:54:56 +00:00
Scott Frederick
afb60d6161 Add tests for Gradle examples used in plugin docs
Fixes gh-25468
2021-03-01 15:22:15 -06:00
Stephane Nicoll
ed1c68f567 Update copyright year of changed file
See gh-25454
2021-03-01 10:06:23 +01:00
jnizet
cbab2396e2 Fix property name in gradle plugin documentation
See gh-25454
2021-03-01 10:01:52 +01:00
Andy Wilkinson
d48551ff12 Merge branch '2.3.x' into 2.4.x
Closes gh-25437
2021-02-25 17:32:40 +00:00
Stefan Wolf
86ca32e694 Enable stricter validation for Gradle plugin
See gh-25409
2021-02-25 17:28:51 +00:00
Andy Wilkinson
b86351d0cf Merge branch '2.3.x' into 2.4.x
Closes gh-25307
2021-02-16 11:30:03 +00:00
Andy Wilkinson
a2adb877ee Polish "Encourage use of maven-publish plugin in Gradle docs"
See gh-25299
2021-02-16 11:22:47 +00:00
Robert Smith
c0a5245a3e Encourage use of maven-publish plugin in Gradle docs
See gh-25299
2021-02-16 11:19:27 +00:00
Andy Wilkinson
45e6c12cb6 Consider transitives when identifying project dependencies
Previously, when building a layered jar, the Gradle plugin only
considered a configuration's direct dependencies when identifying
project dependencies. This resulted in transitive project dependencies
being missed when deciding which dependencies belong in the
application layer.

This commit updates ResolvedDependencies to consider all projects
from the root project when collecting the IDs of local projects. This
ensures that any project dependency, no matter where it appears in the
dependency graph, is successfully identified.

Fixes gh-25163
2021-02-10 12:10:07 +00:00
Andy Wilkinson
788a42d694 Merge branch '2.3.x' into 2.4.x
See gh-25076
2021-02-02 15:12:27 +00:00
Andy Wilkinson
67479b6380 Add junit-platform-launcher dependency by convention
Closes gh-25074
2021-02-02 13:03:21 +00:00
Phillip Webb
630d216430 Update copyright year of changed files 2021-02-01 22:10:24 -08:00
Phillip Webb
939b5dfc26 Add junit-platform-launcher dependency
Update `build.gradle` files to ensure that `junit-platform-launcher` is
a `testRuntimeOnly` dependency. This ensures that tests can be run from
Eclipse.

Closes gh-25074
2021-02-01 15:31:28 -08:00
Phillip Webb
ca9b612e27 Merge branch '2.3.x' into 2.4.x
Closes gh-25042
2021-01-28 18:56:59 -08:00
jongmin92
23ecb86089 Document missing code to run Gradle bootRun task
See gh-25012
2021-01-28 18:56:21 -08:00
Phillip Webb
d06407ec0a Update copyright year of changed files 2021-01-26 19:06:14 -08:00
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
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
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