Skip to content

Package private Main class using Java 25 is not found by build plugins #47309

@snicoll

Description

@snicoll

I am working on a demo with Java 25 where you can define your main method as package private, i.e.

@SpringBootApplication
public class DemoApplication {

	static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

}

Trying to run or package the app leads to:

* What went wrong:
Execution failed for task ':bootJar'.
> Error while evaluating property 'mainClass' of task ':bootJar'.
   > Failed to calculate the value of task ':bootJar' property 'mainClass'.
      > Main class name has not been configured and it could not be resolved from classpath /Users/snicoll/workspace/demo/matchmaking/playerprofile/build/classes/java/main:/Users/snicoll/workspace/demo/matchmaking/playerprofile/build/resources/main

It looks like the algorithm should be relaxed now that the main method does not need to be public (at least on Java 25+)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions