| Author |
Ant Copy binary files best practice?
|
Clyde Lo
Greenhorn
Joined: Mar 15, 2010
Posts: 2
|
|
HI,
I currently have a project where I have a couple of jar files sitting in lib/ . I naively used an ANT build file to copy (obviously with fileset..todir blah) across the binary jar files to some other deploy directory. This resulted in corrupted jars.
I am sure taht other people came across the same issue and was wondering how did you get pass this? Is there some common practice.?
Your input is greatly appreciated.
Thanks
|
 |
Misha Ver
Ranch Hand
Joined: Mar 03, 2008
Posts: 470
|
|
|
Have you checked http://ant.apache.org/manual/CoreTasks/copy.html#encoding , starting from Important Encoding Note ?
|
 |
Clyde Lo
Greenhorn
Joined: Mar 15, 2010
Posts: 2
|
|
HI Misha,
Thanks for your reply.
I did read the copy specifications. I was hoping to get an idea of how do others people move binaries around in Ant in their projects. I am planning to break my copy task into two one with filter and the other without. That is the only way I can think of (not very clean in my view).
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
Clyde Lo wrote:HI Misha,
Thanks for your reply.
I did read the copy specifications. I was hoping to get an idea of how do others people move binaries around in Ant in their projects. I am planning to break my copy task into two one with filter and the other without. That is the only way I can think of (not very clean in my view).
I ran into the same problem long ago, but mixing binary and text files (if you can avoid it) is itself not a very clean approach. You're better off keeping 2 directories, one for the text (filtered) items, and one for the binary files, and doing 2 copies.
Yes, it makes the build.xml file (and directory structure) slightly more complex, but it makes the overall project structure more straighforward.
One thing that using J2EE frameworks has taught me is that less files doesn't necessarily make a project simpler to work with. Otherwise I'd still be cramming everything into logic on JSPs.
|
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
|
 |
 |
|
|
subject: Ant Copy binary files best practice?
|
|
|