White how to develop Maven project with Eclipse, deploy to Jboss,tomact container

Source: Internet
Author: User
Tags jboss

Prerequisite: You want to match good Jdk,maven plug-in on the computer, into the DOS input mvn-version, you can come out of things.


1. Create a new MAVEN project in Eclipse, check out create a simple project (skip archetype Selectio)



2, right key items, select Java EE tools->generate Deployment descriptor Stub, this will be Src->webapp, the following generation of Web-inf directory

3, under the WebApp a new JSP page, first.jsp page, may be an error: the superclass "Javax.servlet.http.HttpServlet" is not found on the Java build Path

Right-click the project, choose Build Path, enter the Libraries tab, choose Add Library, select Server Runtimes,-> Choose the servers that you configured in Eclipse, and hit finish.

4, do not know where my eclipse configuration is not, can not be packaged with eclipse, the next is to manually package, find your project file directory, into the project folder,


5, enter the DOS system in this directory, (you can hold down SHIFT, right key to this directory blank, choose to open the Command window here), Input mvn clean package-u


6. You will find in the target folder that you just created the war package for the project,

Next, deploy to the JBoss or tomact container,

7, copy just get the war package, to your installation of the JBoss directory, to the Standalone->deplouments directory, Start the JBoss service (Standalone.bat), and you can see if there is more than one in this directory, the project name. War.deployed. File, if the (undeployed) description fails, there is an error in the above procedure.

8, open the browser, access to the server directory (http://localhost:8081/2-0.0.1-SNAPSHOT/first.jsp) My is 8081 port, everyone is not the same default is 8080, port,

Then how to deploy the war package to the Tomact container,

9, the war package just copied to your installation of the Tomact directory of the WebApp, it will automatically compile,

10, start the Tomact service (enter the bin directory, Startup.bat,), enter in the browser (http://localhost:8080/2-0.0.1-SNAPSHOT/first.jsp),

See if you're going to go to the page you just edited




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.