|
|
@ -21,6 +21,7 @@ import java.io.IOException;
|
|
|
|
import java.net.JarURLConnection;
|
|
|
|
import java.net.JarURLConnection;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URLConnection;
|
|
|
|
import java.net.URLConnection;
|
|
|
|
|
|
|
|
import java.security.CodeSource;
|
|
|
|
import java.util.jar.Attributes;
|
|
|
|
import java.util.jar.Attributes;
|
|
|
|
import java.util.jar.Attributes.Name;
|
|
|
|
import java.util.jar.Attributes.Name;
|
|
|
|
import java.util.jar.JarFile;
|
|
|
|
import java.util.jar.JarFile;
|
|
|
@ -62,8 +63,12 @@ public final class SpringBootVersion {
|
|
|
|
if (implementationVersion != null) {
|
|
|
|
if (implementationVersion != null) {
|
|
|
|
return implementationVersion;
|
|
|
|
return implementationVersion;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
URL codeSourceLocation = SpringBootVersion.class.getProtectionDomain()
|
|
|
|
CodeSource codeSource = SpringBootVersion.class.getProtectionDomain()
|
|
|
|
.getCodeSource().getLocation();
|
|
|
|
.getCodeSource();
|
|
|
|
|
|
|
|
if (codeSource == null) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
URL codeSourceLocation = codeSource.getLocation();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
URLConnection connection = codeSourceLocation.openConnection();
|
|
|
|
URLConnection connection = codeSourceLocation.openConnection();
|
|
|
|
if (connection instanceof JarURLConnection) {
|
|
|
|
if (connection instanceof JarURLConnection) {
|
|
|
|