Commit Graph

267 Commits

Author SHA1 Message Date
Phillip Webb
998d59b7ac Ignore system timezone when applying outputTimestamp to entries
Update `JarWriter` so that entry times are set with the default TimeZone
offset removed. The Javadoc for `ZipEntry.setTime` states:

  The file entry is "encoded in standard `MS-DOS date and time format`.
  The default TimeZone is used to convert the epoch time to the MS-DOS
  data and time.

Removing the offset from our UTC time before calling `entry.setTime()`
ensures that we get consistent bytes in the zip file when the output
stream reapplies the offset during write.

Fixes gh-34424
2023-03-01 21:27:08 -08:00
Phillip Webb
df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Andy Wilkinson
012fbb3a57 Merge branch '2.6.x' into 2.7.x
Closes gh-31949
2022-08-01 20:51:18 +01:00
Andy Wilkinson
c0daede1aa Ensure that jarmode jar added to an app has same SHA as published jar
Closes gh-31862
2022-08-01 20:49:10 +01:00
Phillip Webb
a4ef6a7c5c Merge branch '2.6.x' into 2.7.x
Closes gh-31865
2022-07-26 12:13:16 +01:00
Phillip Webb
f8412847dc Update copyright year for "Fix typos in code and documentation"
See gh-31734
2022-07-26 12:08:30 +01:00
Marc Wrobel
dbfc6bded4 Fix typos in code and documentation
See gh-31734
2022-07-26 12:08:07 +01:00
Andy Wilkinson
935d1264e0 Merge branch '2.6.x' into 2.7.x 2022-05-26 18:13:08 +01:00
Andy Wilkinson
3d203d0215 Polish 2022-05-26 17:30:39 +01:00
Andy Wilkinson
455ee0ce22 Merge branch '2.6.x' into 2.7.x
Closes gh-31177
2022-05-26 15:53:38 +01:00
Andy Wilkinson
ee45fd2fc8 Remove redundant throws declarations from internal APIs
Closes gh-31176
2022-05-26 15:47:35 +01:00
Andy Wilkinson
56690a7eb9 Merge branch '2.6.x' into 2.7.x
Closes gh-30791
2022-04-25 15:03:32 +01:00
Andy Wilkinson
409ec48e2a Merge branch '2.5.x' into 2.6.x
Closes gh-30790
2022-04-25 15:00:51 +01:00
Andy Wilkinson
193ef9a06d Package META-INF/services/ files beneath BOOT-INF/classes/
Closes gh-30413
2022-04-25 14:32:47 +01:00
Scott Frederick
db6ef0e802 Exclude duplicate properties file when building a jar from jars
See gh-29670 and gh-23955
2022-02-11 15:31:20 -06:00
Phillip Webb
e1c84e2972 Merge branch '2.6.x' into 2.7.x
Closes gh-29372
2022-01-12 14:07:48 -08:00
Phillip Webb
72696cdb0f Merge branch '2.5.x' into 2.6.x
Closes gh-29371
2022-01-12 14:07:31 -08:00
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