##### Struts BSF Scripting

- Welcome
- Features
- Documentation
- User Guide
- Source Guide
- Download

##### Quick Links

- Apache Struts Home

##### Project Documentation

- About
- Project Info
- Project Reports
- Development Process

##### Legend

- External Link
- Opens in a new window

## Struts Scripting Source Code Guide

The Struts Scripting project, for the most part, follows Apache Struts build and source code layout, so if you are familiar with another Struts project, you'll be at home here. If not, this guide first walks you though what is where and why. Next, it gives help on how to build common artifacts.

Again, since the heavy lifting is done by the Bean Scripting Framework and the scripting engines themselves, there isn't much code to this project itself.

- Source code layout
- Build instructions

### Source code layout

When you unzip the latest release Struts Scripting or check it out from subversion (more help on subversion at the Struts source code), you'll be staring at the following directory structure:

- `/src` - All source code can be found here
- `/src/java` - The source code for the Struts Scripting framework itself
- `/src/struts-example` - A modified version of the Struts 1.2.8 Mailreader example application. This version replaces Java-coded Struts Actions with Groovy scripts.

- `/xdocs` - The XML source code for all documentation, including this guide.
- `/target` - Maven puts all compiled files into this temporary directory.

Next, we'll look at how to build both Struts Scripting library and the included example application.

### Build Instructions

Struts Scripting uses Apache Maven 1.0 to build its jar, example application, documentation, and distribution files. Maven 1.0 is used throughout Struts for building subprojects, providing a consistent build environment to Struts users. To follow these build instructions, you will need to have Apache Maven 1.0 installed and its `maven` executable available in your command path.

Since there are a bunch of build targets, we will break the build down into tasks that you might want to accomplish and show the best way to complete them.

- Build the Struts Scripting jar - Run '`maven jar:jar`' which will create the jar as `/target/struts-scripting-VERSION.jar`.
- Build the Mailreader example - Run '`maven war:war`' to create `/target/struts-example.war`.
- Build the documentation - Run '`maven site:generate`' to create the Struts Scripting website at `/target/docs`.

While this list only covers a few build targets, there are many other you can discover by typing '`maven -g`' from the Struts Scripting directory.