Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2456.
The logic has changed:
main class explicitly configured (via
jib.container.mainClass
) but invalidsrc/
.src/
(inconsistency)jib.container.mainClass
ignored if a valid main is found under `src/', no warning at allmain class not configured, invalid mainClassFromJar, and no or multiple mains found under
src/
(i.e., the only main class we could ever get is from the jar-plugin)So, the case in #2456 falls into 2) with multiple mains, and now Jib will fail while printing
[WARNING] 'mainClass' configured in 'maven-jar-plugin' is not a valid Java class: ${start-class}
and
[ERROR] ... Multiple valid main classes were found: hello.Application, hello.Foo, perhaps you should add a 'mainClass' configuration to jib-maven-plugin
As usual, if only one (valid) main is found under
src/
while mainClassFromJar is invalid, Jib will continue to use the inferred one rather than mainClassFromJar.