generating struts2 taglib using Java6 Annotation Processor with ant -
i have written struts2 taglib , want package them jar. not using maven used use ant apt tag struts-annotations-1.0.5.jar. , task looks following
<target name="generate-taglib" > <apt classpathref="tags.classpath" factorypathref="tags.classpath" srcdir="strutstags" compile="false" destdir="dist/apt" fork="true" preprocessdir="bin" verbose="false" source="1.5" encoding="utf-8" factory="org.apache.struts.annotations.taglib.apt.tldannotationprocessorfactory" includeantruntime="false"> <compilerarg value="-atlibversion=1.0" /> <compilerarg value="-ajspversion=2.0" /> <compilerarg value="-ashortname=mb" /> <compilerarg value="-auri=/struts-my-tags" /> <compilerarg value="-adescription='my struts tags'" /> <compilerarg value="-adisplayname='my struts tags'" /> <compilerarg value="-aouttemplatesdir=${basedir}/dist/taglib-doc" /> <compilerarg value="-aoutfile=${basedir}/bin/meta-inf/struts-my-tags.tld" /> </apt> </target>
however since java 6 apt has been removed or not supported want use annotation processor in java compiler. couldnt find direct example , came following
<target name="generate-taglib" depends="compile"> <javac destdir="bin" debug="true" failonerror="true" compiler="javac1.6" srcdir="strutstags" includeantruntime="false" encoding="utf-8" verbose="true"> <include name="**/*.java"/> <classpath refid="tags.classpath"/> <compilerarg line="-proc:only"/> <compilerarg line="-processor org.apache.struts.annotations.taglib.apt.tagannotationprocessor" /> <compilerarg line="-s dist/apt" /> <compilerarg line="-source 6"/> <compilerarg value="-atlibversion=1.0.1" /> <compilerarg value="-ajspversion=2.0" /> <compilerarg value="-ashortname=mb" /> <compilerarg value="-auri=/struts-my-tags" /> <compilerarg value="-adescription='my struts tags'" /> <compilerarg value="-adisplayname='my struts tags'" /> <compilerarg value="-aouttemplatesdir=${basedir}/dist/taglib-doc" /> <compilerarg value="-aoutfile=${basedir}/bin/meta-inf/struts-my-tags.tld" /> </javac> </target>
when run task completes nothing generated in struts-my-tags.tld.
can tell me whats wrong?
the processor implemented against apt interface. never worked. ported apt version implement new java annotation processor
Comments
Post a Comment