In my build.xml file, I extract some Java files using cxf. Some of these Java files must be encoded in UTF-8. How can I use Ant to change the encoding in UTF-8?
PS: I found instructions for setting the encoding for javac for UTF-8, but before javac I needed Java files in UTF-8. Otherwise, I get an error:
warning: unmappable character for utf-8 encoding
Here is my code:
<macrodef name="lpwservice"> <attribute name="name"/> <attribute name="package"/> <sequential> <property name="wsdlfile" value="${portal.basedir}/lpw/wsdl/@{name}.wsdl"/> <mkdir dir="${portal.basedir}/lpw/wsdl"/> <get src="${lpw.baseuri.cxf}/@{name}?wsdl" dest="${portal.basedir}/lpw/wsdl/@{name}.wsdl.new"/> <if> <and> <filesmatch file1="${portal.basedir}/lpw/wsdl/@{name}.wsdl" file2="${portal.basedir}/lpw/wsdl/@{name}.wsdl.new"/> <uptodate targetfile="${portal.basedir}/lpw-wsdl.jar" srcfile="${portal.basedir}/lpw/wsdl/@{name}.wsdl"/> </and> <then> <echo message="${wsdlfile} is up to date" level="info"/> <delete file="${portal.basedir}/lpw/wsdl/@{name}.wsdl.new"/> </then> <else> <echo message="${portal.basedir}/lpw/wsdl/@{name}.wsdl needs update" level="info"/> <move file="${portal.basedir}/lpw/wsdl/@{name}.wsdl.new" tofile="${portal.basedir}/lpw/wsdl/@{name}.wsdl" overwrite="true" /> <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true" failonerror="true"> <arg value="-client"/> <arg value="-d"/> <arg value="${portal.basedir}/lpw/src"/> <arg value="${portal.basedir}/lpw/wsdl/@{name}.wsdl"/> <classpath> <path refid="cxf.classpath"/> </classpath> </java> </else> </if> </sequential> </macrodef>
What should i do to do
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true" failonerror="true">
for encoding java files in utf-8?
source share