Use the appfuse plug-in of the maven project to build the struts2.0 + spring2.0 + hibernate Project

Source: Internet
Author: User

Reference http://appfuse.org/display/APF/AppFuse+QuickStart
Description of the above Tutorial:
SMTP Server
It is actually used to send emails. You can skip this step.
One function of Maven is to automatically download resources that do not exist (for example, if the spring package does not exist, MAVEN will automatically download the package and put it on the system disk by default ).
D:/Documents and Settings/your current user/. m2/Repository
Directory). For spring, it is placed in org/spring.

1. Install Maven 2.0.7:
: Http://maven.apache.org/download.html
Installation: http://maven.apache.org/download.html#Installation

Windows 2000/XP
  1. UnzipApache-maven-2.0.8-bin.zip
    To the directory you wish to install Maven 2.0.8. These instructions assume you choseC:/program files/Apache Software Foundation/apache-maven-2.0.8
  2. AddBin
    Directory to your path, by opening up the System Properties (winkey +
    Pause), selecting the "advanced" tab, and the "environment variables"
    Button, then editingPath
    Variable in the user variables. Eg."C:/program files/Apache Software Foundation/apache-maven-2.0.8/bin"; % PATH %
  3. In the same dialog, make sure thatJava_home
    Is set to the location of your JDK, eg.C:/program files/Java/jdk1.5.0 _ 02
  4. RunMVN -- version
    To verify that it is correctly installed.

Use MVN-version to test whether the test is successful.
Maven version: 2.0.7

2. Build the struts2.0 + spring2.0 + hibernate Project
Enter the doscommand line:
E:/Maven (this is my directory, you can select it by yourself)

Enter the following command:
MVN archetype: Create-darchetypegroupid = org. appfuse. archetypes-darchetypeartifactid = appfuse-Basic-Struts-dremoterepositories = http://static.appfuse.org/releases

-Darchetypeversion = 2.0.1-dgroupid = com. mycompany. app-dartifactid = myproject

One of the preceding commands is described as follows:
This command is to use appfuse to build a struts2 base project (it has helped us to integrate the SSH framework and comes with a user management module, but we have not yet created a database, and we have to modify the database connection)
-Dgroupid: name of your company or organization-dartifactid: Project name

Enter the long wait .....
Maven has downloaded the package.

3. Modify the database connection:
Go to the generated project, open the Pom. xml file, and modify the following snippet. This is the configuration information of the MySQL database.
<! -- Database settings -->
...
<JDBC. url> <! [CDATA [JDBC: mysql: // localhost/struts2base? Createdatabaseifnotexist = true & amp; useunicode = true & amp; characterencoding = UTF-8]> </jdbc. url>
<JDBC. Username> root </jdbc. Username>
<JDBC. Password> </jdbc. Password>
...

4. Package A Project
Enter myproject (this is the value of-dartifactid = myproject)
Directory
E:/Maven/myproject>
Enter the command: MVN jetty: Run-war


If no exception occurs and the last line is displayed:
[Info] Starting interval at interval of 3 seconds.
Indicates that the operation is successful.
Open your browser and enter

Http: // localhost: 8080

Go to the logon page,

If the connection fails, check whether the database connection is configured incorrectly.
Everything is done.

For more information, see

Http://appfuse.org/display/APF

Wizard

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.