Closed mihalyr closed 2 months ago
This is intended and WAI, because often you want to know the discovered main class in your entrypoint: https://github.com/GoogleContainerTools/jib/issues/4280#issuecomment-2323346289.
A simple workaround in your case is to set mainClass
to a garbage value.
I see, although in my case I do have an application { mainClass = 'app.Main' }
configuration. Shouldn't Jib just use that class by default instead of having me to duplicate configuration?
This is intended and WAI, because often you want to know the discovered main class in your entrypoint: https://github.com/GoogleContainerTools/jib/issues/4280#issuecomment-2323346289.
If this is indeed the case, I think the warning message might be a bit misleading, since it tells you that the mainClass
is ignored, but it is not the case, because setting mainClass
will prevent scanning for mainClass
and it still generates the files that contain the main class and classpaths, right? So it isn't really ignored, it is just up to you how you utilize the discovered class in your own entrypoint.
mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies are ignored when entrypoint is specified
Agreed.
Thanks @mihalyr for reporting this issue and thanks @chanseokoh for triaging! Closing this as WAI, but we are going look for ways to improve the logging. Feel free to reopen if needed.
Environment:
Description of the issue:
Gradle Jib plugin shows the following warnings when an entrypoint is specified without a main class:
However, this is wrong, because the
mainClass
should be ignore when anentrypoint
is specified. I'm not sure if this is only cosmetic or Jib indeed searches for a main class that it ignores later, becaue of the entrypoint is already given.Expected behavior:
No warnings and no searching for main class when an entrypoint is specified.
Steps to reproduce:
jib-gradle-plugin
Configuration:Log output: