I installed JBoss Developer Studio and was able to create a WAR file using the "right-click project> Export> WAR file", but I want to export my project to a WAR file using the command line.
I have maven installed, which is one of Studio's requirements, and I read that I can generate a WAR file using maven, but I need a pom.xml file. When I was browsing my workspace and project, pom.xml was missing. I may need to manually create pom.xml, but I'm not sure how to do this.
My directory tree for my project is as follows:
Siesta βββ build β βββ classes βββ src βββ WebContent βββ extjs βββ extjs-4.2.0 βββ extjs-4.2.2 βββ index.jsp βββ META-INF βββ siesta βββ tests βββ WEB-INF
How to create a WAR file for my Maven / JBoss project using the command line? I use Linux and prefer not to create the pom.xml file, but if there is no other way, I will use the xml file to create the war file.
Edit:
So jar is a way to go about creating a war file. I wrote a small script that will create a war file for me for a specific directory.
#!/bin/bash cd Siesta/WebContent/ jar -cvf ../../Siesta.war * cd -
Then, if you open the war file in zip utility or archive manager in ubuntu, you will see this structure
βββ extjs βββ extjs-4.2.0 βββ extjs-4.2.2 βββ index.jsp βββ META-INF βββ siesta βββ tests βββ WEB-INF
I have a CD in the directory that I want to create a war file that is annoying. I think there may be a better way to do this using the jar -C option, but when I used "jar -cvf Siesta.war -C Siesta / WebContent *" it did not have the same result.
Edit2:
jar -cvf my-app.war myfolder/
For my TomCat application, I use the following:
cd Siesta/WebContent jar -cvf Siesta.war *