Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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: 79642
380
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic