File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Copying an Image Directory into a Jar File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Copying an Image Directory into a Jar File" Watch "Copying an Image Directory into a Jar File" New topic
Author

Copying an Image Directory into a Jar File

Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 210
I have a directory that contains images that need to be copied into my jar. All the examples I've found I interpreted it be done like this:

However, when I run the build I get an error about the files (jpg's) in the ${images} folder saying "skipped - don't know how to handle it." What am I doing wrong? TIA.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I don't see anything obvious. What is ${images} set to? Also, please post the Ant output for this target (try running with the -v option, post that output)


JBoss In Action
Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 210
Thanks for the reply. In gathering the information for this reply I noticed that the error was coming from the javac task not the jar task. I forgot to exclude the files in ${images} from javac. However, once I fixed that the jpg files were copied automatically and I removed the fileset task. I guess the issue was not copying the jpg's but rather failure of the javac task preventing the copy. It was a matter of making too many changes at one time before testing.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Dennis Putnam wrote:I noticed that the error was coming from the javac task not the jar task.

That is why you should always post the Ant output for the target and not paraphrase the error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copying an Image Directory into a Jar File
 
Similar Threads
replaceregexp workaround/bug
Problem with packaging using ant
How to use the Ant build in v3 without a custom build.xml
jar and MANIFEST.MF
Nested "replaceproperties" error