This manual is designed to help you run your first EL4Ant project by reading as little documentation as possible. Of course the reading of the user's guide and the plugins documentation is recommended for a better understanding.
Download the latest
ant+el4ant+helloworld package
and unzip it anywhere you want in a new directory, which will be called
INSTALL
next.
Check that the JAVA_HOME
environment variable is defined with the path to
your JVM installation.
Edit your PATH
environment variable to include INSTALL/ant/bin
.
From the command line, check your configuration with ant -version
. The answer
must be Apache Ant version 1.6.5 compiled on June 2 2005
.
The HelloWorld application provides a module ready to be deployed as a web application. You need Tomcat to go further.
Jakarta Tomcat is the official Reference Implementation container for the Java Servlet and Java Server Pages technologies. It is released under the Apache Software License. Further information can be found at http://jakarta.apache.org/tomcat/.
INSTALL
. A directory has been created: for instance
INSTALL/jakarta-tomcat-5.0.27
, rename it into INSTALL/tomcat
to suit
the default configuration (in INSTALL/demo-project/plugins.xml
, the
j2ee-web.home
attribute).
INSTALL/tomcat/conf/tomcat-users.xml
and add an admin
user with admin
and manager
role with a new line
<user name="admin" password="password" roles="admin,manager"/>
.
j2ee-web-tomcat
plugin must be changed too, as
j2ee-web.port
and j2ee-web.baseurl
for instance.
From the command line, in INSTALL/demo-project
, run
ant -f bootstrap.xml
The project declared in INSTALL/demo-project/project.xml
is now configured. In the
console output, you can see configured plugins and modules declared in the
project. Available targets in the generated build file can be listed with
ant -projecthelp
.
From the command line, in INSTALL/demo-project
, run
ant compile deploy.war.module.eu.helloworldweb
The web application context has been packaged in Tomcat webapps/
directory
and either Tomcat has been started or its context has been
refreshed. Corresponding source files are located in
INSTALL/demo-project/helloworld/webresources/webapp
,
INSTALL/demo-project/helloworld/web/webapp
and
INSTALL/demo-project/helloworld/web/java
.
Open the http://localhost:8080/helloworld/
location in your favorite browser
to look at the result.
Use Ctrl-C
to stop the Tomcat running in the console if it was launched by
EL4Ant.
From the command line, in INSTALL/demo-project
, run
ant jars start.module.eu.helloworldapp
Java sources have been compiled, classes have been packed in jar files and the
main class of the helloworldapp
module has been started.
Corresponding source files are located in INSTALL/demo-project/helloworld/app/java
and INSTALL/demo-project/helloworld/common/java
.
You can change program arguments with the command:
ant start.module.eu.helloworldapp -Druntime.arguments="newarg1 newarg2"
or append arguments to the defined list in project.xml
with:
ant start.module.eu.helloworldapp -Druntime.append.arguments="newarg3 newarg4"
To demonstrate the runtime hook feature, the project is configured to enable
the JVM -verbose
option with the jvmverbose
system property set on the
command line.
ant start.module.eu.helloworldapp -Djvmverbose=
The original JVM command line has been changed by the
runtime.hook.jvm.verbose
.
From the command line, in INSTALL/demo-project
, run
ant jars junit.start.all junit.report javadoc checkstyle website
The JUnit test cases have been run and reports have been generated in the
project site. Open the dist/website/index.html
location in your favorite
browser to look at the result.
JUnit test cases source files are located in
INSTALL/demo-project/helloworld/tests/java
.
To enable code coverage, a complete compilation with the system property emma
set is needed.
ant clean jars junit.start.all start.module.eu.helloworldapp -Demma=t
To append code coverage information about the execution of the web application, you may also run the following:
ant deploy.war.module.eu.helloworldweb -Demma=t
Play a little with it to cover the servlet code, then the following command agregates coverage information and generate reports:
ant emma.report website
Open the dist/website/index.html
location in your favorite browser to look at
the new generated reports.
ant -f bootstrap.xml
from INSTALL/demo-project
in the command line.
ant eclipse.generate
to install runnable Java commands in the
workspace. The workspace must be reloaded if new commands have been added
or changed.
INSTALL/workspace
(default
configuration in EL4Ant, in plugins.xml
, eclipse.workspace.path
attribute)
INSTALL/demo-project
, Select All and Finish.
el4ant_startdev.helloworldapp.0
to do the equivalent of
ant startdev.module.eu.helloworldapp
el4ant_deploy.war.helloworldweb
is the equivalent of
ant deploy.war.module.eu.helloworldweb
. Click on the red square
button to stop Tomcat.
ant eclipse.generate
.
.project
, .classpath
), so any manual changes in Eclipse
interface are lost at next automatic configuration.
You just have to copy INSTALL/el4ant/project-template
, for instance
INSTALL/myproject
. In your Eclipse workspace, you will have to import (or
delete) modules (as Eclipse projects) corresponding to your changes in your
project description, after EL4Ant configuration step.
In case you do not copy the project template in INSTALL
, you have to edit
myproject/etc/bootstrap.properties
to make the buildsystem.lib.directory
property point to INSTALL/el4ant/lib
.
Please use SourceForce forum