Production build issue with ClassNotFoundException for ApplicationEventPublisherAware

I have a hilla-lit project and it’s run in development mode without any issue.
When I try to build production package (jar) it throw an exception that ApplicationEventPublisherAware class not found.
I have tried to add spring-core and spring-context packages in my pom file but that didn’t help.

[ERROR] Failed to execute goal dev.hilla:hilla-maven-plugin:2.1.1:build-frontend (default) on project lit-test: Execution default of goal dev.hilla:hilla-maven-plugin:2.1.1:build-frontend failed: Type [unknown] not present: org/springframework/context/ApplicationEventPublisherAware: org.springframework.context.ApplicationEventPublisherAware -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal dev.hilla:hilla-maven-plugin:2.1.1:build-frontend (default) on project lit-test: Execution default of goal dev.hilla:hilla-maven-plugin:2.1.1:build-frontend failed: Type [unknown] not present

Vaadin / Hilla version: 2.1.1
Node version: 18.16.0
Java version: 17.0.7+7
Maven version: 3.9.0

Thanks for the help, that is really important because we have almost completed the project but can’t build a production package to deploy.

How are you doing the production build?

Running the maven build with -X flag may provide more info about the failure

To do production build I run:
JAVA_HOME=/opt/jdk-17.0.7+7 ./mvnw clean package -Pproduction -X
lit-test.txt (30.2 KB)

Any news?

Here is new information about this error.
When I comment @EnableJpaRepositories from my application class it starts building.

The issue was fixed in the hilla 2.1.2 version. Thanks, developers.