After migrating my project from Grails 3.1.8 to Grails 6.1.0, the build fails with error :
./gradlew clean build -x test -Dgrails.env=preprod
FAILURE: Build failed with an exception.
- What went wrong: Task '.env=preprod' not found in root project 'showcase'.
Versions used : grailsVersion=6.1.0 gradleWrapperVersion=7.6
Why gradlew doesn't recognize the property env of grails ?