Skip to content

Commit 305c392

Browse files
committed
fail processing resources if there is only the outdated vfs/proj resource dir and no org.graalvm.python.vfs
1 parent 2650039 commit 305c392

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

graalpython/graalpy-maven-plugin/src/main/java/org/graalvm/python/maven/plugin/ManageResourcesMojo.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ public void execute() throws MojoExecutionException {
155155
if (Files.exists(Path.of(r.getDirectory(), VFS_ROOT, "proj"))) {
156156
getLog().warn(String.format("usage of %s is deprecated, use %s instead", Path.of(VFS_ROOT, "proj"), Path.of(VFS_ROOT, "src")));
157157
}
158+
if (!Files.exists(Path.of(r.getDirectory(), VFS_ROOT)) && Files.exists(Path.of(r.getDirectory(), "vfs", "proj"))) {
159+
// there isn't the actual vfs resource root "org.graalvm.python.vfs" (VFS_ROOT), and there is only the outdated "vfs/proj"
160+
// => looks like a project created < 24.1.0
161+
throw new MojoExecutionException(String.format(
162+
"Wrong virtual filesystem root!\n" +
163+
"Since 24.1.0 the virtual filesystem root has to be '%s'.\n" +
164+
"Please rename the resource directory '%s' to '%s'", VFS_ROOT, Path.of(r.getDirectory(), "vfs"), Path.of(r.getDirectory(), VFS_ROOT)));
165+
}
158166
}
159167

160168
}

0 commit comments

Comments
 (0)