Taming the Elephant Build

From Buni.org

Jump to: navigation, search

Contents

Taming the Elephant Build

Introduction

The elephant build is the build system from after 1.0M6 and later. It divides the project up into several components.

Image:elephant-01.jpg

TODO list

Setup

  • Create a clean instance of JBossAS 4.0.4GA.
  • Open a command line session.
  • Set an environment variable JBOSS_HOME to the location of JBAS404GA
  • Set an environment variable FLEX_HOME to the location of Adobe Flex2 SDK. It is optional, if you do not want to use the Flex SDK the build will not compile the webmail.swf.
  • Set an environment variable CLASSPATH to lib/ecj-3.2.1.jar (eclipse compiler) unless you are running the build from within eclipse.
  • move to your "meldware" directory in which you checked out

Development build

  • type "ant test-deploy"
  • type $JBOSS_HOME/bin/run.sh -c meldware

Running tests from Eclipse

  1. . Run test-deploy ant target (I do this from eclipse, but command line should work).
  2. . Start jboss. (./run.sh -c meldware)
  3. . Refresh the eclipse project (so that there are no errors in the package explorer view).
  4. . Right click BaseUnitTestSuite and select run as junit test.

If that doesn't work try Project properties, java build path, Projects and check in "meldware" and click okay. Also ensure that the JAVA_HOME variable is set under LIBRARIES. (Eclipse will complain that it is a folder and not a jar...ignore it)

Why ECJ

ECJ is the Eclipse Compiler for Java.

JDK 1.5.0_08's javac has a nasty bug that causes it to crash while compiling and tells you to got to Sun's bug parade. The bug is resolved by 1.5.0_10, a version that has not propagated to may operating systems packages. ECJ also gives us better warning and error information.

Using JAVAC (JDK compiler) instead

Open build.properties. Remove the first line (build.compiler).

Troubleshooting

Why did I get org.eclipse.jdt.core.JDTCompilerAdapter Class Not Found?

When I compile I get this:

\buni-meldware\ant\main.xml:76: The following error occurred while executing this line: \buni-meldware\build.xml:16: The following error occurred while executing this line: \buni-meldware\ant\jarbuild.xml:48: Class not found: org.eclipse.jdt.core.JDTCompilerAdapter

You didn't read the above carefully enough. You must add the ecj-xxx.jar from the lib directory to a CLASSPATH environment variable.