Saturday, May 2, 2009

Building an XWork snapshot

When working with Struts 2 development, it is often required to have a XWork snapshot to work against. Struts provides a maven profile to build against the XWork sources. However, when updating an XWork component used in a struts-depending project, you need to update the XWork artifact locally.

Assuming you got your hand in the latest XWork sources, run
mvn install
in the source root to install the XWork components locally. However, your project probably depends on xwork, an artifact which is not installed. You can change you project to depend on xwork-core instead. However this may result in leaving you with strange target invocation exceptions when using XWork injections. This is due to some missing classes, amongst others org.apache.commons.lang.xwork.StringUtils. The xwork artifact contains this class.

To install the the xwork artifact, enter the target directory of XWork core: core/target. In that directory run the following command
mvn install:install-file -DgroupId=com.opensymphony -DartifactId=xwork -Dversion=2.1.4-SNAPSHOT -Dfile=xwork-2.1.4-SNAPSHOT.jar -DpomFile=dependency-reduced-pom.xml
Change the versions as needed.

No comments:

Post a Comment