-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No value has been specified for property mainClassName #336
Comments
same here, just have updated to gradle 4.3, shadow version 2.0.1 (as before) |
Fwiw the resulting jar still works (for me) despite the warning, what actually breaks with gradle 4.3 is |
I'm also seeing this with shadow 2.0.2 and gradle 4.4. |
Might just be a missing |
If you define |
Can confirm, placing the mainClassName after the application plugin and before the shadow plugin lines removes the warnings |
I'm also seeing this with shadow 2.0.2 and gradle 4.5. |
yeah, i need to improve this, but the workaround is to specify |
With the build.gradle below, I still get:
Gradle version: 4.4
|
Try something like buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}
plugins {
id "application"
}
mainClassName = '...'
apply plugin: 'com.github.johnrengelman.shadow'
[...] |
The above workaround fixes the 'mainClassName' issue, but does not address the following warning:
|
After a little more digging, seems like this has been fixed but not yet released. Thx @johnrengelman ! Looking forward to 2.0.3. |
The application plugin needs this property in gradle build file. It is in docs. |
shadow plugin buildscript {
repositories {
mavenLocal()
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3'
}
}
apply plugin: 'codenarc'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'idea'
mainClassName='com.zcwl.BarnApplication' ./gradlew shadowjar --warning-mode=all
> Task :shadowJar
A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
- No value has been specified for property 'mainClassName'.
BUILD SUCCESSFUL in 6s
5 actionable tasks: 3 executed, 2 up-to-date |
Looks like issue is fixed in Version 2.0.4 |
I'm still getting the error with version 2.0.4. |
The problem is still there for me when using 2.0.4 as well. |
- Apply workaround for: GradleUp/shadow#336 - bump plugin to 2.0.4 Changes between 2.0.2 and 2.0.4 of the plugin: ``` 477db40 12 days ago [email protected] Release 2.0.4 3e3da37 3 weeks ago [email protected] Remove internal Gradle API and annotation internal getters on shadow jar. 31e2380 3 weeks ago [email protected] Close input streams. Closes elastic#364 f712cc8 3 weeks ago [email protected] Upgrade ASM to 6.1.1 to address perf issues. Closes elastic#374 2f94b2b 3 weeks ago [email protected] next version 23bbf3d 7 weeks ago [email protected] Add some gradle versions. Update changelog for 2.0.3 7435c74 7 weeks ago [email protected] Merge pull request elastic#367 from ttsiebzehntt/366-java10 325c002 7 weeks ago [email protected] Update ASM to 6.1 94550e5 3 months ago [email protected] Merge pull request elastic#356 from sgnewson/update-file-to-files 66b691e 4 months ago [email protected] Merge pull request elastic#358 from 3flex/patch-1 14761b1 4 months ago [email protected] fix markdown for User Guide URL in issue template a3f6984 4 months ago [email protected] update inputs.file to inputs.files, to remove warning ``` closes elastic#30389
* Solve Gradle deprecation warnings around shadowJar - Apply workaround for: GradleUp/shadow#336 - bump plugin to 2.0.4 Changes between 2.0.2 and 2.0.4 of the plugin: ``` 477db40 12 days ago [email protected] Release 2.0.4 3e3da37 3 weeks ago [email protected] Remove internal Gradle API and annotation internal getters on shadow jar. 31e2380 3 weeks ago [email protected] Close input streams. Closes #364 f712cc8 3 weeks ago [email protected] Upgrade ASM to 6.1.1 to address perf issues. Closes #374 2f94b2b 3 weeks ago [email protected] next version 23bbf3d 7 weeks ago [email protected] Add some gradle versions. Update changelog for 2.0.3 7435c74 7 weeks ago [email protected] Merge pull request #367 from ttsiebzehntt/366-java10 325c002 7 weeks ago [email protected] Update ASM to 6.1 94550e5 3 months ago [email protected] Merge pull request #356 from sgnewson/update-file-to-files 66b691e 4 months ago [email protected] Merge pull request #358 from 3flex/patch-1 14761b1 4 months ago [email protected] fix markdown for User Guide URL in issue template a3f6984 4 months ago [email protected] update inputs.file to inputs.files, to remove warning ``` closes #30389 * Improove comment as suggested
Has there been any progress on this @johnrengelman ? |
Moving |
This is still a problem with gradle |
For those that are having a struggle in Intellij and their Gradle build, please check your gradle build in gradle/wrapper/graddle-wrapper.jar |
@sora4222 When you say I am using gradle |
No longer an issue for me using Gradle 4.4 and shadow 4.0.1. |
Updating to the latest shadow plugin version will resolve the following deprecation warning: > Task :desktop:shadowJar UP-TO-DATE Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated. This is scheduled to be removed in Gradle 5.0. A problem was found with the configuration of task ':desktop:shadowJar'. See: GradleUp/shadow#336
I have the problem with shadow plugin version 4.0.3, dropping back to 4.0.2 works. |
update to shadow plugin version 5.0.0 |
|
I have the problem with shadow plugin version 2.0.2 and gradle version 6.1.0, upgrade shadow plugin to 5.1.0 works. |
I have the same problem but I solved it by updating Gradle to version 6.1.1 and I also updated the version of shadow |
In order to fix the issue you need to add the following block in
|
This is not a solution - the mainClassName should not be used anymore, so the shadow plugin should not use it. |
@knyttl for this reason I believe the issue should be reopened. This is a bug in the shadow plugin, using a deprecated API, and it should be fixed. I'm surprised on Gradle side, though, that calling EDIT: my bad, I just noticed that this is tracked here already: #609 |
This solution doesn't work with gradle 6.7 and shadowJar 6.1.0: application {
// Desired way mainClass.set("<main class>") causes an issue during jar packaging
@Suppress("DEPRECATION")
mainClassName ="<your main class here>"
} It removes the strikethrough formatting from Intellij, but
And it sounds like suppression of warnings from gradle is not possible by choice... |
@pmorch I have just had the same issue on Gradle 7.0 and ShadowJar 6.1.0... After |
Please check the (User Guide)[http://imperceptiblethoughts.com/shadow] before submitting "how do I do 'x'?" questions!
Shadow Version
2.0.1
Gradle Version
4.3
Expected Behavior
work as in 4.2.1
Actual Behavior
:shadowJar
A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
Build script
Extract of my build script
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
mainClassName = 'com.package.to.Class'
shadowJar {
baseName = 'launcher'
classifier = null
version = null
}
The text was updated successfully, but these errors were encountered: