Hello everyone, hope you’re doing well. I’m curre...
# questions
u
Hello everyone, hope you’re doing well. I’m currently working on a project using Grails 2.5.6, and we’re in the process of upgrading to Grails 4. For now, I need to generate the WAR file, which I usually do with the command:
grails dev war
For some builds, I’d like to exclude asset files. I tried using the following command:
Copy code
RUN ./grailsw -Dgrails.env=[env] -Dgrails.war.exploded=true -Dgrails.assets.excludes="**/*.js,**/*.css,**/*.ts,**/*.scss,**/*.sass" war
However, this command does not actually exclude the assets. Is there another way to exclude assets through the command line?
j
-D is a system property. -P is a gradle property. The gradle configuration would need to look for that configuration. Calling findProperty('myProperty') and passing it via
-PmyProperty=foo
is typically how these are done. Then in your asset configuration you simply use that property
FYI: most grails builds used a forked jvm now, that's why it's important to use a gradle property instead of a system proeprty - those system properties won't be inherited by default