java - Create a war file including external jars using command prompt -
i have 2 projects - project1 , project2. project1 contains java classes. , project2 contains jar files required in project1. means, project1 depends on project1 (for jars).
i using glassfish server. while creating war file of project1, included jar files project2.
example:
project2 conatins 2 packages - poi , web-services.
poi package contains:
poi-examples-3.6-20091214.jar,
poi-contrib-3.6-20091214.jar,
poi-ooxml-3.6-20091214.jar,
poi-ooxml-schemas-3.6-20091214.jar,
poi-scratchpad-3.6-20091214.jar.
web-services package contains:
javax.servlet-3.0.jar,
javax.servlet-api.jar,
jersey-bundle-1.10.jar,
jersey-client-1.12.jar,
jersey-core-1.12.jar,
jersey-multipart-1.4.jar.
now creating war file project1 command prompt, used following command:
jar cvf project1.war d:\javaproject\project2\lib\external\poi\poi-examples-3.6-20091214.jar d:\javaproject\project2\lib\external\poi\poi-contrib-3.6-20091214.jar d:\javaproject\project2\lib\external\poi\poi-ooxml-3.6-20091214.jar d:\javaproject\project2\lib\external\poi\poi-ooxml-schemas-3.6-20091214.jar d:\javaproject\project2\lib\external\poi\poi-scratchpad-3.6-20091214.jar d:\javaproject\project2\lib\external\web-services\javax.servlet-3.0.jar d:\javaproject\project2\lib\external\web-services\javax.servlet-api.jar d:\javaproject\project2\lib\external\web-services\jersey-bundle-1.10.jar d:\javaproject\project2\lib\external\web-services\jersey-client-1.12.jar d:\javaproject\project2\lib\external\web-services\jersey-core-1.12.jar d:\javaproject\project2\lib\external\web-services\jersey-multipart-1.4.jar
project1.war file created in current directory. but, when tried deploy project1.war on glassfish server, encountered error:
c:\glassfish3\glassfish\domains\domain1\applications\project1\d:\javaproject\project2\lib\external\poi\poi-contrib-3.6-20091214.jar
(c:\glassfish3\glassfish\domains\domain1\applications\ directory '.war' files copied after deployment)
i not understand problem. wrong command, executed creating war file? how external jars included while creating war file using command line prompt?
please help.. in advance!
a war file has have specific file structure.
/ meta-inf/ web-inf/ classes/ classes , other classpath resources go here lib/ jar files go here web.xml other webapp stuff; e.g. html, jsps, css ...
if throw stuff jar file @ random, won't recognizable webapp when unpacked webapp container.