Commit Graph

311 Commits

Author SHA1 Message Date
Andy Wilkinson
f9363569ab Merge branch '3.2.x'
Closes gh-39369
2024-02-01 11:19:01 +00:00
Andy Wilkinson
0afe0635b9 Merge branch '3.1.x' into 3.2.x
Closes gh-39368
2024-02-01 11:17:41 +00:00
Andy Wilkinson
2b85cb0356 Stop managing version of commons-compress where it isn't needed
Closes gh-39367
2024-02-01 10:20:20 +00:00
Phillip Webb
8f1a330dd5 Update copyright header of cleaned up code
See gh-39259
2024-01-23 10:18:50 -08:00
Tobias Lippert
7f4aaacf42 Simplify stream chain operations
See gh-39259
2024-01-23 10:18:49 -08:00
Andy Wilkinson
7087897507 Merge branch '3.1.x' into 3.2.x
Closes gh-39091
2024-01-11 10:33:57 +00:00
Andy Wilkinson
45c32854a5 Fix Checkstyle upgrade
Closes gh-38746
2024-01-10 15:37:38 +00:00
Phillip Webb
3eeb1b2849 Merge branch '3.1.x' 2023-10-19 23:21:42 -07:00
Phillip Webb
3c62defb9d Support java.nio.file Paths and FileSystems with nested jars
Add a `NestedFileSystemProvider` implementation so that the JDK's
`ZipFileSystem` can load content from nested jars and nested
directory entries.

Creating a `ZipFileSystem` may be a relatively expensive operation as
zip structures need to be parsed and in the case of directory entries
a virtual datablock nees to be generated on the fly. As such, we
install the `ZipFileSystem` as late as possible since in a typical
application it may never be needed.

This commit also tweaks Gradle and Maven plugins to ensure that the
service loader file is written to repackaged jars.

Closes gh-7161
2023-10-18 20:46:36 -07:00
Phillip Webb
33c5e1269a Write signature files to uber jars to for Oracle Java 17 verification
Update Gradle and Maven plugins to write an empty `META-INF/BOOT.SF`
file whenever there is a nested signed jar.

This update allows Oracle Java 17 to correctly verify the nested JARs.
The file is required because `JarVerifier` has code roughly equivalent
to:

	if (!jarManifestNameChecked && SharedSecrets
			.getJavaUtilZipFileAccess().getManifestName(jf, true) == null) {
    	throw new JarException("The JCE Provider " + jarURL.toString() +
    		" is not signed.");
	}

The `SharedSecrets.getJavaUtilZipFileAccess().getManifestName(jf, true)`
call ends up in `ZipFile.getManifestName(onlyIfSignatureRelatedFiles)`
which is a private method that we cannot override in our `NestedJarFile`
subclass. By writing an empty `.SF` file we ensure that the `Manifest`
is always returned because there are always "signature related files".

Fixes gh-28837
2023-10-16 16:19:16 -07:00
Phillip Webb
55b5610dd9 Add Maven and Gradle option for the loader implementation to use
Add properties to the Maven and Gradle plugins so that users can
switch between the two loader modules.

See gh-37669
2023-10-03 15:40:42 -07:00
Phillip Webb
aeb6537f57 Rename spring-boot-loader to spring-boot-loader-classic
Rename the `spring-boot-loader` module to `spring-boot-loader-classic`
so that we can introduce an alternative loader implementation.

See gh-37669
2023-10-03 15:40:04 -07:00
Phillip Webb
c22548982a Relocate launcher classes
Create alternative launcher classes under the package
`org.springframework.boot.loader.launch` and use them in favor
of the previous location.

This update is designed to improve compatibility with future
changes in the loader.

Closes gh-37667
2023-10-03 14:53:04 -07:00
Phillip Webb
3d6859e80f Use the term "uber jar" in reference documentation and javadoc
Update reference documentation and javadoc to use the term "uber jar"
rather than "fat jar".

