You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The order of libraries on the runtime classpath should match the order they were initially added in the fat jar.
The Repackager adds libraries in the following order:
unpack libraries
application classes
other libraries
loader classes
Marking a library as unpacked affects its position on the classpath - which is not expected.
The text was updated successfully, but these errors were encountered:
brenuart
changed the title
Loader: unpacking a library alters its position in the classpath
Loader Tools: unpacking a library alters its position in the classpath
Jan 19, 2018
I've just reminded myself that the current ordering is deliberate (see #3444 for details). If we're going to fix this, we'll have to find a way to do so that doesn't introduce a regression.
Previously, the ordering of the entries in an archive produced by
BootJar was different to the ordering of the entries in an archive
produced by BootWar. The latter placed application classes before
any nested jars, whereas the former was the other way around.
This commit updates BootJar to use the same ordering as BootWar and
adds tests to verify that the ordering is the following:
1. Loader classes
2. Application classes (BOOT-INF/classes or WEB-INF/classes)
3. Nested jars (BOOT-INF/lib or WEB-INF/lib)
4. Provided nested jars in a war (WEB-INF/lib-provided)
The tests also verify that the position of a library is not affected
by it requiring unpacking.
See gh-11695
See gh-11696
Previously, the order of the entries in a TestJarFile was determined
by the underlying file system rather than by the order in which
they were added. This could lead to unpredicatable ordering and
failures in tests that verify archive entry ordering.
This commit updates TestJarFile to add entries to the archive in
insertion order.
See gh-11695
See gh-11696
The order of libraries on the runtime classpath should match the order they were initially added in the fat jar.
The
Repackager
adds libraries in the following order:Marking a library as unpacked affects its position on the classpath - which is not expected.
See https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java#L252-L267
See #9128 (comment)
The text was updated successfully, but these errors were encountered: