As part of a technology evaluation, I'm testing out using XDoclet2 for
generating the xwork.xml file for WebWorks 2. I'm able to get it to run, but
the result is not what I expect. I can't tell if the problem is in my Maven
configuration or my Xwork plugin configuration.
Environment:
JDK 1.4.2_06
Maven 1.0.2 (I know - switch to Maven 2. Not on the engineering project plan
just yet.) maven-xdoclet2-plugin-1.0.2. (v1.0.3 has a qdox snapshot
dependency that is not available from anywhere, as far as I can tell.)
My xdoclet xwork plugin dependency entry in project.xml looks like this:
<dependency>
<groupId>xdoclet-plugins</groupId>
<artifactId>xdoclet-plugin-xwork</artifactId>
<version>1.0.3</version>
<url>http://xdoclet-plugins.sf.net/</url>
<properties>
<xdoclet.dependency>true</xdoclet.dependency>
</properties>
</dependency>
Here is my trial project setup:
project.properties:
----------
# Configure XDoclet2 to process XWorks Action classes maven.xdoclet.0=xwork
maven.xdoclet.0.xwork=org.xdoclet.plugin.xwork.XWorkXMLPlugin
maven.xdoclet.0.xwork.destdir=${maven.src.dir}/main/resources
maven.xdoclet.0.xwork.mergefile=${maven.src.dir}/main/xdoclet/xwork.xml
maven.xdoclet.0.fileset.0.dir=${pom.build.sourceDirectory}
maven.xdoclet.0.fileset.0.include=**/*Action.java
-----------
xrc/main/xdoclet/xwork.xml (merge file):
-----------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
"http://www.opensymphony.com/xwork/xwork-1.0.dtd">
<xwork>
<include file="webwork-default.xml"/>
<package name="default" extends="webwork-default"/> </xwork>
-----------
In my source directory, I have the class TrialAction.java, which does
basically nothing:
-----------
package com.modius.trial;
import com.opensymphony.xwork.ActionSupport;
/**
* @xwork.action
* name="trial"
* namespace="default"
* @xwork.result
* name="success"
* value="/thank-you.jsp"
* @xwork.result
* name="error"
* value="/error.jsp"
* @author Jay H. Hartley
* @version $Revision$
*/
public class TrialAction extends ActionSupport {
private TrialFormBean bean;
public TrialFormBean getBean() {
return bean;
}
public void setBean(TrialFormBean bean) {
this.bean = bean;
}
public String execute() throws Exception {
if (bean.getName() != null && bean.getName().trim().length()
> 0
&& bean.getMessage() != null
&& bean.getMessage().trim().length() > 0) {
return SUCCESS;
}
return ERROR;
}
}
-----------
When I run "maven xdoclet2", the generated file basically looks identical to
the merge file, with no action entries. If I don't include the mergefile
parameter, I get just <xwork></xwork>. Using the -X argument shows one
message that seems to indicate the scan directory is set up correctly:
...
Running org.xdoclet.plugin.xwork.XWorkXMLPlugin
...
[xdoclet] [DEBUG] fileset: Setup scanner in dir
F:\sandbox\trial\src\main\java with patternSet{ includes: [**/*Action.java]
excludes: [] }
[xdoclet] [DEBUG] Finding class org.xdoclet.predicate.IsA
[xdoclet] [DEBUG] Class org.xdoclet.predicate.IsA loaded from ant loader
[xdoclet] [DEBUG] Finding class com.opensymphony.xwork.ActionSupport
...
attaining goal build:end
popping off [EMAIL PROTECTED] for
[EMAIL PROTECTED] in
xdoclet:maven-xdoclet2-plugin popping off
[EMAIL PROTECTED] for
[EMAIL PROTECTED] in impactdatacorp:dashboard
BUILD SUCCESSFUL Final Memory: 2M/5M Total time: 4 seconds Finished at: Wed
Mar 08 12:38:26 PST 2006
I don't see a classloader or other message indicating that the TrialAction
class was loaded. Don't know if I should.
What am I doing wrong?
Thanks in advance,
Jay
--------
Jay H. Hartley, Ph.D.
Senior Software Engineer/Architect
Modius, Inc.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
xdoclet-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest