apache / apache/grails-core

[3.1.8] Main class is not found when it does not extend GrailsAutoConfiguration itself, even if a superclass does.

Open
#10,009 3 comments 0 reactions 0 assignees View on GitHub
status: acknowledged type: bug type: minor
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

### Expected Behaviour

I have a scenario where it makes sense to create a superclass to an application's main application class. I have created a superclass that extends `GrailsAutoConfiguration`, as the default main application does, and added some logic that the main application class will inherit. I expect that the `bootRun` task will successfully find the application's main class with this object structure:

```
GrailsAutoConfiguration
|---ApplicationSuperClass
|---Application
|---static main(String[] args)
```
### Actual Behaviour

The `bootRun` task does not successfully find the application's main class. The only way the `bootRun` task finds the main class successfully is when it directly extends `GrailsAutoConfiguration`.
### Example Application

https://github.com/budjb/MainClassSample

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the linked MainClassSample application and its bootRun task, then trace how the application's main class is discovered when the class extends ApplicationSuperClass. Done means bootRun successfully finds and launches Application when an inherited GrailsAutoConfiguration is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.