Skip to content

Commit

Permalink
fix display of sources for spring-boot classes
Browse files Browse the repository at this point in the history
  • Loading branch information
evernat committed Jun 3, 2020
1 parent fcc9649 commit 58afda8
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -430,7 +430,8 @@ public static Map<String, MavenArtifact> getWebappDependencies() throws IOExcept
if (entry.getValue() == null) {
final String jarFileName = entry.getKey();
for (final MavenArtifact dependency : allDependencies) {
if (jarFileName.startsWith(dependency.getArtifactId() + '-')) {
if (jarFileName.startsWith(
dependency.getArtifactId() + '-' + dependency.getVersion())) {
entry.setValue(dependency);
break;
}
Expand Down Expand Up @@ -544,8 +545,13 @@ public static File getSourceJarFile(URL classesJarFileUrl) throws IOException {
final byte[] pomProperties = readMavenFileFromJarFile(classesJarFileUrl, "pom.properties");
if (pomProperties == null) {
final Map<String, String> sourceFilePaths = getSourceFilePathsByJarFileNames();
final String sourceFilePath = sourceFilePaths
.get(file.substring(file.lastIndexOf('/') + 1));
String jarFileName = file;
if (jarFileName.endsWith("!/")) {
// remove "!/" at the end, for spring-boot launched with "java -jar"
jarFileName = jarFileName.substring(0, jarFileName.length() - "!/".length());
}
jarFileName = jarFileName.substring(jarFileName.lastIndexOf('/') + 1);
final String sourceFilePath = sourceFilePaths.get(jarFileName);
if (sourceFilePath != null) {
return getMavenArtifact(sourceFilePath);
}
Expand Down

0 comments on commit 58afda8

Please sign in to comment.