Skip to content

Commit 05d754b

Browse files
authored
Remove workaround code that creates an empty Jar file (#80)
Follow up to #15 Fixes #78
1 parent 5a1c1ed commit 05d754b

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoTransform.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,9 @@ private boolean isModule(File jar) {
166166
if (!jar.isFile()) {
167167
// If the jar does not exist, we assume that the file, which is produced later is a local artifact and a module.
168168
// For local files this behavior is ok, because this transform is targeting published artifacts.
169-
// See also: https://github.com/jjohannes/extra-java-module-info/issues/15
170-
try {
171-
//noinspection ResultOfMethodCallIgnored
172-
jar.getParentFile().mkdirs();
173-
//noinspection ResultOfMethodCallIgnored
174-
jar.createNewFile();
175-
} catch (IOException e) {
176-
throw new RuntimeException(e);
177-
}
169+
// See also:
170+
// - https://github.com/jjohannes/extra-java-module-info/issues/15
171+
// - https://github.com/jjohannes/extra-java-module-info/issues/78
178172
return true;
179173
}
180174
try (JarInputStream inputStream = new JarInputStream(Files.newInputStream(jar.toPath()))) {

0 commit comments

Comments
 (0)