-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logic to filter resource files from classes/ is not perfect #1005
Comments
Perhaps this is WAI? What's the downside?
…On Tue, Sep 18, 2018 at 6:24 PM Chanseok Oh ***@***.***> wrote:
MavenLayerConfigurations.getForJarProject():
I know we're doing our best, and maybe the logic below is the best we can
do, but making a note here that the logic isn't perfect and resource files
may slip into the classes layer, e.g., if a resource file is
classes/com/example/my-cool.properties. However, now that #956
<#956> is fixed, this
issues can be resolved somehow by leveraging the new API?
// Gets the classes files in the 'classes' output directory. It finds the files that are classes
// files by matching them against the .java source files. All other files are deemed resources.
try (Stream<Path> classFileStream = Files.list(classesOutputDirectory)) {
classFileStream.forEach(
classFile -> {
/* * Adds classFile to classesFiles if it is a .class file or is a directory that also * exists in the classes source directory; otherwise, adds file to resourcesFiles. */
if (Files.isDirectory(classFile)
&& Files.exists(
classesSourceDirectory.resolve(classesOutputDirectory.relativize(classFile)))) {
classesFiles.add(classFile);
return;
}
if (FileSystems.getDefault().getPathMatcher("glob:**.class").matches(classFile)) {
classesFiles.add(classFile);
return;
}
resourcesFiles.add(classFile);
});
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1005>, or mute the
thread
<https:/notifications/unsubscribe-auth/AHf5HV08I01D7hwpC3Hg2oxLl0XSzU_Pks5ucXKlgaJpZM4Wu4qY>
.
|
I think this is a relatively minor problem. The Gradle plugin and the Maven plugin may generate different layers: the classes layer built by Gradle will have only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MavenLayerConfigurations.getForJarProject()
:I know we're doing our best, and maybe the logic below is the best we can do with the current API, but making a note here that the logic isn't perfect and resource files may slip into the classes layer, e.g., if a resource file is
classes/com/example/my-cool.properties
. However, now that #956 is fixed, this issue can be resolved somehow by leveraging the new API?The text was updated successfully, but these errors were encountered: