• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Clarification creating War file

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I had successfully created a .war file and deployed it in the JBOSS server.

When I open my WAR file I am able to view all my .class, .java, .jsp files.

Is there any way to include only my .class files and is it appropriate doing so?

If it can be done and if my approach is correct can any of you help me out in this.

Thanks in advance!

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you create the war file?
If you are using ant, you can opt to exclude the java files.
You want to exclude your jsp files as well? Are you sure?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi .. you can create a WAR file using the JAR utility available. The only pre requisite is that you need to prepare a proper deployment folder structure and a proper deployment descriptor.

The command is as follows - " jar -cvf MyWarFileName.war".
Execute this command from the command line after going to the appropriate folder.

Whether there is way to only include .class files?

Well , whatever you keep in the folder on which you are running the JAR utility , will be included in the WAR file.

For e.g. The normal folder structure will be like below.


Place the package structure in the classes folder. And the Deployment Descriptor directly under the WEB-INF folder.

Thanks

[BPS: Added to code tags to dir tree to show indents.]
 
jagan raja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maneesh / Lorance,

I dint use ant to create my .war file.

I created the War file using \jagan\MyServlet>jar cvf MyServlet.war .

I just want to exclude my .java files.

I have created the directory structure correctly as mentioned by Lorance.

Is there any way for excluding .java files ? If so help me out!
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your source files should be in a separate source directory (in my opinion). This makes doing this trivial.

Or use a tool like Ant (or Maven, but... might be overkill) and make your life a lot easier.
 
Marshal
Posts: 79174
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a "beginning" topic. Moving thread.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic