INNER CODE UNIT · Java
classesDir
fabric8io/kubernetes-client · scripts/GenerateGraalvmMetadata.java:117
var classesDir = config.indexFile.getParentFile().getParentFile().toPath(); // target/classes
// Extract artifactId from pom.xml
var moduleDir = classesDir.getParent().getParent().toFile(); // go up from target/classes to module root
var artifactId = extractArtifactId(new File(moduleDir, "pom.xml"));
if (artifactId == null) {
System.err.println("ERROR: Could not determine artifactId from " + new File(moduleDir, "pom.xml"));
System.err.println("Pass -o explicitly, or run from a module whose pom.xml has a top-level <artifactId>.");
return Result.ERROR;
}
config.outputFile = classesDir
.resolve("META-INF/native-image/io.fabric8/" + artifactId + "/reflect-config.json")
.toFile();
// Defensive: artifactId comes from a parsed pom.xml; refuse to write outside the
// module's target/classes (e.g. an artifactId containing path-traversal segments).
var classesDirAbs = classesDir.toAbsolutePath().normalize();