Fix reachability-metadata.properties location

Update tools to use the correct `reachability-metadata.properties`
location which should include the version number.

See gh-32738
This commit is contained in:
Phillip Webb
2022-10-17 13:48:00 -07:00
parent 9aa2854e00
commit 8358a0e3f3
4 changed files with 17 additions and 15 deletions

View File

@@ -61,7 +61,7 @@ import org.springframework.util.StringUtils;
*/
public abstract class Packager {
private static final String REACHABILITY_METADATA_PROPERTIES_LOCATION = "META-INF/native-image/%s/%s/reachability-metadata.properties";
private static final String REACHABILITY_METADATA_PROPERTIES_LOCATION = "META-INF/native-image/%s/%s/%s/reachability-metadata.properties";
private static final String MAIN_CLASS_ATTRIBUTE = "Main-Class";
@@ -230,7 +230,7 @@ public abstract class Packager {
for (Map.Entry<String, Library> entry : writtenLibraries.entrySet()) {
LibraryCoordinates coordinates = entry.getValue().getCoordinates();
ZipEntry zipEntry = (coordinates != null) ? sourceJar.getEntry(REACHABILITY_METADATA_PROPERTIES_LOCATION
.formatted(coordinates.getGroupId(), coordinates.getArtifactId())) : null;
.formatted(coordinates.getGroupId(), coordinates.getArtifactId(), coordinates.getVersion())) : null;
if (zipEntry != null) {
try (InputStream inputStream = sourceJar.getInputStream(zipEntry)) {
Properties properties = new Properties();