ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <>
Subject Re: Weird error with Jar task
Date Tue, 21 Jun 2005 19:03:19 GMT
Actually, based on some further Googling, I think I stumbled on the 
answer (and I do mean stumbled!)...

It appears that the cause of the problem is my Checkstyle task...

<target name="checkstyle">
   <echo message="Performing static code analysis using CheckStyle..." />
   <delete file="${src}/checkstyle_results.xml" />
   <taskdef resource="">
     <classpath location="${src}/lib/checkstyle-all.jar" />
   <checkstyle config="${otherlibs}/checkstyle_checks.xml" 
     <classpath refid="classpath" />
     <fileset dir="${src}/org" includes="**/*.java" />
     <formatter type="xml" toFile="${src}/checkstyle_results.xml" />
   <echo message="Done" />

It seems like it might be a file locking issue... I found a Bugzilla 
ticket that was much like my problem, but the cause was some unnamed 
other task.  Not sure it was Checkstyle in that case, but seems to be here.

Not a big problem, I can just move the Checkstyle task to after the JAR 
update task, but does anyone know for sure what is going on?


Frank W. Zammetti wrote:
> Hi all... I have a strange situation with a JAR task... I'm dealing with 
> a build script that has always worked and has not changed.  The version 
> of Ant has not changed (1.6.1) and in fact nothing else that I can 
> identify has changed.
> The error I get is:
> C:\tomcat\webapps\ajaxtags\WEB-INF\src\build.xml:224: Unable to rename 
> old file (C:\tomcat\webapps\ajaxtags\WEB-INF\src\struts.jar) to 
> temporary file
> Here is the task and the three relevant properties:
> <property name="src" value="./" />
> <property name="classes" value="../classes" />
> <property name="webinf" value="../" />
> <target name="update_jar">
>   <echo message="Updating JAR..." />
>   <jar destfile="${src}/struts.jar" basedir="${classes}" update="true" 
> excludes="com/**/*" />
>   <jar destfile="${src}/struts.jar" basedir="${src}/META-INF" 
> update="true" includes="struts-html.tld" />
>   <copy file="${src}/META-INF/tlds/struts-html.tld" todir="${webinf}" 
> overwrite="true" />
>   <copy file="${src}/struts.jar" todir="${libs}" overwrite="true" />
>   <delete dir="${classes}/org" />
>   <delete dir="${src}/META-INF" />
>   <echo message="Done" />
> </target>
> This is from within a src directory under WEB-INF of a webapp.  Like I 
> said, this has always worked before, it just suddenly stopped today.
> The only reference I found on the web was to this:

> ...where the Log4J crew seems to experience this sporadically.  Problem 
> is, I have rebooted, re-checked out the project from CVS and tried to 
> build probably 30 times now, and it keeps happening.
> Any pointers?  Thanks!

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message