Java heap memory and Maven

I can’t run my program by mvn jetty:run because the heap memory was full. I try many ways but in my case I use this command on the shell and it was done.

export MAVEN_OPTS=-Xmx2048m