Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loader Tools: application classes should appear before libraries on the runtime classpath #11696

Closed
brenuart opened this issue Jan 19, 2018 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@brenuart
Copy link
Contributor

See #9128 (comment) (second paragraph) for the original discussion.

In short: the runtime classpath should have application classes from BOOT-INF/classes before libraries taken from BOOT-INF/lib. This would match the observed behaviour of Eclipse, Maven, Surefire, etc.

The current implementation of the Repackager respects that order but without any guarantee: it is more because of the current implementation rather than by specification. There is also no test case to assert this order is respected.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2018
@philwebb philwebb added type: bug A general bug priority: high and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 21, 2018
@philwebb philwebb added this to the 2.0.0.RC2 milestone Jan 21, 2018
wilkinsona added a commit that referenced this issue Jan 31, 2018
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
@wilkinsona
Copy link
Member

The Gradle plugin was already doing the right thing for war files. Jar files have been aligned with war files in 8f116f7.

@wilkinsona wilkinsona self-assigned this Feb 1, 2018
wilkinsona added a commit that referenced this issue Feb 1, 2018
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants