You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Nafter <Hd...@allshare.nl> on 2009/05/07 11:52:25 UTC

Ant copy file error: Only one of tofile and todir may be set

I'm using maven with included ANT tasks to copy files.
However I receive the following error. 
In an other step during the maven build process I use ant copy as well in
which I have to set the toDir.
But this step is not using the todir at all. But it seems it complains about
the fact that now both the tofile and todir are set.

does anybody know a solution.

Thx.
Hugo

[INFO] Executing tasks

     [echo] Copy version.txt template to _work directory...

     [copy] Copying 1 file to c:\_composer\_work

     [echo] Edit version.txt to reflect current build id...

     [echo] Overwrite new version.txt in pvmeta kernel directories...

     [copy] Copying 1 file to c:\_composer\_composer5\PVMeta\pv50

     [copy] Copying 1 file to c:\_composer\_composer5\PVMeta\pv50_interface

[HUDSON] Archiving C:\_composer\_build_programs\hudson\jobs\Composer Build
Ad-hoc\workspace\java\PV_Web\pom.xml to
c:\_composer\_build_programs\hudson\jobs\Composer Build
Ad-hoc\modules\composer$PV_Web\builds\2009-05-07_11-34-25\archive\composer\PV_Web\5.0.0\pom.xml

[HUDSON] Archiving c:\_composer\_build\war\PV_Web-5.0.0.war to
c:\_composer\_build_programs\hudson\jobs\Composer Build
Ad-hoc\modules\composer$PV_Web\builds\2009-05-07_11-34-25\archive\composer\PV_Web\5.0.0\PV_Web-5.0.0.war

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] An Ant BuildException has occured: Only one of tofile and todir may
be set.


-- 
View this message in context: http://www.nabble.com/Ant-copy-file-error%3A-Only-one-of-tofile-and-todir-may-be-set-tp23423477p23423477.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Ant copy file error: Only one of tofile and todir may be set

Posted by Ja...@rzf.fin-nrw.de.
Change your buildfile.
The tofile attribute is used as destination specification for copying one file. Maybe 
with renaming.
  <copy file="foo" tofile="anotherDir/foo"/>
  <copy file="foo" tofile="bar"/>
The todir attribute is used as destination specifiation for copying multiple files.
  <copy todir="anotherDir">
    <fileset .../>
  </copy>
maybe with renaming
  <copy todir="...><fileset.../><mapper.../></copy>
If you know, that you only have one file and dont want to copy&paste its name you could use
  <copy file="foo" todir="anotherDir"/>
but then you dont specify the 'tofile'.


Jan
  

>-----Ursprüngliche Nachricht-----
>Von: Nafter [mailto:HdOude@allshare.nl] 
>Gesendet: Donnerstag, 7. Mai 2009 11:52
>An: user@ant.apache.org
>Betreff: Ant copy file error: Only one of tofile and todir may be set
>
>
>I'm using maven with included ANT tasks to copy files.
>However I receive the following error. 
>In an other step during the maven build process I use ant copy 
>as well in
>which I have to set the toDir.
>But this step is not using the todir at all. But it seems it 
>complains about
>the fact that now both the tofile and todir are set.
>
>does anybody know a solution.
>
>Thx.
>Hugo
>
>[INFO] Executing tasks
>
>     [echo] Copy version.txt template to _work directory...
>
>     [copy] Copying 1 file to c:\_composer\_work
>
>     [echo] Edit version.txt to reflect current build id...
>
>     [echo] Overwrite new version.txt in pvmeta kernel directories...
>
>     [copy] Copying 1 file to c:\_composer\_composer5\PVMeta\pv50
>
>     [copy] Copying 1 file to 
>c:\_composer\_composer5\PVMeta\pv50_interface
>
>[HUDSON] Archiving 
>C:\_composer\_build_programs\hudson\jobs\Composer Build
>Ad-hoc\workspace\java\PV_Web\pom.xml to
>c:\_composer\_build_programs\hudson\jobs\Composer Build
>Ad-hoc\modules\composer$PV_Web\builds\2009-05-07_11-34-25\archi
>ve\composer\PV_Web\5.0.0\pom.xml
>
>[HUDSON] Archiving c:\_composer\_build\war\PV_Web-5.0.0.war to
>c:\_composer\_build_programs\hudson\jobs\Composer Build
>Ad-hoc\modules\composer$PV_Web\builds\2009-05-07_11-34-25\archi
>ve\composer\PV_Web\5.0.0\PV_Web-5.0.0.war
>
>[INFO]
>---------------------------------------------------------------
>---------
>
>[ERROR] BUILD ERROR
>
>[INFO]
>---------------------------------------------------------------
>---------
>
>[INFO] An Ant BuildException has occured: Only one of tofile 
>and todir may
>be set.
>
>
>-- 
>View this message in context: 
>http://www.nabble.com/Ant-copy-file-error%3A-Only-one-of-tofile
>-and-todir-may-be-set-tp23423477p23423477.html
>Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org