65.2 spring-boot:findmainclass
The findmainclass
task is used internally by exejar
to locate a class declaring a main
. You can also use this task directly in your build if needed. The following attributes are supported
Attribute | Description | Required |
---|---|---|
classesroot |
The root directory of Java class files | Yes (unless mainclass is specified) |
mainclass |
Can be used to short-circuit the main class search |
No |
property |
The Ant property that should be set with the result | No (result will be logged if unspecified) |
65.2.1 Examples
Find and log.
<findmainclass classesroot="target/classes" />
Find and set.
<findmainclass classesroot="target/classes" property="main-class" />
Override and set.
<findmainclass mainclass="com.foo.MainClass" property="main-class" />