Closes gh-37653
2023-10-02 23:01:34 -07:00
Andy Wilkinson
ca5bd37e81 Upgrade to Spring Framework 6.1.0-M1
Closes gh-35977
Closes gh-35980
2023-06-19 18:12:16 +01:00
Johnny Lim
ff9fd1abeb Polish
See gh-35185
2023-05-10 08:31:36 +02:00
Phillip Webb
f5cf821479 Merge branch '2.7.x' into 3.0.x
Closes gh-34430
2023-03-01 21:28:51 -08:00
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
c4de86c244 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:17:57 -08:00
Phillip Webb
df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Krzysztof Krason
94996664bc Drop unnecessary Collections.unmodifiableSet
See gh-33987
2023-01-26 20:47:35 -08:00
Krzysztof Krason
d3efd7e091 Use try with close
See gh-33987
2023-01-26 20:36:38 -08:00
Phillip Webb
a2ac38e203 Update copyright year of changed files 2023-01-09 15:46:07 -08:00
Krzysztof Krason
cf6493f65c Simplify AssertJ assertions and also make them more readable
See gh-33653
2023-01-09 11:10:20 +01:00
Phillip Webb
f588793445 Update copyright year of changed files 2022-12-22 01:00:42 -08:00
Moritz Halbritter
725337f976 Make fields final
Closes gh-33537
2022-12-16 14:28:44 +01:00
Moritz Halbritter
c6536c54d8 Write native-image argfile only if there are excludes
Refactors duplicate logic in BootZipCopyAction and Packager into
separate classes.

Closes gh-33363

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2022-11-30 14:29:35 +01:00
Phillip Webb
c16c6bc3b5 Fix reachability argfile format
Update the argfile to a format that actually works when
passed to the `native-image` command.

See gh-32738
2022-10-17 18:59:50 -07:00
Phillip Webb
8358a0e3f3 Fix reachability-metadata.properties location
Update tools to use the correct `reachability-metadata.properties`
location which should include the version number.

See gh-32738
2022-10-17 14:31:38 -07:00
Phillip Webb
071649360b Generate 'META-INF/native-image/argfile' file for buildpack use
Update the Maven and Gradle plugin to generate an `argfile` file
file under `META-INF/native-image` that contains `--exclude-config`
arguments that should be passed when generating a native image.

The contents of the file is generated for each nested jar that has a
`reachability-metadata.properties` file containing 'override=true'.

The `reachability-metadata.properties` file is expected to be generated
by the Graal native build tools plugin.

Closes gh-32738
2022-10-14 15:23:06 -07:00
Phillip Webb
e0b67889a8 Use Stream.toList instead of Stream.collect when possible
Update code to make use of `Stream.toList()` whenever possible.

Closes gh-28177
2022-10-04 00:29:22 -07:00
dreis2211
65ef8fc51a Use ByteArrayOutputStream.toString where possible
See gh-32534
2022-09-29 15:03:24 +02:00
dreis2211
f0b4a65546 Avoid usage of StringBuffer where possible
See gh-32519
2022-09-29 09:29:10 +02:00
Andy Wilkinson
0bfa9cd704 Upgrade to Logback 1.4 and SLF4J 2.0
Closes gh-12649
2022-09-28 21:14:08 +01:00
Andy Wilkinson
8a2cdb9759 Merge branch '2.7.x'
Closes gh-31950
2022-08-01 20:51:40 +01: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
7377d85096 Merge branch '2.7.x'
Closes gh-31866
2022-07-26 12:18:14 +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
dreis2211
cc91009b70 Use java.util.HexFormat where appropriate
See gh-31477
2022-06-21 17:02:39 +01:00
dreis2211
5db04da275 Use pattern matching for instanceof where appropriate
See gh-31475
2022-06-20 17:55:36 +01:00
Andy Wilkinson
4bb5ba2bd0 Merge branch '2.7.x' 2022-05-26 18:26:52 +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
5dfa5adb75 Merge branch '2.7.x'
Closes gh-31178
2022-05-26 15:54:58 +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
Phillip Webb
f8a41d34aa Merge branch '2.7.x' 2022-05-17 22:22:08 -07:00