struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Yang <kenshin...@gmail.com>
Subject generating taglib using Ant and Java 6
Date Thu, 04 Apr 2013 15:06:58 GMT
Sorry this may not be directed to Struts2

I have written some Struts2 taglib and want to package them into a jar.
I am not using maven so I used to use Ant with apt tag.
And my task looks like the 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 I want to use
the Annotation Processor in the Java Compiler. But I couldnt find any
direct example and I came up with the 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 I run this the task completes successfully however nothing is
generated in the struts-my-tags.tld.

Can someone tell me whats wrong?

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message