Skip to content

Commit 120812e

Browse files
committed
Improve error message to include automatic Module Name
1 parent 14d22ab commit 120812e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void transform(TransformOutputs outputs) {
160160
outputs.file(originalJar);
161161
} else if (autoModuleName(originalJar) != null) {
162162
if (parameters.getFailOnAutomaticModules().get()) {
163-
throw new RuntimeException("Found an automatic module: " + originalJar.getName());
163+
throw new RuntimeException("Found an automatic module: " + autoModuleName(originalJar) + " (" + originalJar.getName() + ")");
164164
}
165165
outputs.file(originalJar);
166166
} else if (parameters.getDeriveAutomaticModuleNamesFromFileNames().get()) {

src/test/groovy/org/gradlex/javamodule/moduleinfo/test/AllowAutomaticModulesFunctionalTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AllowAutomaticModulesFunctionalTest extends Specification {
6767

6868
expect:
6969
def out = failRun()
70-
out.output.contains("Found an automatic module: snakeyaml-1.33.jar")
70+
out.output.contains("Found an automatic module: org.yaml.snakeyaml (snakeyaml-1.33.jar)")
7171
}
7272

7373
def "automatic modules are allowed when failOnAutomaticModules set to true and there is a proper module override"() {

0 commit comments

Comments
 (0)