File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow
main/kotlin/com/github/jengelman/gradle/plugins/shadow Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 16
16
and ` META-INF/groovy ` will be merged into ` META-INF/groovy/org.codehaus.groovy.runtime.ExtensionModule ` .
17
17
- Move injecting ` Class-Path ` manifest attr logic from ` doFirst ` into ` copy ` . ([ #1720 ] ( https://github.com/GradleUp/shadow/pull/1720 ) )
18
18
- Deprecate ` InheritManifest ` . ([ #1722 ] ( https://github.com/GradleUp/shadow/pull/1722 ) )
19
+ - Use default ` JavaExec ` error message when main class is not set. ([ #1725 ] ( https://github.com/GradleUp/shadow/pull/1725 ) )
19
20
20
21
### Fixed
21
22
Original file line number Diff line number Diff line change @@ -177,7 +177,8 @@ class ApplicationPluginTest : BasePluginTest() {
177
177
val result = runWithFailure(runShadowPath)
178
178
179
179
assertThat(result.output).contains(
180
- " The main class must be specified and not left empty in `application.mainClass` or manifest attributes." ,
180
+ " Error: Could not find or load main class" ,
181
+ " Caused by: java.lang.ClassNotFoundException:" ,
181
182
)
182
183
}
183
184
Original file line number Diff line number Diff line change @@ -132,12 +132,9 @@ public abstract class ShadowApplicationPlugin : Plugin<Project> {
132
132
tasks.shadowJar.configure { task ->
133
133
task.inputs.property(" mainClassName" , mainClassName)
134
134
task.doFirst(" Set $mainClassAttributeKey attribute in the manifest" ) {
135
+ val realClass = mainClassName.orNull
135
136
// Inject the attribute if it is not already present.
136
- if (! task.manifest.attributes.contains(mainClassAttributeKey)) {
137
- val realClass = mainClassName.orNull
138
- if (realClass.isNullOrEmpty()) {
139
- error(" The main class must be specified and not left empty in `application.mainClass` or manifest attributes." )
140
- }
137
+ if (! task.manifest.attributes.contains(mainClassAttributeKey) && ! realClass.isNullOrEmpty()) {
141
138
task.manifest.attributes[mainClassAttributeKey] = realClass
142
139
}
143
140
}
You can’t perform that action at this time.
0 commit comments