-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
IllegalArgumentException from ASM #1455
Comments
This ended up being a problem with the However, we did end up finding a new issue, which I filed here #1456 |
We may want to file an issue or PR at https://github.com/johnrengelman/shadow to upgrade their ASM dependency. |
@TadCordle sounds like a good idea. |
I could solve this problem by adding the main class to the Manifest Example:
|
Another similar solution would be this:
This way, you can add further parameters. See https://github.com/GoogleContainerTools/jib/blob/master/jib-gradle-plugin/README.md#example |
@samuel-phan |
Hey @chanseokoh , I would gladly help but I just inherited a Java project and I'm trying to build the Java container faster and in better way. I don't know much about Java itself. Sorry that I can't help more. And on the side note, Jib is amazing 👍 🥇 😃 |
I ran into this as well. Gradle's shadow JAR plugin is used by a lot of projects, and after upgrading to the latest version of shadow JAR I still got this error. It would be really nice if Jib helped developers here, for example by mentioning this pitfall in some documentation. Or maybe the plugin could check the version of ASM that it runs with, and print an informative error message before the IllegalArgumentException that ASM produces. |
@martijndwars thanks for the feedback. Normally Gradle should pick up the most latest versions for dependencies when there are conflicts. However, we learned that it is a general and recurring issue in Gradle where an old version of a dependency is loaded in a multi-module Gradle project which leads to a frequent 'Method Not Found" or "Class Not Found" exception. The good news is that, with proper project configuration, this can be fixed, so in some sense, this is a Gradle configuration issue in your project. Check out this FAQ to learn more.
Since this is a general Gradle configuration issue that can happen with any transitive dependencies of Jib (ASM happens to be the one here) and whose error can manifest in any unpredictable behavior (e.g., Method Not Found, or some behavior that works slightly differently, etc.), generally it doesn't make much sense to increase Jib's code complexity by adding a special handling for this particular |
Agreed, thanks for the quick reply. |
Another workaround is buildscript {
dependencies {
classpath('org.ow2.asm:asm:9.7')
}
} in |
Experiencing this issue when trying to Jib up the Groovy project at https://github.com/coollog/skaffold-code.one/tree/master/frontend-service
The text was updated successfully, but these errors were encountered: