Q

How can I keep jar and war files in an ear file to deploy to Weblogic server?

I have some jar and war files. I'd like to keep all of them in a ear file to deploy it to Weblogic server. What...

command should I use?

The J2EE SDK from Sun provides a command-line tool called "packager" that enables you to do just that. However, you should use any proprietary tools provided by your application server vendor if they are provided.

The "packager" will create all archives needed for J2EE deployment. In addition to .jar files, .war files and .ear files, "packager" can create EJB .jar files and resource adapter .rar files.

The file that is created by "packager" is controlled by command-line switches. For example, using "packager" at the command-line on a Unix-based platform, the following example stores resources into a .war file:

packager -webArchive -classpath . -classFiles

com/acmeinc/class1.class:com/acmeinc/class2.class:com/acmeinc/class3.class The following example stores resources into a .jar file:

packager -applicationClient classes packageA:Class1.class packageA.Main

appClient.xml appClient.jar The following example stores resources into a .ear file:

packager -enterpriseArchive web.war:ejb.jar:appClient.ear -libraryJars

util.jar appName app.ear A complete description of this tool can be found at:

http://java.sun.com/j2ee/sdk_1.3/techdocs/release/ToolsOnly.html

This was last published in November 2002

Dig Deeper on Java Web Services

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close