Maven utilizes Ant
to provide users with an easy-to-use and familiar interface to
manage projects that have been described with a valid Maven project descriptor.
The build files that Maven
installs are stored in ${maven.home}
directory.
This document describes the Ant build file and targets that are available when using the Struts Plug-in with Maven.
The current recommended approach to using Maven is to add
delegators to these Maven-provided targets in your project's
main build file. This will enable you to use your existing
build file with the additional Maven functionality. In
addition, it is also recommended that you load a standard set of
property files. The property files will setup your environment,
${lib.repo}
and ${maven.home}
, and
allow you to override Maven defaults properties. Please refer
to the Integration document for
more information on how to integrate these build targets into
your project.
The following table contains a brief overview of the
build file that is installed as part of the Maven Struts Plug-in in the
${maven.home}/plugin/struts
directory. In addition,
the various Ant targets in this file is discussed.
Build File | Description |
---|---|
build.xml |
Contains a target validate Struts WAR files.
|
The build file utilizes various properties for default and user-configurable settings. All Struts Plug-in properties are described in the Properties document. The rest of this document assumes your project follows the standard Directory Layout; however, it is possible to override many of these defaults.
Target | Description |
---|---|
maven:validate-struts-war | Validate a Struts WAR file. |
The maven:validate-struts-war
target validates the struts
war file.
The validator checks the folowing:
WEB-INF/struts-config.xml
<form-bean>
tag
have a type
that is loadable from the war file
and not the classpath. If the form bean has
a className
, that class too must be loaded from
the war<action<
tag have
several validations:
className
attribute must be a
class loadable from the warname
attribute, must match a
<form-bean> name
attribute.path
attribute must start with a
forward slash, i.e. '/'scope
attribute must be one of
request
or sesssion
type
attribute must be a class
loadable from the warunknown
and validate
attributes must be either true
or
false