One, Maven set in eclipse
1, maven Download:
https://maven.apache.org/download.cgi unzip the download of the good maven.
2, eclipse into the installations, add just unzip the good maven
Window->preferences->maven->installations->add
Add the maven that you just unzipped, and then apply.
3, enter user settings, set user setting.
Choose to extract the settings.xml under Maven. Apache-maven-3.5.0\conf\settings.xml.
4, set the compiled JDK version
[1] Open settings.xml file
[2] Find the Profiles label
[3] Add the following configuration
<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>
Ii. creating Java and Web projects
5,
To facilitate the new MAVEN project, set menu Visibility first.
Window->customize perspective->menu visibility->file->new, select Maven Project, and then click OK.
① Java project to create Maven
File->new->maven project-> Tick Create a single Project (skip archetype selection)->next-> fill out group id-> Fill in the Artifact Id->packaging to select Jar->finish.
② Web project to create Maven
File->new->maven project-> Tick Create a single Project (skip archetype selection)->next-> fill out the group Id For example com.james.ssm-> fill in artifact Id such as: ssm->packaging select War->finish.
Note: The Java project to create MAVEN is not the same as the Web project that created MAVEN packaging. In the choice of packaging, Java is chosen by Jar,web is war
Generate Meta-inf and Web-inf directories and content inside:
Select the new project, right-click->properties->project facets-> deselect Dynamic Web module->apply-> and select Dynamic Web module-> Click the value in further configuration available->content directory to src/main/webapp,-> tick generate Web.xml deployment Descriptor->ok.
③ Execute maven Command:
Select Pom.xml, right click, run as.