I want to deploy WAR of Maven project to JBoss server. I know that from Eclipse Export->War deploy the WAR file to JBoss. But How can I do this for Maven Project. Any step by step information or useful website link will be very helpful to me. Thank you.
Edit: I have added
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jboss-maven-plugin</artifactId> <version>1.5.0</version> <configuration> <jbossHome>/home/tanmoy/Jboss</jbossHome> <serverName>all</serverName> <fileName>target/LoginExample-1.0.war</fileName> </configuration> </plugin>
To my pom.xml and import again as maven project, but on right clicking into pom.xml for Run As I don't see any option for deployment.
We can create a dynamic web project in Eclipse, add a JBoss server and then configure the application to run on the server. Internally, Eclipse will create the war file of the application and place it in the JBoss directory. We can create an index. html file and set the welcome-file in web.
On the details page for the selected JBoss server instance, open the Inventory tab. In the Create New drop-down menu, select the item for - Web Application (WAR) or - Enterprise Application (EAR), as appropriate. In the resource form, enter the information for the application to be deployed.
Assuming that you installed the m2eclipse Maven Eclipse plugin, right click your project or your pom, Run As>Maven build and enter the goal "deploy" on the goals line.
I found the solution and I am sharing as it might be helpful to someone. My configuration is:
You also need to
Now you are ready to start to create project.
Note: there are some possibilities of overlapping jar(s) of your WAR with the jar(s) of JBoss's lib. Then you should take appropriate action. Like remove the jar(s) from your WAR (in case the version of your jar is same or lower than that of JBoss's) or replace the jar(s) of JBoss and remove that jar(s) from your WAR(in case the version of your jar is higher than that of JBoss's). I should be careful about this and gather well knowledge before doing anything.
Thank you.
You can right click on the pom.xml file and choose Run As
-> Maven Build
. Set the build goals to clean package
. When that completes go into the target directory of your project, right click on the war and export as you are currently doing.
EDIT:
To do this from within your pom.xml use the jboss maven plugin: http://mojo.codehaus.org/jboss-maven-plugin/examples/deploy-undeploy-examples.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With