• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Add multiple files in WEB-INF of war

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My dev structure doesnt have a WEB-INF directory. How can i add multiple files other than web.xml to WEB-INF directory of the war?

I want to do this using the ant script.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the <copy> task?

Personally, I follow the Maven build pattern - I first gather the contents of the WAR in a single directory location, then I package up the whole directory. That way I have both a packaged WAR file and an "exploded" WAR directory.
 
Saloon Keeper
Posts: 24287
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Second on Peter's suggestion.

I did learn a LONG time ago that it's best to make project directories either read-only or write-only, regardless of the build system you're using. I normally build an exploded WAR and feed that directly to Tomcat for debugging, then jar up the exploded WAR when I want to make a distribution module. In keeping with not having permanent files in an output directory, I copy them from a static file source directory (or directories) into the exploded WAR directory when I do a build, just as I compile to the exploded WAR's WEB-INF/classes directory.
 
Greenhorn
Posts: 1
Opera Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ant does not allow using <copy> in <war> block, you may use

in your ant file. and then just create a "WEB-INF" directory in "any-dir" directory, and put xml files there.
the directory structure would be like this:
+any-dir
     +WEB-INF
        <xml-files-are-here>

that's how i did it.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why not use the webinf element. This works for me.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic