Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment:

Update to add Maven section

Why

...

Build?

In most cases you will not Most developers will never need to build WebWork yourself, since the the framework from source. The distribution package contains all you need everything a developer needs to get started and become productive with WebWork. See Getting Started for more information Action 2. For more on how to go to start working work with the distributed binaries right away, see Getting Started. However, there are situations where you when someone will want to build WebWork the framework from scratch, for example if you . You may want to try out new tweaks and patches, or simply if want to check the head of current development. For the latter, a solution apart from building WebWork from scratch might be to have a look into our Ivy Repository containing continous integration builds ("nightly builds"), containing the latest build of WebWork and XWork jarsyou might want to try writing your own tweak or patch.

Info

If you just want to use the latest development build, perhaps because a patch you need has been applied, you can also download a nightly build.

Getting the Sources

The source code for the framework is available as distribution you can download directly or from the source code repository.

Distribution

The current distribution packages of WebWork distributions of the framework contain all sources, as well as all needed libraries for building jars JARs and running. Distribution packages are found here.
The dependency resolution via Ivy is disabled by default for the build from a distribution package (> Webwork 2.2 Beta 4). If you need to work with the Clover and Ivy-related buildfile tasks, you might want to follow the instructions below.

CVS

The sources are are hosted via CVS on java.net. So getting your sources is quite standard:

  1. If you have not already done, login to repository:
    cvs -d :pserver:guest@cvs.dev.java.net:/cvs login
  2. Checkout the the webwork sourcetree:
    cvs -d :pserver:guest@cvs.dev.java.net:/cvs checkout webwork
  3. Checkout the the opensymphony common sourcetree:
    cvs -d :pserver:guest@cvs.dev.java.net:/cvs checkout opensymphony/common

If you are a registered user at Java.net, you might use your username instead of anonymous guest account.
For detailed information on how to setup different clients, visit https://webwork.dev.java.net/servlets/ProjectSource.

Building

Distributions can be downloaded from the Apache Struts project.

Respository (SVN)

Use Subversion to checkout the source code.

Code Block

> svn co https://svn.apache.org/repos/asf/incubator/webwork2/

Building with Maven

The default build environment is Maven. To get started with Maven

  • Download Maven 2
  • Extract Maven 2 to a directory of your choice
    • (e.g. \opt\Apache\Maven\maven-2.0.4)
  • Add the bin folder under that directory to your system path
    • (e.g. PATH=%PATH%;C:\opt\Apache\Maven\maven-2.0.4)

Change to your framework home directory (e.g. C:\projects\Apache\struts-current\action2) and run

Code Block

> mvn install

Building with Ant

As and for an alternative, you can also build the framework using Ant and Ivy.

What is Ant

Ant is the defacto standard build tool for Java project. If you don't have Ant installed, it's each to download and setup. As with Maven, you can extract the Ant distribution to the folder of your choice, and then add the bin folder to your system pathWe assume that you are familiar with ant as the standard build tool in the Java world.

What is Ivy?

If you checked out the sources from CVSthe repository, you might have noticed that the lib directory is empty. Unfortunately this does not mean that webwork the framework has no external dependecies at all. To be honest, as . As a full featured MVC framework, it has lots and lots of dependencies, which in turn . Of course, this means that there has to be some kind of dependency management. This is where Ivy comes to play.

Ivy is a free java Java based dependency manager, with powerful features such as transitive dependencies, maven Maven repository compatibility, continuous integration, html HTML reports and many more. Ivy is fully integrated with ant, so you do not have to get into a complicated tool. See http://jayasoft.org/ivy for details.

Installing and using Ivy

The installation is quite trivial: Put a copy of the ivy-1.x.jar found in the common directory of the opensymphony module in your $ANT_HOME/lib directory.
If you want to test the Ivy functionality, ensure you have an internet connection. Change into the webwork module directory and execute ant init(as you might guess, any other task depends on init). Ivy will now resolv all dependencies and (hopefully) download all required jars and put it into the lib directory.
See Dependencies for informations on how to integrate Ivy in your own Webwork2 based projects.

Ant, which many developers already use.

Note
titleSkipping dependency resolution (> Webwork 2.2 Beta 4)

The build now knows the property "skip.ivy". This may be specified from build.properties file or from a command line ant execution with -Dskip.ivy=true. If set, dependency resolution via Ivy is omitted and build is done with current jars found in lib directory.
This behaviour is turned on by default for builds from the distribution package.

 

 

JUnit and Clover

The full Ant build process will require JUnit and Clover.

  • Place a copy of junit.jar (>= 3.8.1) and clover.jar (>= 1.3.9) into your $ANT_HOME/lib directory (if not already exists).
    • If you don't have these jars at hand, look in the lib/build directory of your

...

    • SAF2 module after you called ant init in the step before...

...

  • Our Clover license is found in the common directory of the

...

  • struts module. Place the clover-license.jar into your $ANT_HOME/lib directory as well.

Now you are ready to ...

Build

...

It

From the root of your SAF2 project folder

Code Block

> ant

JDK/JRE Compatibility

...

  • The framework requires JDK 1.4.2+ to build. JDK 5.0 is not required for building.

...

  • Action2-based applications require JRE 1.4.2+ to run. JRE 5.0 is not required to run unless your application uses the optional xwork-tiger module, which adds some Java 5.0 specific features to

...

  • the framework.
Info

Java 5 with Java 1.4 backward compatibility is being considered for SAF 2