These instructions are for those who want to fully rebuild everything from scratch. Most developers should follow V3DevelopmentInstructions.
You must use Maven 2.0.9, as previous versions of MAVEN have led to issues building v3. If you see a compilation error relating to ".../PwcCoyoteRequest.java:146: cannot find symbol" then most likely you are using a pre-2.0.9 versions of Maven. There is known issue in Maven where HashSet is used to store classpath thus resulting in unpredictable ordering of classpath during compilation.
Do not use Maven 2.2.0 as there are critical regressions in this version and you will not be able to compile GFv3.
If you don't have Maven installed, download it here
.
To checkout the entire V3 workspace,
svn checkout https://svn.dev.java.net/svn/glassfish-svn/trunk/v3If you don't have svn, please download it here
.
svn checkout https://glassfish-svn.dev.java.net/svn/glassfish-svn/tags/3.0
To checkout the V3Preview workspace,
svn checkout https://glassfish-svn.dev.java.net/svn/glassfish-svn/branches/3.0-Preview
To checkout the V3Prelude workspace,
svn checkout https://svn.dev.java.net/svn/glassfish-svn/branches/v3_prelude_release
Tip: If you don't have svn installed, you can use mvn to checkout V3 workspace:
mvn scm:checkout -DconnectionUrl=scm:svn:https://svn.dev.java.net/svn/glassfish-svn/trunk/v3 -DcheckoutDirectory=v3This command will create a subdirectory 'v3' from the directory where you run the command. You can do the same for V3Prelude workspace by replacing the URL.
After that, perform the following steps to build GFv3
cd v3 mvn -U -Prelease-phase1 install mvn -U install
Note: if you get a java OutOfMemory Error while running the mvn command, add this entry to your shell's rc file or environment:
export MAVEN_OPTS=-Xmx512m
For re-build from existing workspace,
cd v3 svn update mvn -U clean install
At the end of this, you will have various distributions. These distributions are nothing but zip files with specific Main Class and contents. For example, one of the distributions is the GlassFish distribution available at:
Tip: If you want to dedicate a maven local repository:
mvn -Dmaven.repo.local=/tmp/m2 clean install
Note that the so-called "admin domain" is already available as a zipped-up folder with prebuilt structure. This is a deviation from how GlassFish V2 used to install/create the domain.
Unzip the distribution in your favorite directory and do
glassfish/bin/asadmin start-domain [--verbose|-v]where the option --verbose|-v starts the server embedded, in the same vm and displays the server log on the console or
java -jar glassfish/modules/glassfish.jar
you can then use the asadmin client to deploy applications
bin/asadmin deploy foo.war
Note: Make sure that you are using JDK 1.6 update release 4 or above and it must be in the path.
mvn -DskipTests=true -o clean installYou need to add -DskipTests=true to skip the unit tests since the acc-config unit test is retrieving the DTD over the network when using JAXB to convert XML files to Java code. See: IT 4756
This was discussed during the engineering meeting on Tuesday 17 Feb 2009.
Since by definition, Java EE 6 requires Java SE 6 runtime, it is obvious that we use Java 6 for compilation. Thus, the javac used for compilation of Java sources in GlassFish v3 trunk is
and will flag it as an error.