You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Frank W. Zammetti" <fz...@omnytex.com> on 2005/06/21 20:58:37 UTC
Weird error with Jar task
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:
http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/200305.mbox/%3C20030521064136.31529.qmail@icarus.apache.org%3E
...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
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Weird error with Jar task
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
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="checkstyletask.properties">
<classpath location="${src}/lib/checkstyle-all.jar" />
</taskdef>
<checkstyle config="${otherlibs}/checkstyle_checks.xml"
failOnViolation="false">
<classpath refid="classpath" />
<fileset dir="${src}/org" includes="**/*.java" />
<formatter type="xml" toFile="${src}/checkstyle_results.xml" />
</checkstyle>
<echo message="Done" />
</target>
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
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:
>
> http://mail-archives.apache.org/mod_mbox/logging-log4j-dev/200305.mbox/%3C20030521064136.31529.qmail@icarus.apache.org%3E
>
>
> ...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
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org