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 Placing a xml file in META-INF using <metainf> 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 "Placing a xml file in META-INF using <metainf>" Watch "Placing a xml file in META-INF using <metainf>" New topic
Author

Placing a xml file in META-INF using <metainf>

Bala Gangadhar
Ranch Hand

Joined: Oct 07, 2008
Posts: 87
    
    1
Hi,
I am creating a jar file using ant jar task
I want place something.xml file in META-INF of the jar.

But its giving error saying: Problem opening app/configuration/xmlsfiles/something.xml.
The specified xml file is existing at the specified location. Still its throwing the error.
What can be the problem...

Regards,
Bala.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If you know the path then just add the single file specifically.

I would urge *much* caution if you're placing configuration information in a publicly-accessible location, though--this strikes me as a Bad Idea.
Bala Gangadhar
Ranch Hand

Joined: Oct 07, 2008
Posts: 87
    
    1
If you know the path then just add the single file specifically.
?

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Specify the entire path: http://ant.apache.org/manual/CoreTypes/fileset.html

I'm not convinced the file exists where you say it does, however, but it could be a different file reading issue.
Dennis Coffeemaster
Greenhorn

Joined: Feb 09, 2012
Posts: 1
I faced the same problem and solved it:

Just try this:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Placing a xml file in META-INF using <metainf>