Build a framework from scratch Ssm+redis+mysql (ii) MAVEN project setup
Nonsense not to say, direct to the steps!!!
1. Create the main project: Ncc-parent
Select maven to create the project, note in the Create project,packing select pom, which represents this is not a project, just a Maven 's main project, this project is used to integrate multiple sub-projects
2. Create the Ncc-core sub-project:
Note: When creating a project, you need to select parentProject to navigate to the NCC-parentthat youcreated earlierso that dependencies on thesubproject are inherited from the parent project;
3. Create the Ncc-front project:
1, create a maven-web project;
Similarly, create a ncc-host project in the same way you create ncc-front;
4. Catalog Structure of the project
Modify the JRE for the project and several other items to be modified
After modification
5.Maven of dependency Testing
in the main project's pom file, add:
<Dependencies> <Dependency> <groupId>Junit</groupId> <Artifactid>Junit</Artifactid> <version>4.12</version> </Dependency></Dependencies>
Note: If you modify the pom.xml file of the parent Project when the project is published, you need to load the project in the maven repository
Refresh the project to see that three sub-projects have inherited the JUnit configuration of the master project ;
6. Environmental configuration of the project
to configure a consolidated build: Add in the main project's Pom :
<Build> <Plugins> <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-compiler-plugin</Artifactid> <Configuration> <Source>1.7</Source> <Target>1.7</Target> </Configuration> </plugin> </Plugins></Build>
A missing error occurred.
Refresh all child items to
Configure the Unified compilation character set: add in main project Pom.xml
< Properties > < project.build.sourceEncoding > UTF-8</project.build.sourceEncoding></Properties >
MAVEN project Setup (end)
Build a framework from scratch Ssm+redis+mysql (ii) MAVEN project setup