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 first published in November 2002

Dig deeper on Java Web Services

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close