I just found out that you can use maven scm plugin to checkout GlassFish source code. You don't need to install svn on your system.
mvn scm:checkout -DconnectionUrl=scm:svn:https://svn.dev.java.net/svn/glassfish-svn/trunk/v3 -DcheckoutDirectory=v3
This command will create a subdirectory 'v3' from the directory where you run the command.
To compile you just need maven and JDK 1.6.
