Skip to content

Commit 0f8a415

Browse files
werner77dsyer
authored andcommitted
Ensured the libs supplied via the 'thin.libs' argument are put in front of the classpath to take precedence over the resolved dependencies
1 parent f6387b0 commit 0f8a415

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

launcher/src/main/java/org/springframework/boot/loader/thin/ThinJarLauncher.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,20 @@ private List<Archive> getClassPathArchives(String root) throws Exception {
386386
if (StringUtils.hasText(parent)) {
387387
parentArchive = ArchiveUtils.getArchive(parent);
388388
}
389-
long t0 = System.currentTimeMillis();
390-
List<Archive> archives = resolver.resolve(parentArchive, getArchive(), name,
391-
profiles);
392-
long t1 = System.currentTimeMillis();
393-
if (log.isInfoEnabled()) {
389+
if (log.isInfoEnabled()) {
394390
if (!this.libs.isEmpty()) {
395391
log.info("Adding libraries: " + this.libs);
396392
}
393+
}
394+
// Prepend the explicitly supplied libs to the class path
395+
final List<Archive> archives = new ArrayList<>(this.libs);
396+
long t0 = System.currentTimeMillis();
397+
archives.addAll(resolver.resolve(parentArchive, getArchive(), name,
398+
profiles));
399+
long t1 = System.currentTimeMillis();
400+
if (log.isInfoEnabled()) {
397401
log.info("Dependencies resolved in: " + (t1 - t0) + "ms");
398402
}
399-
archives.addAll(this.libs);
400403
return archives;
401404
}
402405

0 commit comments

Comments
 (0)