350 Commits

Author SHA1 Message Date
Phillip Webb
9cf55808fb Ensure run user actually exists
Update `launch.script` so that the `run_user` variable is only set when
the user actually exists. Prior to this commit, if the jar file was
owned by a non-existing user the startup script could fail.

Fixes gh-29370
2022-01-12 14:05:30 -08:00
Andy Wilkinson
508d0af453 Merge branch '2.6.x' into 2.7.x
Closes gh-29269
2022-01-05 11:58:33 +00:00
Andy Wilkinson
a6d8ff4677 Merge branch '2.5.x' into 2.6.x
Closes gh-29268
2022-01-05 11:58:03 +00:00
Andy Wilkinson
41b01cc289 Only write parent entries when entry is new
Previously, when writing a repackaged jar, an attempt to write all of
an entry's parent directories would always be made, irrespective of
whether or not the entry itself had already been written. This was
inefficient as, due to the way that the jar is written, once an entry
itself has been written, we know that all of its parent directories
will also have been written.

This commit updates the jar writer so that no attempt is made to
write parent directory entries if the entry itself has already been
written.

Fixes gh-29175
2022-01-05 11:49:48 +00:00
Phillip Webb
f3bcbca841 Update copyright year of changed files 2021-12-16 13:05:17 -08:00
Scott Frederick
8f57f0babb Add classpath index support for exploded war archives
Update the Maven and Gradle packaging for war files so that a
`classpath.idx` file is written into the archive that provides the
original order of the classpath, as was previously done for jar files.
The `WarLauncher` class will use this file when running as an exploded
archive to ensure that the classpath order is the same as when running
from the far war.

Fixes gh-19875
2021-12-09 16:41:49 -06:00
Scott Frederick
ab0cc55e20 Merge branch '2.5.x' into 2.6.x
Closes gh-28904
2021-12-03 11:42:03 -06:00
Scott Frederick
467c092fdc Remove classpath index manifest attribute from repackaged war files
Fixes gh-28895
2021-12-03 11:41:28 -06:00
Phillip Webb
beb68671bb Update copyright year of changed files 2021-11-24 10:23:32 -08:00
Phillip Webb
e25f216eab Merge branch '2.5.x'
Closes gh-28425
2021-10-21 11:28:33 -07:00
Phillip Webb
daf36dff55 Merge branch '2.4.x' into 2.5.x
Closes gh-28424
2021-10-21 11:27:29 -07:00
Phillip Webb
2f6651c3cb Don't use markdown syntax in javadoc or error messages
Closes gh-28408
2021-10-21 11:24:54 -07:00
Phillip Webb
f4bd8956af Polish "Allow build info properties to be excluded"
Update the Maven plugin to use an alternative syntax to exclude
the info properties and apply some minor polishing.

See gh-27412
2021-10-13 21:12:45 -07:00
Vedran Pavic
ea9faf8690 Allow build info properties to be excluded
Update Maven and Gradle plugins to allow build info properties to be
excluded.

Prior to this commit, the `BuildPropertiesWriter` would fail with an
NPE if the group, artifact, name or version properties were `null`.

This was specifically problematic with the Gradle plugin, since its
DSL allows `null` properties which would either be passed to the writer
or, in the case of `artifact`, converted into a string value of
"unspecified".

See gh-27412
2021-10-13 21:07:09 -07:00
Andy Wilkinson
1a505964ee Merge branch '2.5.x'
Closes gh-28207
2021-10-06 10:03:24 +01:00
Andy Wilkinson
1931104d13 Merge branch '2.4.x' into 2.5.x
Closes gh-28206
2021-10-06 09:57:19 +01:00
Andy Wilkinson
9c9fbf400e Upgrade to Spring Java Format 0.0.29
Closes gh-28205
2021-10-06 09:52:45 +01:00
Andy Wilkinson
0b5d178e5b Merge branch '2.5.x'
Closes gh-28120
2021-09-23 13:23:54 +01:00
Andy Wilkinson
ef18a2166d Merge branch '2.4.x' into 2.5.x
Closes gh-28119
2021-09-23 13:23:40 +01:00
Andy Wilkinson
5957dfeea4 Don't include binary jars in loader-tools source jar
Closes gh-28113
2021-09-23 13:23:29 +01:00
Scott Frederick
40a9c4d90f Sort repackaged libraries in a reproducible Maven build
When a Maven build is configured to ensure reproducibility, any
libraries added to `BOOT-INF/lib` in a jar archive or to `WEB-INF/lib`
in a war archive by the Spring Boot plugin repackaging should be
sorted by name to ensure a stable and predictable order.

Fixes gh-27436
2021-08-20 13:00:39 -05:00
Scott Frederick
9f001efa29 Adjust fat jar central directory to account for launch script
An upgrade to Apache Commons Compress allows the build plugins to write
the launch script to the fat jar as a proper preamble, making the file
compatible with more jar and zip tooling.

Fixes gh-22336
2021-07-19 15:02:42 -05:00
Stephane Nicoll
dc5acb0019 Remove deprecated code flagged for removal
Closes gh-27303
2021-07-14 11:50:01 +02:00
Phillip Webb
2c518f1dff Merge branch '2.4.x' into 2.5.x 2021-06-23 21:02:05 -07:00
Phillip Webb
a76e5c043e Update copyright year of changed files 2021-06-23 21:01:45 -07:00
Phillip Webb
fd83158fa5 Merge branch '2.4.x' into 2.5.x 2021-06-23 17:28:31 -07:00
Phillip Webb
63ed921554 Restore simple Library constructor
See gh-15808
2021-06-23 17:27:26 -07:00
Phillip Webb
af37f59136 Merge branch '2.4.x' into 2.5.x
Closes gh-27056
2021-06-23 17:13:13 -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
weixsun
8a2be288a3 Remove unnecessary throws declaration in tests
See gh-26441
2021-05-17 09:31:51 +02:00
Andy Wilkinson
6f9b1ed6a3 Merge branch '2.4.x'
See gh-25837
2021-03-30 20:52:38 +01:00
Andy Wilkinson
563b8a8cec Merge branch '2.3.x' into 2.4.x
See gh-25836
2021-03-30 20:52:15 +01:00
Andy Wilkinson
e94f8bba62 Ensure that upstream jars have been built
See gh-25835
2021-03-30 20:51:33 +01:00
Andy Wilkinson
df4b1ffb0d Merge branch '2.4.x'
Closes gh-25837
2021-03-30 20:42:41 +01:00
Andy Wilkinson
38a4f135a9 Merge branch '2.3.x' into 2.4.x
Closes gh-25836
2021-03-30 20:42:29 +01:00
Andy Wilkinson
ca9a619259 Defer processing of zipTree source until execution time
Closes gh-25835
2021-03-30 20:41:46 +01: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
44b1751bb4 Merge branch '2.4.x'
Closes gh-25826
2021-03-29 15:48:20 -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
269fc68c1d Merge branch '2.4.x'
Closes gh-25811
2021-03-26 16:43:13 -05: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
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