public class MainClassResolver extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
resolveMainClass(String mainClass,
ProjectProperties projectProperties)
If
mainClass is null, tries to infer main class in this order:
1. |
public static String resolveMainClass(@Nullable String mainClass, ProjectProperties projectProperties) throws MainClassInferenceException, IOException
mainClass is null, tries to infer main class in this order:
jar plugin provided by projectProperties (maven-jar-plugin for maven or jar task for gradle).
Warns if main class provided by projectProperties is not valid, or throws an error
if no valid main class is found.
mainClass - the explicitly configured main class (null if not configured)projectProperties - properties containing plugin information and help messagesMainClassInferenceException - if no valid main class is configured or discoveredIOException - if getting the class files from projectProperties failsCopyright © 2019. All rights reserved.