Sep 14

Compiling the Smith ColdFusion engine

Posted by James Netherton | Friday 14 September 2007 5:00 AM | In ColdFusion

You can of course download the binaries for Smith and have everything up and running pretty easily. I thought I'd have a bash at compiling the source code with a view for tinkering with the source a bit later on.

Although the source comes with a 'how to' text file, I thought I'd share my experience of getting the source compiled and packaged in WAR format. You can find the source on sourceforge.

1. The first step is to create a new directory and extract the zip file containing the source code into it.

2. Now fire up Eclipse. Create a new project and choose the Java wizard. Choose a suitable project name and select the option button titled 'Create project from existing source'. You can then browse to the directory where you extracted the source code.

3. The next step is to set the project source directory. Right click on the project root folder within the Eclipse package explorer and choose 'Properties'. Select the 'source' tab and remove any folders that are listed. Click the 'add folder' button and browse to [project root]/src/web/src.

4. Now you're ready to build the ColdFusion page parser. All you need to do is execute the [project root]/build.xml Ant script. Do this by right clicking on build.xml, selecting 'run as' and then 'Ant Build'.

5. The final step is to package the application as a WAR file that we can deploy it to any Java application server (JBoss in my case). Open up the project properties dialog and select the 'Libraries' tab. Ensure that every Jar file under the [project root]/lib directory and its subdirectories are included within the list.

You also need to include tools.jar which comes as part of the Java runtime. In my case it is located in [java home]/lib. Use the 'Add External Jars' button to add this file to the list of libraries.

Finally, alter the first line of build.xml so that the default task being executed is 'dist.war', instead of 'dist.jar'.

Run the build.xml Ant task.

6. Take a peek within [project root]/dist and you should see your WAR file.

 

0 Comments

[Post comment]


Leave a comment








Captcha text