Merge branch '2.0.x' into 2.1.x
This commit is contained in:
@@ -79,10 +79,20 @@ class BootArchiveSupport {
|
||||
configureExclusions();
|
||||
}
|
||||
|
||||
void configureManifest(Jar jar, String mainClassName) {
|
||||
void configureManifest(Jar jar, String mainClassName, String springBootClasses,
|
||||
String springBootLib) {
|
||||
Attributes attributes = jar.getManifest().getAttributes();
|
||||
attributes.putIfAbsent("Main-Class", this.loaderMainClass);
|
||||
attributes.putIfAbsent("Start-Class", mainClassName);
|
||||
attributes.computeIfAbsent("Spring-Boot-Version",
|
||||
(key) -> determineSpringBootVersion());
|
||||
attributes.putIfAbsent("Spring-Boot-Classes", springBootClasses);
|
||||
attributes.putIfAbsent("Spring-Boot-Lib", springBootLib);
|
||||
}
|
||||
|
||||
private String determineSpringBootVersion() {
|
||||
String implementationVersion = getClass().getPackage().getImplementationVersion();
|
||||
return (implementationVersion != null) ? implementationVersion : "unknown";
|
||||
}
|
||||
|
||||
CopyAction createCopyAction(Jar jar) {
|
||||
|
||||
@@ -74,7 +74,8 @@ public class BootJar extends Jar implements BootArchive {
|
||||
|
||||
@Override
|
||||
public void copy() {
|
||||
this.support.configureManifest(this, getMainClassName());
|
||||
this.support.configureManifest(this, getMainClassName(), "BOOT-INF/classes/",
|
||||
"BOOT-INF/lib/");
|
||||
super.copy();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,8 @@ public class BootWar extends War implements BootArchive {
|
||||
|
||||
@Override
|
||||
public void copy() {
|
||||
this.support.configureManifest(this, getMainClassName());
|
||||
this.support.configureManifest(this, getMainClassName(), "WEB-INF/classes/",
|
||||
"WEB-INF/lib/");
|
||||
super.copy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user