Production mode on gradle

Im trying to use vaadin on production mode, i tried adding vaadin { productionMode = true }
to build.gradle and vaadin.servlet.productionMode=true
But it gets stuck at

2022-11-24 15:51:13.509  INFO 130812 --- [nio-5000-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-11-24 15:51:13.511  INFO 130812 --- [nio-5000-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms```
I also tried compiling with  ./gradlew clean build -Pvaadin.productionMode but it said .productionMode wasn't found