256 Commits

Author SHA1 Message Date
Phillip Webb
11a94ee6f0 Merge branch '2.3.x' into 2.4.x 2021-03-23 12:52:07 -07:00
Phillip Webb
82127fdaa3 Update copyright year of changed files 2021-03-23 12:50:49 -07:00
Scott Frederick
2dd4010eb0 Merge branch '2.4.x'
Closes gh-25701
2021-03-19 15:58:14 -05:00
Scott Frederick
6f860b441b Merge branch '2.3.x' into 2.4.x
Closes gh-25700
2021-03-19 14:52:20 -05:00
Phillip Webb
663fd8ce5e Update copyright year of changed files 2021-03-18 14:49:52 -07:00
Scott Frederick
e4fa39df01 Fail fast when finalName is misconfigured
When the `finalName` parameter is incorrectly set in the Spring Boot
Maven plugin configuration instead of in the `build` configuration, the
repackaged and original archive files are not named as expected. Prior
to this commit, the image building goal would detect this error
condition and throw an exception late in the process of creating the
build container, leaving the container in an unstable state. This
commit changes the image building goal to detect this condition early,
before attempting to create the container.

Fixes gh-25590
2021-03-17 15:19:21 -05:00
Andy Wilkinson
68e5a107cc Revert "Merge branch '2.4.x'"
This reverts commit 5488b8cb465b6aa45a1a807f7754ca32132b8ed1, reversing
changes made to dee0df5c53dba81fca08bc64479fc9e54434a9ac.

See gh-25701
2021-03-17 11:17:54 +00:00
Andy Wilkinson
ed4e419b0c Revert "Merge branch '2.3.x' into 2.4.x"
This reverts commit eaa510872a5af5defddca4285bc01c730ae79856, reversing
changes made to 3e69522e2d5fda8f7d019525df6b7f645c28ab49.

See gh-25700
2021-03-17 11:13:58 +00:00
Andy Wilkinson
ae2ff7849b Revert "Fail fast when finalName is misconfigured"
This reverts commit 263b7c20e4ad4bdc9bbd5f0e68bcd1d706d8a29c.

See gh-25590
2021-03-17 11:11:24 +00:00
Scott Frederick
5488b8cb46 Merge branch '2.4.x'
Closes gh-25701
2021-03-16 17:48:54 -05:00
Scott Frederick
eaa510872a Merge branch '2.3.x' into 2.4.x
Closes gh-25700
2021-03-16 17:31:32 -05:00
Scott Frederick
263b7c20e4 Fail fast when finalName is misconfigured
When the `finalName` parameter is incorrectly set in the Spring Boot
Maven plugin configuration instead of in the `build` configuration, the
repackaged and original archive files are not named as expected. Prior
to this commit, the image building goal would detect this error
condition and throw an exception late in the process of creating the
build container, leaving the container in an unstable state. This
commit changes the image building goal to detect this condition early,
before attempting to create the container.

Fixes gh-25590
2021-03-16 17:22:48 -05:00
Jurrie Overgoor
3c0e236562 Support Maven's reproducible build feature for war repackaging
See gh-25571
2021-03-11 11:08:10 +00:00
Andy Wilkinson
961a34a5ee Merge branch '2.4.x'
Closes gh-25497
2021-03-04 19:15:03 +00:00
dreis2211
1ccd8dae8a Allow the project to be built with Java 16
See gh-25171
2021-03-04 18:54:56 +00:00
Stephane Nicoll
c120f789d5 Merge branch '2.4.x'
Closes gh-25141
2021-02-09 15:04:58 +01:00
Stephane Nicoll
9218965104 Merge branch '2.3.x' into 2.4.x
Closes gh-25140
2021-02-09 15:04:28 +01:00
dreis2211
4937547b8a Fix build deprecation warnings about duplicate jar entries
See gh-25116
2021-02-09 14:45:58 +01:00
Andy Wilkinson
db781a0d84 Merge branch '2.4.x'
See gh-25077
2021-02-02 15:14:18 +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
d8b6960997 Merge branch '2.4.x'
Closes gh-25077
2021-02-01 16:08:57 -08:00
Phillip Webb
257608a3a3 Merge branch '2.3.x' into 2.4.x
Closes gh-25076
2021-02-01 16:03:43 -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
Madhura Bhave
152698f2b2 Add support for creating layered war files with Maven
See gh-22821
2021-01-28 12:39:19 -08:00
Stephane Nicoll
2c2c160579 Remove deprecated code
See gh-24806
2021-01-15 14:14:33 +01: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
Phillip Webb
4fba7d0c60 Merge branch '2.3.x' into 2.4.x 2020-12-15 19:48:52 -08:00
Phillip Webb
29300530c6 Polish 2020-12-15 19:44:40 -08:00
Phillip Webb
da753300a1 Merge branch '2.3.x'
Closes gh-23819
2020-10-22 21:03:22 -07:00
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
2020-10-22 20:55:09 -07: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
e48af31ced Polish
See gh-23081
2020-08-26 10:47:45 +02:00
Phillip Webb
899e8e189b Merge branch '2.3.x'
Closes gh-23001
2020-08-18 16:49:12 -07:00
Phillip Webb
f7452b9383 Ensure LayoutFactory is not passed an empty file
Update `Repackager` to ensure that `getLayout` is called before we
backup the source file. This restores earlier behavior that some
custom `ModuleFactory` implementations were relying on.

Closes gh-22995
2020-08-18 16:45:44 -07:00
Madhura Bhave
41f5ba9077 Switch layering on by default
Closes gh-20983
2020-08-03 17:04:20 -07:00
dreis2211
e49e2dfff1 Use Supplier variants of Assert methods
See gh-22699
2020-08-03 15:06:13 +02:00
Andy Wilkinson
972aab18f9 Merge branch '2.3.x'
Closes gh-22328
2020-07-14 15:08:42 +01:00
dreis2211
021d9b59cb Cleanup temporary files after Maven plugin execution
See gh-22112
2020-07-14 15:08:19 +01:00
Andy Wilkinson
47874d8c6a Treat warnings as errors when compiling
See gh-21271
2020-06-16 12:50:41 +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
Andy Wilkinson
c7a5b72565 Improve compatibility by replacing use of seq with a native for-loop
Closes gh-21068
2020-04-29 19:30:35 +01: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
Johnny Lim
29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Scott Frederick
fa186aa15b Preserve timestamps on loader directories
Prior to this commit, when the Maven plugin copied
spring-boot-loader.jar to a repackaged archive the timestamps of class
files were preserved but the timestamps of directories were not
preserved. This resulted in the directories having a current timestamp.

This commit copies the directory timestamps from spring-boot-loader.jar
to the repackaged archive and adds tests to verify the proper
behavior.

See gh-20927
2020-04-21 18:58:34 -05:00
dreis2211
d4575bc122 Fix unused parameters
See gh-20911
2020-04-10 14:06:42 +02:00
dreis2211
ae15a3d162 Polish LayersIndex
See gh-20874
2020-04-08 17:29:07 +02:00
Phillip Webb
729fc9dd6d Ensure streams are always closed
Update `AbstractJarWriter` to ensure that streams are always closed,
even if entries are not written.
2020-04-06 23:48:37 -07:00
Phillip Webb
1abbfbbfcd Attempt to fix failing Windows test 2020-04-06 23:48:28 -07:00