|
1029 | 1029 | import java.util.spi.ToolProvider |
1030 | 1030 |
|
1031 | 1031 | if ("jar" != project.packaging) { |
1032 | | - log.info('Skipping module descriptor check, since project type is not `jar`.') |
| 1032 | + log.info("Skipping module descriptor check, since the project type is not `jar`.") |
1033 | 1033 | return |
1034 | 1034 | } |
1035 | | - String jarFile = project.build.directory + '/' + project.build.finalName + '.jar'; |
| 1035 | + String jarFile = project.build.directory + "/" + project.build.finalName + ".jar"; |
1036 | 1036 | if (!new File(jarFile).exists()) { |
1037 | | - log.info('Skipping module descriptor check, since `' + project.build.finalName + '.jar` is missing.') |
| 1037 | + log.info("Skipping module descriptor check, since `" + jarFile + "` is missing.") |
1038 | 1038 | return |
1039 | 1039 | } |
1040 | 1040 | StringWriter out = new StringWriter() |
1041 | 1041 | StringWriter err = new StringWriter() |
1042 | 1042 | ToolProvider jar = ToolProvider.findFirst("jar").orElseThrow() |
1043 | | - int result = jar.run(new PrintWriter(out), new PrintWriter(err), '-d', '-f', jarFile) |
| 1043 | + int result = jar.run(new PrintWriter(out), new PrintWriter(err), "-d", "-f", jarFile) |
1044 | 1044 | if (result != 0) { |
1045 | | - throw new RuntimeException('Failed to decompile the module descriptor in ' + jarFile + ':\n' + err) |
| 1045 | + throw new RuntimeException("Failed to decompile the module descriptor in `" + jarFile + "`:\n" + err) |
1046 | 1046 | } |
1047 | | - log.debug('Module descriptor: ' + out) |
1048 | | - for (String line : out.toString().split('\r?\n', -1)) { |
1049 | | - if (line.contains('static') && line.contains('transitive')) { |
1050 | | - throw new RuntimeException("The 'static' and 'transitive' modifiers should not be use together: " + line) |
| 1047 | + log.debug("Module descriptor: " + out) |
| 1048 | + for (String line : out.toString().split("\r?\n", -1)) { |
| 1049 | + if (line.contains("static") && line.contains("transitive")) { |
| 1050 | + throw new RuntimeException("The `static` and `transitive` modifiers should not be use together: " + line) |
1051 | 1051 | } |
1052 | 1052 | } |
1053 | | - log.info('Successfully verified module descriptor in `' + jarFile + '`.') |
| 1053 | + log.info("Successfully verified module descriptor in `" + jarFile + "`.") |
1054 | 1054 | ]]></script> |
1055 | 1055 | </scripts> |
1056 | 1056 | </configuration> |
|
0 commit comments