in src/main/java/org/apache/maven/plugins/artifact/buildinfo/ReferenceBuildinfoUtil.java [235:253]
private String extractOsName(Artifact a, JarFile jar) {
String entryName = "META-INF/maven/" + a.getGroupId() + '/' + a.getArtifactId() + "/pom.properties";
ZipEntry zipEntry = jar.getEntry(entryName);
if (zipEntry == null) {
return null;
}
try (InputStream in = jar.getInputStream(zipEntry)) {
String content = IOUtils.toString(in, StandardCharsets.UTF_8);
log.debug("Manifest content: " + content);
if (content.contains("\r\n")) {
return "Windows (from pom.properties newline)";
} else if (content.contains("\n")) {
return "Unix (from pom.properties newline)";
}
} catch (IOException e) {
log.warn("Unable to read " + entryName + " from " + jar, e);
}
return null;
}