181 Commits

Author SHA1 Message Date
Phillip Webb
2f6651c3cb Don't use markdown syntax in javadoc or error messages
Closes gh-28408
2021-10-21 11:24:54 -07:00
Andy Wilkinson
9c9fbf400e Upgrade to Spring Java Format 0.0.29
Closes gh-28205
2021-10-06 09:52:45 +01:00
Phillip Webb
a76e5c043e Update copyright year of changed files 2021-06-23 21:01:45 -07:00
Phillip Webb
63ed921554 Restore simple Library constructor
See gh-15808
2021-06-23 17:27:26 -07:00
Madhura Bhave
b790c82732 Apply exclusions to existing war entries
Update `RepackageMojo` and supporting classes so that `exclusions`
on the repackage goal apply to both the contributed libraries and any
existing jar entries already contained in the original war.

Prior to this commit, exclusions would apply to contributed jars (for
example, those in `WEB-INF/lib-provided`) but not jars that were
packaged directly into `WEB-INF/lib` by the war plugin

Fixes gh-15808

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2021-06-23 15:08:31 -07:00
Phillip Webb
a28a3ae090 Merge branch '2.3.x' into 2.4.x 2021-03-30 09:25:46 -07:00
Phillip Webb
9c8a97809d Consistent use of @deprecated since
Restore the patch version number for consistency with `@since`
tags.

See gh-25808
2021-03-30 09:20:30 -07:00
Phillip Webb
363f5829d1 Merge branch '2.3.x' into 2.4.x
Closes gh-25825
2021-03-29 15:46:50 -07:00
Phillip Webb
26dd1b9a26 Update deprecations with for removal targets
Update all deprecation tags to include a removal target.

Closes gh-25808
2021-03-29 15:44:58 -07:00
Scott Frederick
4015d70f00 Merge branch '2.3.x' into 2.4.x
Closes gh-25789
2021-03-26 15:16:01 -05:00
Scott Frederick
3ad5f1013a Fix Maven image building with classifiers
Fixes gh-25736
2021-03-26 11:36:38 -05:00
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
6f860b441b Merge branch '2.3.x' into 2.4.x
Closes gh-25700
2021-03-19 14:52:20 -05: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
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
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
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
dreis2211
021d9b59cb Cleanup temporary files after Maven plugin execution
See gh-22112
2020-07-14 15:08:19 +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
Phillip Webb
951a3e78f9 Test layer index can contain filenames with spaces
Add tests to ensure that the layer index can support filenames that
contain spaces.

Closes gh-20827
2020-04-06 19:18:22 -07:00
Phillip Webb
464c15e52c Ensure empty layers are written to the index file
Update the `LayersIndex` class to ensure that layers that do not contain
content are still written.

Closes gh-20858
2020-04-06 19:18:22 -07:00
Phillip Webb
df58b9baa2 Use YAML compatible classpath.idx format
Update the `classpath.idx` format to align with `layers.idx` and allow
third-parties can parse it as YAML

Closes gh-20861
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
Andy Wilkinson
34e602652c Polish new layered jar support 2020-04-03 10:47:57 +01: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
3f806aa513 Create a new layer for loader classes
Create a dedicated layer that is used to hold the launcher support
classes. The layer sits between `dependencies` and
`snapshot-dependencies` so that the layer is sensible for both
SNAPSHOT and RELEASE versions of Spring Boot

Closes gh-20529
2020-04-03 00:09:30 -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
dreis2211
674f1e77b5 Fix typos
See gh-20704
2020-03-28 08:42:59 +01:00
Madhura Bhave
ad164269e9 Update classpath index to use jar name instead of full path
See gh-20564
2020-03-25 10:46:59 -07:00