我目前被困在使用 Spring 2.0.8 (仍在等待升级的签收),因为我无法使用注释我虽然我会使用 xdoclet 为我将要写入的大量 bean 生成 beans 配置文件未来。
但是,当我运行我的 ant 目标时,它会创建 xml 文件,但它不包含任何 bean 标签。
我的 ant 脚本如下所示:
<taskdef name="springdoclet" classname="xdoclet.modules.spring.SpringDocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<taskdef name="doclet" classname="xdoclet.DocletTask">
<classpath refid="springdoclet.classpath"/>
</taskdef>
<target name="generate-spring-wiring">
<springdoclet destdir="${resource.dir}" excludedtags="@version,@author,@todo">
<fileset dir="${global.src.dir}"/>
<springxml destinationfile="spring-wiring.xml"/>
</springdoclet>
</target>
生成的 xml 文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans
default-autowire="no"
default-lazy-init="false"
default-dependency-check="none"
>
<!--
To include additional bean definitions for Spring in the generated
application context file, add a file to your XDoclet merge directory
called spring-beans.xml that contains the <bean></bean> markup.
-->
</beans>
如您所见,没有设置任何bean。
我的 bean 类都继承自同一源目录中的父类。MasterBean 的设置如下:
/**
*
*@spring.bean id="master"
*/
abstract public class Master implements Rule {
..
..
}
和一个示例子类(在同一个包中设置如下:
/**
*
* @spring.bean id="G27"
*/
public class Global27_IncorrectFormTypeForCA extends Master {
这与我的类扩展了超类这一事实有关吗?或者我只是设置不正确。这方面的文档几乎不存在,因此我们将不胜感激地收到任何帮助。
谢谢