Eclipse Build SSM (Spring, Spring MVC, Mybatis) leverages maven to manage jar packages
In general, the new eclipse is already integrated with MAVEN, if not installed, click on the Eclipse menu bar help->eclipse Marketplace search keyword maven to the plugin Maven integration for Eclipse and click Install, then replace the eclipse-integrated maven with our own, instead of the eclipse-brought, reposition it, click Preference, Maven, window installation, add to settings such as
Setup is complete, then eclipse configuration maven is done.
Create the SSM Project
Select Create Maven Project Select File--new--and other, select Maven---MAVEN project in the new window, and click Next, as
Select the project path, for example, then next
Select the project type Select the artifact ID for Maven-archetype-webapp, as
Enter the group ID and Artifact ID, as well as the package, what the group ID and Artifact ID represent, and you can read "Maven combat", group ID is equivalent to an organization, and Artifact The ID is equivalent to a specific project under this organization, and Packege will generate a default name based on your group ID and artifact ID, which can be used by default, as
After the dot finish, the project structure
If the directory structure and the above are different, then change the perspective to Java mode, the above structure also needs to add something, select the project right-click New->source folder-> Enter the folder name->finish ; The structure is as follows:
Turn the project into a Dynamic Web project right-click Project, Properties-"Project Facets, click Convert to faceted fro, tick the dynamic web Module, and set version to 2.3." (3.0 for Java7).
Set up Deployment assemblies (Web Deployment Assembly)
After the above step is set up, click OK, then right button project, select Properties----"Deployment Assembly, such as
The list here is the path to the file publication when the project is deployed.
(1) We delete the two items of test, because tests are used for testing and do not need to be deployed.
(2) Set the Maven jar package to be published under Lib.
ADD, Javabuild Path Entries, Maven Dependencies, Finish
Setup Complete
Building a framework
Add the required jar packages to the pom.xml.
If the dependence does not know how to write, such as GroupID, Artifactid, version does not know what to fill, then directly on the http://search.maven.org/search, corresponding to fill it out.
Save Pom.xml,maven will help us to download all of our configured jar package, jar package depends on the jar package will be automatically downloaded, is not very convenient! Of course, this download may take a long time, do not hurry, when the percentage of eclipse in the lower right corner of the progress is not available, the download is OK.
Configuration file
Xml
Spring.xml
Mybatis-spring.xml
Spring-mvc.xml
Mybatis-config.xml
Log4j.xml
Mysqldb.propertites
Eclipse builds Ssm+maven Step-by-step