jorsol commented on code in PR #57: URL: https://github.com/apache/maven-jar-plugin/pull/57#discussion_r1085261986
########## src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java: ########## @@ -225,23 +237,24 @@ public File createArchive() jarContentFileSet.setIncludes( Arrays.asList( getIncludes() ) ); jarContentFileSet.setExcludes( Arrays.asList( getExcludes() ) ); - boolean containsModuleDescriptor = false; String[] includedFiles = fileSetManager.getIncludedFiles( jarContentFileSet ); - for ( String includedFile : includedFiles ) + + // May give false positives if the files is named as module descriptor + // but is not in the root of the archive or in the versioned area + // (and hence not actually a module descriptor). + // That is fine since the modular Jar archiver will gracefully + // handle such case. + // And also such case is unlikely to happen as file ending + // with "module-info.class" is unlikely to be included in Jar file + // unless it is a module descriptor. + boolean containsModuleDescriptor = + Arrays.stream( includedFiles ).anyMatch( p -> p.endsWith( MODULE_DESCRIPTOR_FILE_NAME ) ); Review Comment: Sure, will do. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org