 |
A J2EE project is composed of a number of files :
- Source files (java code, web code (html, gif, jpg, jsp), documentation)
- Libraries required for your application to compile (jar files such as j2ee.jar)
- Configuration files (WEB-INF for the web-app, META-INF for the ejb-app and another META-INF for the .ear)
During the build process, these files will be compiled, copied into a number of directories following the J2EE specification in order to create a web-application, a web archive or an enterprise archive.
The Automation Toolkit can be used for many J2EE projects and can therefore be located outside of a particular project. For example, the Automation Toolkit could be located at /projects/Automation Toolkit while you have two J2EE projects you want to build located at /projects/project1 and /projects/project2 respectively. You will provide the executable with the path of the project you want to build or deploy. We will refer to this location as $PROJECT_HOME (which could have the value of /projects/project1 for example).
The Automation Toolkit provides default values for the locations for your source files, libraries and configuration files, as well as the project name, the deployment directory and the temporary build dir. They are all relative to your project home directory ($PROJECT_HOME).
If you want to build the default empty directory structure for your project, run the following command from the $Automation Toolkit_HOME directory :
antwrapper $PROJECT_HOME build.xml init-setup
For example, the command 'antwrapper d:\project1 build.xml init' will create the following directories :
- d:\project1\src
- d:\project1\src\java
- d:\project1\src\web
- d:\project1\src\doc
- d:\project1\lib
- d:\project1\conf
- d:\project1\conf\base
- d:\project1\conf\base\WEB-INF
- d:\project1\conf\base\EJB-INF
- d:\project1\conf\base\META-INF
Here are the details of the different properties used by the Automation Toolkit, their default values and how they can be redefined to meet your project custom file structure.
Project part |
project.name
|
the name of your J2EE project (defaults to j2ee-project) |
You can override this default value by providing a valid property files named project.properties in the $PROJECT_HOME directory containing an entry in the form of :
project.name=individa
|  |
Build part |
java.dir
|
.java files (defaults to $PROJECT_HOME/src/java) |
web.dir
|
.html,gif, jpg, jsp files (defaults to $PROJECT_HOME/src/web) |
doc.dir
|
the project documentation (defaults to $PROJECT_HOME/src/doc) |
lib.dir
|
the external .jar files required to compile (defaults to $PROJECT_HOME/lib) |
conf.base.webinf.dir
|
config files for the web-app (defaults to $PROJECT_HOME/conf/base/WEB-INF) |
conf.base.ejb.dir
|
config files for the ejb-app (defaults to $PROJECT_HOME/conf/base/EJB-INF) |
conf.base.metainf.dir
|
config files for the ear (defaults to $PROJECT_HOME/conf/base/META-INF) |
build.dir
|
temporary build directory (defaults to $PROJECT_HOME/build) |
You can override those default values by providing a valid property files named build.properties in the $PROJECT_HOME directory.
You can provide environment specific configuration files, for example if the web.xml file used during development is different from the one that will be used in production. To do so, you need to :
- Provide a value for the conf.base.dir property (which defaults to $PROJECT_HOME/conf/base) in build.properties
- create a directory under $conf.base.dir with the name of the needed environment under $conf.base.dir/$yourenv
- create the WEB-INF, EJB-INF and META-INF directories if needed
- place the environment-specific config files into any of those directories
Upon specifying to the executable the name of the environment you want to build for, the build process will use the environment-specific configuration files in addition to (also means overriding) the config files present in the conf/base/ subdirectories.
Note that you can also provide an environment specific property file in the form of build_envName.properties where 'envName' is the name of the environment you want to build for. In this case, the regular build.properties file will be overridden by the properties/values defined in build_envName.properties.
|  |
Deployment part |
deployment.antfile
|
the path to another ant script that will be used for deployment. Note that this path will be relative to the Automation Toolkit installation dir ($Automation Toolkit_HOME) and not $PROJECT_HOME. (defaults to deploy_base.xml) |
You can override those default values by providing a valid property file named deploy.properties or an environment-specific deploy_envName.properties file.
The Automation Toolkit comes with a deploy_fs.xml script which provides simple file system functionality, ideally suited for development purposes. Other deployment scripts can be created following the hardware configuration, network setups or environment needs.
|  |
|