Skip to content

Commit

Permalink
Only warn about module-info if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd authored and danielsoro committed Sep 20, 2024
1 parent 0bef968 commit 5e75125
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ public Iterable<? extends JavaFileObject> getJavaSources(Iterable<? extends File
@Override
public JavaFileObject getJavaFileForInput(Location location, String className, JavaFileObject.Kind kind)
throws IOException {
JavaFileObject file = this.fileManager.getJavaFileForInput(location, className, kind);
// Ignore the module info of the application in dev mode.
if (context.ignoreModuleInfo() && "CLASS_OUTPUT".equalsIgnoreCase(location.getName())
if (file != null && context.ignoreModuleInfo() && "CLASS_OUTPUT".equalsIgnoreCase(location.getName())
&& "module-info".equalsIgnoreCase(className)) {
if (once.compareAndSet(false, true)) {
Logger.getLogger(StaticFileManager.class).info("Ignoring module-info.java in dev mode, " +
"set the `quarkus.live-reload.ignore-module-info` property to `false` in your project descriptor (`pom.xml` or `build.gradle`) to disable this behavior.");
}
return null;
}
return this.fileManager.getJavaFileForInput(location, className, kind);
return file;
}

}

0 comments on commit 5e75125

Please sign in to comment.