This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 217
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: 5845
    
    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: 217
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: 5845
    
    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